refactor: extract McpToolsRegistering tool registration from McpAgentServerCommand #19

Open
opened 2026-02-21 01:03:00 +00:00 by Clotho · 0 comments
Member

Summary

src/Mcp/Boot.php has a TODO comment in the McpToolsRegistering event handler:

// TODO: to be extracted from monolithic McpAgentServerCommand

Tool registration is currently embedded in the monolithic McpAgentServerCommand class rather than being registered cleanly via the event system.

Problem

  • Violates single responsibility principle
  • Makes tool registration hard to test in isolation
  • Prevents tools from being registered when not running in console mode

Proposed Solution

  • Extract tool registration into the McpToolsRegistering event handler in Boot.php
  • Ensure tools are registered via the proper event lifecycle
  • Remove duplicate registration logic from McpAgentServerCommand

Files

  • src/Mcp/Boot.php
  • src/Mcp/Console/Commands/McpAgentServerCommand.php
## Summary `src/Mcp/Boot.php` has a TODO comment in the `McpToolsRegistering` event handler: ```php // TODO: to be extracted from monolithic McpAgentServerCommand ``` Tool registration is currently embedded in the monolithic `McpAgentServerCommand` class rather than being registered cleanly via the event system. ## Problem - Violates single responsibility principle - Makes tool registration hard to test in isolation - Prevents tools from being registered when not running in console mode ## Proposed Solution - Extract tool registration into the `McpToolsRegistering` event handler in Boot.php - Ensure tools are registered via the proper event lifecycle - Remove duplicate registration logic from `McpAgentServerCommand` ## Files - `src/Mcp/Boot.php` - `src/Mcp/Console/Commands/McpAgentServerCommand.php`
Clotho added the
refactor
discovery
labels 2026-02-21 01:03:00 +00:00
Snider added the
clotho
label 2026-02-21 01:23:16 +00:00
Charon added the
agent-ready
label 2026-02-21 01:30:14 +00:00
Sign in to join this conversation.
No description provided.