[BUG] Cursor IDE integration fails: option disappears after brief availability
Status Open
Reported on v2.1.19
Maintainer reply None cached
Activity 4 comments · opened Jan 25, 2026
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
The Claude Code extension for Cursor fails to maintain a connection.
- Upon launching
claudein the Cursor terminal, a red "IDE disconnected" message appears briefly. - If
/ideis run immediately: "Cursor" appears in the list. Selecting it results in no connection established (state remains disconnected). - If
/ideis run after a few seconds delay (or for a second time): The "Cursor" option disappears entirely ("No available IDEs detected").
What Should Happen?
The connection to Cursor IDE should be established and maintained stably, the "Cursor" option should remain available in /ide menu.
Error Messages/Logs
Debug logs show a repeated reconnection loop:
[DEBUG] MCP server "ide": Successfully connected to ws-ide server in 48ms
[DEBUG] MCP server "ide": WS-IDE connection closed after 0s (cleanly)
[ERROR] MCP server "ide" Failed to fetch tools: MCP error -32000: Connection closed
... (repeats indefinitely)
System state verified:
- .claude/ide/*.lock file exists and matches Cursor process
- netstat confirms ESTABLISHED TCP connection to localhost port from lockfile
Steps to Reproduce
- Environment: Windows 11, Cursor 2.4.21 (x64), Claude Code 2.1.19.
- Open a terminal in Cursor (PowerShell or Git Bash).
- Run
claude. - Observe the brief "IDE disconnected" flash.
- Run
/ideimmediately -> try to select "Cursor" -> connection fails. - Run
/ideagain -> "Cursor" option is gone.
Claude Model
Opus
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
2.1.19 (Claude Code)
Platform
Other
Operating System
Windows
Terminal/Shell
PowerShell
Additional Information
_No response_
4 Comments
Found 3 possible duplicate issues:
This issue will be automatically closed as a duplicate in 3 days.
🤖 Generated with Claude Code
This is NOT a strict duplicate.
While it shares the underlying technical symptom (MCP connection closed/race condition) with #12449 and #20713, and the platform symptoms with #18268 (Windows 11), this report specifically confirms the issue for Cursor IDE.
Issue #18268 refers to IntelliJ. The fix for IntelliJ might not solve the issue for Cursor if the extension implementation differs. Please keep this open to ensure the fix is verified against Cursor on Windows as well.
Still relevant
Same failure here on Windows 11 with Cursor 3.16.24, CLI and extension both 2.1.233. I captured the extension side, which I have not seen posted in this thread yet, and I think it explains the connect-then-close-after-0s signature.
The underlying cause looks like the one-connection-per-window design rather than a detection problem. In
extension.jsthe WebSocket server keeps a single transport variable bound to a single MCPServerinstance, and on every new connection it closes the previous one:The
/idepicker states the limit on VS Code ("Note: Only one Claude Code instance can be connected to VS Code at a time.") but that note does not render in Cursor, so on Cursor it just looks like a broken install.Extension log from a freshly reloaded window. Session A connects and holds. Session B arrives ten seconds later, takes the slot, then dies twice:
CLI side of the same moment, from
claude --debug --debug-file:The socket is accepted and registered, then closes before
transport.start()runs, which is why the error isWebSocket is not openrather than a refused connection.The difference between the two editors is that on VS Code the handoff completes (new session connects, old one drops, which is the intended newest-wins behavior) while on Cursor the newcomer triggers the eviction and then loses its own socket, so it never takes over. Reproduced 5 times across two extension host lifetimes, on both Git Bash and PowerShell, so it is deterministic rather than a race.
Ruled out on my side: version mismatch, stale or invalid lock file, auth token (a manual WebSocket handshake with the lock's token connects fine, a bogus token logs
Unauthorized), dead port, workspace path mismatch, IPv6 loopback resolution, proxy env vars, and contention between windows.I filed a related feature request to lift the one-connection limit, with the same evidence: #87130