[BUG] claude mcp serve exposes Agent tool but registry is empty

Open 💬 1 comment Opened Jun 2, 2026 by jeff29922

Summary

claude mcp serve exposes an Agent tool over MCP, but calls to that tool fail because the agent registry is empty. The same Claude Code installation can invoke subagents successfully through the normal CLI path, and other MCP tools from the same mcp serve process work.

This makes the MCP server advertise an unusable Agent capability.

Environment

  • OS: Windows
  • Claude Code version: 2.1.160 (Claude Code)
  • Install path used by the MCP client: C:\Users\<user>\.local\bin\claude.exe
  • MCP server command: claude.exe mcp serve

What works

Direct CLI subagent delegation works:

claude.exe --version
claude.exe -p "Use a subagent to report OK in one sentence. Do not modify files."

Observed output:

2.1.160 (Claude Code)
The subagent reported OK.

The MCP server itself also works for non-Agent tools. A direct JSON-RPC call to Glob through claude mcp serve returned expected file results.

What fails

Calling the advertised MCP Agent tool fails:

{
  "jsonrpc": "2.0",
  "id": 3,
  "method": "tools/call",
  "params": {
    "name": "Agent",
    "arguments": {
      "description": "MCP agent smoke",
      "prompt": "Reply OK only. Do not modify files."
    }
  }
}

Observed result:

{
  "result": {
    "content": [
      {
        "type": "text",
        "text": "Agent type 'general-purpose' not found. Available agents:"
      }
    ],
    "isError": true
  },
  "jsonrpc": "2.0",
  "id": 3
}

The same failure occurs when explicitly passing subagent_type: "general-purpose".

Additional checks

I also tested whether this was just missing runtime agent configuration by starting the MCP server with a custom agent definition:

claude.exe --agents '{"smoke-agent":{"description":"Smoke test agent","prompt":"You are a smoke test agent. Reply OK only."}}' mcp serve

Then I called Agent with subagent_type: "smoke-agent". It still failed with:

Agent type 'smoke-agent' not found. Available agents:

So the registry appears empty inside the mcp serve execution path even when agents are supplied via the top-level --agents option.

Expected behavior

Either:

  1. claude mcp serve should wire the MCP Agent tool to the same subagent registry available to normal Claude Code sessions, including built-in general-purpose; or
  2. claude mcp serve should not advertise the Agent tool if subagent dispatch is unsupported in MCP-server mode.

Why this seems like a bug

  • Agent is advertised in tools/list from claude mcp serve.
  • Its schema says omitting subagent_type defaults to general-purpose.
  • Normal Claude Code subagent dispatch works on the same machine and version.
  • Normal MCP tools from the same server work.
  • Only the MCP Agent path has an empty registry.

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗