Project .cursor/mcp.json fails to expand ${workspaceFolder} when molten_agents_window is enabled (Windows)

Where does the bug appear (feature/product)?

Grok Build (formerly Cursor)

Describe the Bug

After the molten_agents_window feature flag was enabled for my account (without changing .cursor/mcp.json), project-level stdio MCP servers configured with ${workspaceFolder} in .cursor/mcp.json stopped starting.

${workspaceFolder} is passed literally to the command without expansion, causing startup to fail:

MCP error -32000: Connection closed; non-JSON-RPC output on stdout before initialize;
stderr: The argument '${workspaceFolder}/scripts/start-mcp.ps1' to the -File parameter does not exist.

The exact same .cursor/mcp.json worked normally on Cursor 3.32.24 while molten_agents_window was off (built-in Agents Window). The issue started on 3.32.24 as soon as molten_agents_window turned on, and still reproduces after updating to 3.32.25.

Additionally, because molten_agents_window is enabled via the server-side gate for my account, the “Agents Window Type” / “Try the beta Agents Window” setting is not shown in Settings, so there is no way to switch back to the built-in Agents Window.

Steps to Reproduce

  1. Open a local Windows project containing .cursor/mcp.json:
{
  "mcpServers": {
    "local-script-mcp": {
      "command": "powershell",
      "args": [
        "-NoProfile",
        "-ExecutionPolicy",
        "Bypass",
        "-File",
        "${workspaceFolder}/scripts/start-mcp.ps1"
      ]
    }
  }
}
  1. Launch Cursor with molten_agents_window enabled (so MCP servers are started by agent-host-daemon).
  2. Open Settings → MCP and check the server status / Output log.

Expected Behavior

${workspaceFolder} in project .cursor/mcp.json should be resolved to the opened workspace root path (matching the documented behavior and the classic workbench behavior), and the stdio MCP server should start and connect normally.

Operating System

Windows 10/11

Version Information

Version: 3.32.25 (user setup)
VS Code Extension API: 1.147.0
Commit: d3b7354f6e7809088c6623719f50cfbdf33a0480
Date: 2026-12-01T21:11:11.735Z
Layout: Agent Window (Molten)
Build Type: Stable
Release Track: Default
Electron: 43.8.9
Chromium: 150.0.7871.250
Node.js: 24.22.1
V8: 15.0.245.31-electron.0
xterm.js: 6.1.0-beta.291
OS: Windows_NT x64 10.0.22631

For AI issues: which model did you use?

N/A (MCP startup issue, not model-specific)

Additional Information

Root Cause Clue

  • In the classic workbench (workbench.desktop.main.js), resolveServerVariables uses configurationResolverService.resolveAsync(...), which resolves ${workspaceFolder}.
  • When molten_agents_window is active, MCP servers are loaded by agent-host-daemon (createHeadlessMcpLease → FileConfigMcpDefinitionSource → getMcpConfig), where expandEnvVarsWithLookup2 only looks up process.env[key] and does not inject ${workspaceFolder} (nor set a default cwd to the project root for ./ relative paths).
  • As a result, teams sharing a portable .cursor/mcp.json cannot use ${workspaceFolder} or ./... without hardcoding machine-specific absolute paths.

Workaround Confirmed

Setting workspaceFolder=<project-root> in the process environment before launching Cursor.exe (after ensuring any lingering agent-host-daemon has exited) makes expandEnvVarsWithLookup2 resolve ${workspaceFolder} and restores MCP connectivity.

Does this stop you from using Grok

Yes - Grok is unusable

Update: After applying the workspaceFolder environment variable workaround on Windows (3.32.25), I found two additional Windows regressions in agent-host-daemon’s StdioClientTransport:

  1. PATHEXT is stripped from DEFAULT_INHERITED_ENV_VARS on Windows

    • DEFAULT_INHERITED_ENV_VARS only inherits 12 variables (APPDATA, HOMEDRIVE, HOMEPATH, LOCALAPPDATA, PATH, PROCESSOR_ARCHITECTURE, SYSTEMDRIVE, SYSTEMROOT, TEMP, USERNAME, USERPROFILE, PROGRAMFILES) and omits PATHEXT (and COMSPEC/TMP).
    • Because PATHEXT is missing, PowerShell 5.1 falls back to .CPL only and fails to execute .exe commands (e.g., dotnet, CLI tools) inside MCP launcher scripts unless the script manually restores $env:PATHEXT.
  2. Visible console windows stay open for stdio MCP servers (windowsHide: false)

    • StdioClientTransport sets windowsHide: process.platform === "win32" && isElectron().
    • Because agent-host-daemon runs in plain node.exe (not Electron), isElectron() is false, so windowsHide becomes false and visible cmd.exe / PowerShell console windows (e.g., npx chrome-devtools-mcp) pop up and remain open on Windows.

Hi @tbt, you’re right on both counts. The new Agents Window doesn’t resolve ${workspaceFolder} in a project’s .cursor/mcp.json yet, and a server with no cwd doesn’t start in the project folder either. This is a known issue the team is aware of, and I’ve added your report to it.

Your environment variable workaround is fine to keep for now, as long as you work in one project at a time. The other route that leaves the shared file untouched is the editor window, which still resolves the variable: right-click the project in the sidebar and choose Open in IDE.

There’s also no setting to go back to the previous Agents Window on your account at the moment.

Hi @Colin, thanks for the quick response and for adding this to the tracking issue!
I’ll stick with the environment variable workaround for now so I can keep using the new Agents Window. Looking forward to the fix — and I’d really appreciate it if the team could also take a look at the two Windows follow-ups above (PATHEXT being stripped and windowsHide: false keeping console windows open).