Skip to content

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

Open

Description

@JeremyMoeglich

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:

import { createInterface } from "node:readline";

for await (const line of createInterface({ input: process.stdin })) {
  const { id, method } = JSON.parse(line);
  if (id === undefined) continue;

  const result = method === "initialize"
    ? {
        protocolVersion: "2024-11-05",
        capabilities: { tools: {} },
        serverInfo: { name: "repro", version: "1.0.0" }
      }
    : method === "tools/list" ? { tools: [] } : {};

  console.log(JSON.stringify({ jsonrpc: "2.0", id, result }));
}

Add .cursor/mcp.json:

{
  "mcpServers": {
    "repro": {
      "command": "node",
      "args": ["${workspaceFolder}/server.mjs"]
    }
  }
}
  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

Error: Cannot find module '<working-directory>\${workspaceFolder}\server.mjs'
code: 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.

Activity

  1. added
    bugSomething is broken or behaving incorrectly.
    needs-triageIssue needs maintainer review and initial categorization.
    on Oct 20, 2026
  2. juliusmarminge commented on Oct 22, 2026

    @juliusmarminge
    Member

    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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething is broken or behaving incorrectly.needs-triageIssue needs maintainer review and initial categorization.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions