[BUG] claude mcp serve exposes Agent tool but registry is empty
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:
claude mcp serveshould wire the MCPAgenttool to the same subagent registry available to normal Claude Code sessions, including built-ingeneral-purpose; orclaude mcp serveshould not advertise theAgenttool if subagent dispatch is unsupported in MCP-server mode.
Why this seems like a bug
Agentis advertised intools/listfromclaude mcp serve.- Its schema says omitting
subagent_typedefaults togeneral-purpose. - Normal Claude Code subagent dispatch works on the same machine and version.
- Normal MCP tools from the same server work.
- Only the MCP
Agentpath has an empty registry.
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗