Skip to content

Implement list_mcp_servers for Claude Code adapter #3

Description

@ScottRBK

The unified MCP server config API (#2) ships with list_mcp_servers implemented for OpenCode and Copilot CLI but raising NotImplementedError for Claude Code (see src/agent_shell/adapters/claude_code_adapter.py:list_mcp_servers).

Why deferred

claude mcp list outputs a one-line-per-server summary, not enough to round-trip back into a full MCPServerSpec. Reconstructing requires either:

  1. Parsing per-server output of claude mcp get <name> (one subprocess per server)
  2. Reading ~/.claude.json directly (couples to internal Claude Code file format, may break across CLI versions)

Acceptance

  • Decide between (1) and (2) above
  • Implement and round-trip-test against add_mcp_server (mirror the OpenCode/Copilot tests in tests/integration/test_*_mcp_integration.py::TestListMcpServers)
  • Remove the NotImplementedError and test_raises_not_implemented test

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions