[Bug]: Cursor provider fails to start project MCP servers using ${workspaceFolder} and unresolved environment variables#22199

opened22d agobyJJeremyMoeglich

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

Create server.mjs at the project root:

js
1import { createInterface } from "node:readline";
2
3for await (const line of createInterface({ input: process.stdin })) {
4 const { id, method } = JSON.parse(line);
5 if (id === undefined) continue;
6
7 const result = method === "initialize"
8 ? {
9 protocolVersion: "2024-11-05",
10 capabilities: { tools: {} },
11 serverInfo: { name: "repro", version: "1.0.0" }
12 }
13 : method === "tools/list" ? { tools: [] } : {};
14
15 console.log(JSON.stringify({ jsonrpc: "2.0", id, result }));
16}

Add .cursor/mcp.json:

json
1{
2 "mcpServers": {
3 "repro": {
4 "command": "node",
5 "args": ["${workspaceFolder}/server.mjs"]
6 }
7 }
8}
  1. Open the project in Cursor IDE and confirm the MCP server connects.
  2. Open the same project in T3 Code using the Cursor provider.
  3. Ask the agent to discover MCP servers.
  4. The server fails to start because ${workspaceFolder} remains literal.

Expected behavior

${workspaceFolder} resolves to the thread's workspace directory, as it does in Cursor IDE.

Actual behavior

The SDK passes ${workspaceFolder}/server.mjs unchanged to Node. Node exits with MODULE_NOT_FOUND, and the MCP server is unavailable.

Impact

Major degradation or frequent failure

Version or commit

0.1.1-nightly.20261020.3386; bundled @cursor/sdk 1.0.35

Environment

Windows x64; T3 Code Nightly desktop; Cursor provider; full-access mode.

Logs or stack traces

shell
1Error: Cannot find module '<working-directory>\${workspaceFolder}\server.mjs'
2code: MODULE_NOT_FOUND

Screenshots, recordings, or supporting files

No response

Workaround

An absolute script path avoids the unresolved placeholder, but is unsuitable for shared, Git-tracked configuration and different worktrees.

Checked current main 8acbefefc5. No matching open issue or PR found.

On Linux x64, created the reported server.mjs and .cursor/mcp.json fixture and attempted MCP discovery with bundled Cursor SDK 1.0.35, project settings enabled, and full access. The SDK reports logged-out; the turn fails with Invalid User API Key. The isolated dev server started and browser pairing succeeded, but the web client remained on its splash screen.

The reported placeholder failure remains unverified. An authenticated Cursor environment is needed to continue; Windows desktop was not tested. No implementation changes made.

Runtime transcript