MCP breaks after switching between Cursor IDE and Agents window on the same WSL Remote workspace

Where does the bug appear (feature/product)?

Cursor IDE

Describe the Bug

Description

When working on a project opened in WSL Remote (vscode-remote://wsl+ubuntu/…), MCP works in Cursor IDE, but breaks after using the Cursor Agents window on the same workspace.

Both the IDE and the Agents window open the project in WSL Remote mode — not as a native Windows folder (\wsl$... or D:...).

After switching IDE ↔ Agents window, the agent can no longer call MCP tools. Settings → MCP still shows the server as Connected, but tool calls fail or return empty results.

This does not appear to be a misconfigured mcp.json. It looks like per-workspace MCP/session state gets corrupted when switching between the two Cursor UIs on the same remote workspace.

Environment

  • OS: Windows (host) + WSL Ubuntu (remote)
  • Cursor: Windows app, workspace opened via WSL Remote
  • Workspace URI: vscode-remote://wsl+ubuntu/home//…/project
  • MCP server: codegraph (installed on WSL only, not on Windows PATH)
  • MCP config: .cursor/mcp.json in project (or ~/.cursor/mcp.json on WSL)

Example MCP config:

{
“mcpServers”: {
“codegraph”: {
“type”: “stdio”,
“command”: “codegraph”,
“args”: [“serve”, “–mcp”, “–path”, “${workspaceFolder}”]
}
}
}

Actual Behavior

  • MCP tool calls fail after switching IDE ↔ Agents window
  • Settings → MCP still shows the server as Connected
  • Agent cannot use MCP tools (fail silently or return empty)
  • Issue persists across window reloads

Steps to Reproduce

  1. Put a project in WSL Ubuntu (e.g. /home//workspace/my-project)
  2. Install an MCP server on WSL only (e.g. codegraph on Linux PATH)
  3. Open the project in Cursor IDE via WSL Remote → confirm MCP works (agent can call tools)
  4. Open the same project in the Cursor Agents window (still WSL Remote, same URI)
  5. Use the Agents window for a session
  6. Return to Cursor IDE on the same workspace
  7. Try to use the agent with MCP tools again

Expected Behavior

  • MCP should keep working across IDE and Agents window when both use the same WSL Remote workspace
  • Or Cursor should show a clear warning if switching UIs can break MCP state

Operating System

Windows 10/11

Version Information

IDE version v3.7.12

Additional Information

Workarounds Attempted

:cross_mark: Does NOT fix the issue:
Deleting only WSL project cache:
rm -rf ~/.cursor/projects//

  • Cursor recreates this folder on reopen
  • MCP remains broken
  • State also lives in Windows-side storage:
    C:\Users<user>\AppData\Roaming\Cursor\User\workspaceStorage<hash>\

:white_check_mark: Does fix the issue (verified):

  1. Add .cursor/mcp.json in the project repo
    → Forces MCP to re-bind for that workspace on the WSL remote host

  2. Delete both cache locations (with Cursor fully closed):

    • WSL: ~/.cursor/projects//
    • Windows: C:\Users<user>\AppData\Roaming\Cursor\User\workspaceStorage<hash>
      :warning: This also removes chat history for that workspace
  3. Rename the project folder
    → Creates a new workspace identity → MCP works again

Additional Context

State appears split across multiple locations:

  • ~/.cursor/projects// (WSL) → MCP descriptors, agent cache, terminals (recreated on open)
  • workspaceStorage// (Windows) → workspace identity, chat history, MCP UI state
  • ~/.cursor/mcp.json (WSL) → user-level MCP config
  • C:\Users<user>.cursor\mcp.json (Windows) → global MCP config (may be empty {})

Terminology clarification:
This is not about “Windows Agent vs Linux Agent.” Both Cursor IDE and the Cursor Agents window open the project in WSL Remote. The bug is triggered by switching between these two UIs on the same remote workspace.

Why .cursor/mcp.json in the repo helps:
Even when both UIs use WSL Remote, switching between IDE and Agents window seems to corrupt the per-workspace MCP binding. Project-level mcp.json forces re-registration on the WSL remote host where the MCP binary exists.

Feature Requests

  1. Warning when switching between IDE and Agents window on the same WSL Remote workspace if MCP state may be affected
  2. One-click reset for stale MCP/workspace state (both projects/ and workspaceStorage/)
  3. Documentation on how MCP binding works across IDE vs Agents window when both use WSL Remote
  4. Option to pin MCP execution to the remote host for WSL workspaces

Optional info to add

  • Cursor version: Help → About
  • WSL distro/version: wsl -l -v
  • Screenshot: Settings → MCP showing Connected while tools fail
  • Screenshot: Agents window also showing WSL Remote in status bar
  • MCP errors from Help → Toggle Developer Tools → Console

Does this stop you from using Cursor

No - Cursor works, but with this issue

Hey, thanks for the detailed report. You laid everything out really well, down to cache locations and workarounds.

This is a known limitation. Agents Window (Glass) doesn’t correctly resolve the MCP config for remote workspaces yet (WSL and SSH). Editor Window delegates resolution to the remote extension host correctly, but in some cases Agents Window pulls state from the local Windows host. Because of that, after switching, the per-workspace MCP binding goes stale. That matches your symptom. Settings shows Connected, but tool calls fail silently.

Your main workaround, a project-level .cursor/mcp.json in the repo, is the right mitigation for now. It forces workspace-scoped registration on the WSL host where the binary actually lives, and both windows handle that config more consistently than the user-level one.

Related threads on the same topic (you can subscribe for updates):

I’ve reported the issue internally. I can’t share an exact ETA for a fix yet. I also passed along your feature requests, a warning on switch, a one-click state reset, and an option to pin MCP to the remote host. Let me know if the project-level config stops helping anywhere.