Commit Graph

1 Commits

Author SHA1 Message Date
freemo 81c2878ec8 feat(mcp): implement lazy start/auto-stop and sandbox path rewriting for MCP tools
Add lifecycle management and sandbox support for MCP tools:

- McpClient: lazy start (server starts on first call_tool()),
  configurable idle timeout with auto-stop, health monitoring
  with automatic restart on server crash
- McpRegistry: namespace-isolated tracking of multiple MCP servers
  with independent lifecycles
- SandboxPathRewriter: bi-directional file path rewriting between
  host and sandbox workspaces using PathMapper
- MCPCapabilityMetadata: structured exposure of full MCP server
  capabilities (tools, resources, prompts)
- MCPToolDescriptor: extended with annotations field
- MCPToolAdapter: capability_metadata property, enhanced source_metadata
  with server capabilities and tool annotations

BDD scenarios:
- 16 lifecycle scenarios (lazy start, auto-stop, health check, registry)
- 10 sandbox path rewriting scenarios (arguments, responses, roundtrip)
- All 42 existing MCP adapter scenarios continue to pass

ISSUES CLOSED: #938
2026-03-30 22:42:15 +00:00