claude-code - 💡(How to fix) Fix Feature request: sequential/batched MCP server startup to avoid cold-cache timeouts

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Fix Action

Workaround

Current workaround: wrap each server command in a script that adds a per-server delay before spawning the real process. This is fragile and adds maintenance burden.

Code Example

{
  "mcpServers": {
    "server-a": { "command": "...", "startupDelay": 0 },
    "server-b": { "command": "...", "startupDelay": 2000 },
    "server-c": { "command": "...", "startupDelay": 4000 }
  }
}

---

{
  "sequentialStartup": true,
  "startupDelayMs": 2000,
  "mcpServers": { ... }
}
RAW_BUFFERClick to expand / collapse

Problem

When .mcp.json has many stdio servers (e.g., 8-11), the first session after a cold npm/pip cache causes multiple servers to fail with timeouts. Each npx-based server downloads packages simultaneously, competing for network and CPU. With 11 servers, 6+ can fail on first run. They work fine individually or with warm cache.

This is especially painful on Windows where cmd /c npx -y has higher spawn overhead.

Proposed solution

Add a startupDelay or startupOrder field to .mcp.json server entries, or a top-level sequentialStartup: true flag. When set, Claude Code would stagger server initialization with a configurable delay between each (e.g., 2-3 seconds), allowing each server's package downloads to complete before the next begins.

Example config:

{
  "mcpServers": {
    "server-a": { "command": "...", "startupDelay": 0 },
    "server-b": { "command": "...", "startupDelay": 2000 },
    "server-c": { "command": "...", "startupDelay": 4000 }
  }
}

Or simpler:

{
  "sequentialStartup": true,
  "startupDelayMs": 2000,
  "mcpServers": { ... }
}

Evidence

Tested with 11 stdio MCP servers on Windows 11:

  • Cold cache: 5/11 connected, 6 failed (timeouts at ~15s)
  • Warm cache: 10/11 connected, 1 failed (separate bug in that server)
  • Individual startup: all 11 pass handshake successfully

Workaround

Current workaround: wrap each server command in a script that adds a per-server delay before spawning the real process. This is fragile and adds maintenance burden.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

claude-code - 💡(How to fix) Fix Feature request: sequential/batched MCP server startup to avoid cold-cache timeouts