Claude Code spawns stdio MCP child process even when server is configured as HTTP transport
Describe the bug
When an MCP server is configured with "type": "http" in ~/.claude/claude.json, Claude Code still spawns a separate stdio child process for the same server on every new session. This results in redundant MCP server processes accumulating — one stdio process per Claude Code session, in addition to the shared HTTP server.
To reproduce
- Start an MCP server as a shared HTTP endpoint (e.g.,
node server.js --http --port=3001)
- Configure
~/.claude/claude.json:
{
"mcpServers": {
"my-server": {
"type": "http",
"url": "http://127.0.0.1:3001/mcp"
}
}
}
- Open a Claude Code session — tools from the MCP server work correctly (via HTTP)
- Check running processes — a stdio child process
node server.js(without--http) has been spawned by the Claude Code CLI, in addition to the existing HTTP server
- Open more Claude Code sessions — each one spawns another stdio child process
Expected behavior
When "type": "http" is configured, Claude Code should connect to the HTTP endpoint only and NOT spawn a stdio child process.
Observed behavior
Claude Code both connects to the HTTP endpoint AND spawns a stdio child process for the same server. Each new session creates an additional stdio process (~50-60 MB each).
Process tree example (5 sessions open):
node server.js --http --port=3001 ← shared HTTP server (started manually)
node server.js ← stdio, child of claude-code session 1
node server.js ← stdio, child of claude-code session 2
node server.js ← stdio, child of claude-code session 3
node server.js ← stdio, child of claude-code session 4
node server.js ← stdio, child of claude-code session 5
Verification
~/.claude/claude.jsononly contains the HTTP config (no stdio config anywhere)- No
.mcp.jsonfiles at project level - No other config sources override the HTTP setting
- The HTTP server responds correctly (
curlreturns 400 as expected for non-MCP requests) netstatconfirms active HTTP connections to the HTTP port- The stdio child processes are direct children of
claude-code/cli.jsprocesses
Environment
- Claude Code version: 2.1.63
- Platform: Windows (MINGW/Git Bash)
- Node.js: installed via official installer
- MCP server: custom Node.js server supporting both stdio and HTTP transport
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗