Repository navigation
Description
Before submitting
- I searched existing issues and did not find a duplicate.
- I included enough detail to reproduce or investigate the problem.
Area
apps/server
Steps to reproduce
- Add an unreachable / packet-dropping HTTP or stdio-bridge MCP server to
~/.cursor/mcp.json(for example a corporate/VPN-only endpoint such ashttps://internal-mcp.example.com/mcpwhen off VPN, or a non-routable IP likehttps://192.0.2.1/mcp). - Start a new Cursor thread in T3 Code (e.g.
gemini-4-neon,cursor-agent-sdk.local). - Send
"hi", wait for the reply, then send a second short follow-up message. - Inspect the thread's provider event log (
events.<thread-id>.log).
Expected behavior
Follow-up turns in a live Cursor thread should reuse the session's existing MCP connections and start streaming immediately (~1–3s), matching Claude (claude-agent-sdk) and Codex (codex.app-server), which connect MCP servers once per session/thread and do not block turn startup on slow/unreachable MCP servers.
Actual behavior
Every single user turn blocks for ~62–65 seconds between run.started and the first model call, even for a trivial "hi" whose actual model call takes ~3.9s (0.6s thinking). Subsequent tool-loop model calls within the same turn take only 3–5s, confirming the stall happens strictly once per run.start.
Root cause:
- T3 Code passes
mcpServers: { "t3-code": ... }on everyrun.start(send), rather than only at agent open. - In bundled
@cursor/sdk(1.4.2), passing send-levelmcpServershits themcpServersOverridepath (createSessionMcpLease), which creates a brand-newDefinitionMcpLoaderwith an emptyclientCachewhile keepingincludeUserMcp: true— so it re-reads~/.cursor/mcp.jsonand reconnects every configured MCP server in parallel on every turn,awaiting all of them before the first model call. - When any server in
~/.cursor/mcp.jsonsilently drops packets (e.g. corporate MCP servers while off VPN), discovery blocks until the SDK's 60,000 ms timeout (60s) on every turn.
When back on VPN (so the internal endpoint responds in ~0.4s), the per-turn run.started → first model call delay dropped from ~62–65s down to ~9–11s, still paying the unnecessary reconnect cost on every turn.
Related PR / history:
- Open PR perf(cursor): messages no longer reconnect every MCP server #32533 (
perf(cursor): messages no longer reconnect every MCP server) directly addresses the per-turn reconnect (currently has a merge conflict withmain). Its benchmarks measured ~0.8–1s savings with reachable local MCP servers; this issue documents the much larger ~60s/turn real-world impact when any user MCP server is unreachable / off-VPN. - Closed [Bug]: Cursor threads lose all user, plugin, and project MCP servers because mcpServers is passed on every send #15268 originally tracked send-level
mcpServersdropping user/project MCPs. - Even after perf(cursor): messages no longer reconnect every MCP server #32533 lands for warm follow-up turns, Turn 1 (and any turn after idle close/reopen) will still wait up to 60s if
@cursor/sdkcontinues to block synchronously on unreachable MCP servers (unlike Claude and Codex, which start turns immediately while MCPs connect in the background).
Impact
Major degradation or frequent failure
Version or commit
T3 Code 0.1.12-nightly.20261124.5204 (desktop), bundled @cursor/sdk 1.4.2
Environment
macOS (darwin 25.6.0, Apple Silicon), T3 Code Nightly desktop 0.1.12-nightly.20261124.5204, Cursor provider (cursor-agent-sdk.local), model gemini-4-neon (high effort, 1m context).
Logs or stack traces
# Turn 1 ("hi") — off VPN (67.8s from run.started to thinking-completed, but model step was 3.86s):
[2026-11-24T19:12:36.607Z] outgoing run.start options.mcpServerNames=["t3-code"]
[2026-11-24T19:12:39.640Z] incoming run.started
[2026-11-24T19:13:47.414Z] incoming thinking-completed thinkingDurationMs=639
[2026-11-24T19:13:47.524Z] incoming step-completed stepDurationMs=3856
[2026-11-24T19:13:50.321Z] incoming run.completed durationMs=73711
# Turn 2 (follow-up in same live agent) — still ~62s before model step started:
[2026-11-24T19:15:38.610Z] outgoing run.start options.mcpServerNames=["t3-code"]
[2026-11-24T19:15:39.880Z] incoming run.started
[2026-11-24T19:16:51.791Z] incoming thinking-completed thinkingDurationMs=6842
[2026-11-24T19:16:54.770Z] incoming step-completed stepDurationMs=12649
[2026-11-24T19:16:57.669Z] incoming run.completed durationMs=79054
# Turn 3 (follow-up in same live agent) — ~65s before first model call, then 3-5s per subsequent tool-loop call:
[2026-11-24T19:18:01.955Z] outgoing run.start options.mcpServerNames=["t3-code"]
[2026-11-24T19:18:03.000Z] incoming run.started
[2026-11-24T19:19:08.997Z] incoming thinking-completed thinkingDurationMs=1099
[2026-11-24T19:19:10.840Z] incoming tool-call-completed
[2026-11-24T19:19:15.702Z] incoming tool-call-started (+4.8s)
[2026-11-24T19:19:20.273Z] incoming tool-call-started (+4.0s)
# Turn 4 (after connecting to VPN so internal MCP responds in 0.39s):
[2026-11-25T07:41:36.684Z] outgoing run.start options.mcpServerNames=["t3-code"]
[2026-11-25T07:41:39.856Z] incoming run.started
[2026-11-25T07:41:50.557Z] incoming thinking-completed thinkingDurationMs=1494 (+10.7s total)
Workaround
Connect to VPN so the configured internal MCP servers respond instead of timing out, or temporarily remove/disable unreachable servers from ~/.cursor/mcp.json.
Activity