MCP Shipyard
← Rules catalog

MCP server connection timeout: slow initialize handshake and cold starts

A slow initialize is the most common connection failure for remote MCP servers. Measure handshake time, remove cold starts and WAF delays.

majorlatency.handshakeClaude, ChatGPT, General

Make the MCP handshake answer in well under 2.5 seconds. The rule warns above 2.5 s and fails above 8 s, and its fix text calls an initialize timeout the most common connection failure. Remove cold starts, skip database work during the handshake, and keep any WAF from holding the response.

What you see

  • A scan reports latency.handshake with detail such as "initialize: 9120 ms". Under 2.5 s passes, 2.5 to 8 s warns, over 8 s fails. Severity is major.
  • Intermittent failures to add the connector, usually after the server has been idle (cold start).
  • Client message wording varies and is not verified here. "Couldn't reach the MCP server" has several causes; see auth.prm-missing for another.

Why it happens

Serverless functions and scaled-to-zero containers start slowly after idle time. Servers that open database connections, load models or call an upstream API inside the handshake add to it. Bot-protection layers can also hold a first request while they score it.

Note on protocol versions: the repo notes that initialize was removed in MCP 2026-07-28 and identity and capabilities come from server/discover. The rule measures timing keys matching init, handshake or connect; which request that corresponds to depends on the revision your server speaks.

Check it yourself

# Legacy revision handshake
curl -s -o /dev/null -w 'total: %{time_total}s\n' -X POST https://mcp.acme.example/mcp \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json, text/event-stream' \
  -d '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-11-25","capabilities":{},"clientInfo":{"name":"timing-test","version":"1.0.0"}}}'

Run it after at least 15 minutes idle to catch the cold start, then again immediately. A 401 is acceptable for the timing test; the time to the 401 still counts. Repeat from a different region.

Fix

  • Keep one instance warm (minimum instances, provisioned concurrency, or a keep-alive ping every few minutes).
  • Make the handshake static: return server name, version and capabilities from memory.
  • Lazy-load databases and models on first tool call, not at import time.
  • Check CDN and WAF rules for /mcp and /.well-known/*; bypass bot challenges there.
  • Keep OAuth endpoints fast too (auth.discovery-latency).
// Do not do this inside the handshake:
// await db.connect(); await loadModel();

Verify

Repeat the curl command cold and warm. Both should be under 2.5 seconds. Re-scan.

Which clients care

Tagged Claude, ChatGPT and general. The rule text does not give per-client timeout values for the handshake.

Source

Claude testing docs: https://claude.com/docs/connectors/building/testing

Run a free scan at https://mcpshipyard.com/scan to check every rule at once.

Check every rule at once

A free scan runs this check and the other 152 against your live URL.

Scan a server