Claude Code spawns stdio MCP child process even when server is configured as HTTP transport

Resolved 💬 3 comments Opened Feb 28, 2026 by wukoayos Closed Mar 29, 2026

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

  1. Start an MCP server as a shared HTTP endpoint (e.g., node server.js --http --port=3001)
  1. Configure ~/.claude/claude.json:
{
  "mcpServers": {
    "my-server": {
      "type": "http",
      "url": "http://127.0.0.1:3001/mcp"
    }
  }
}
  1. Open a Claude Code session — tools from the MCP server work correctly (via HTTP)
  1. 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
  1. 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.json only contains the HTTP config (no stdio config anywhere)
  • No .mcp.json files at project level
  • No other config sources override the HTTP setting
  • The HTTP server responds correctly (curl returns 400 as expected for non-MCP requests)
  • netstat confirms active HTTP connections to the HTTP port
  • The stdio child processes are direct children of claude-code/cli.js processes

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

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗