- Symptom
- An MCP server configured with ${API_KEY} in env or headers rejects its credentialsA config copied from Claude Code or another client works there but not in CursorenvFile is ignored for a remote HTTP or SSE server
- Cause
- Cursor resolves ${env:NAME}, ${userHome}, ${workspaceFolder}, ${workspaceFolderBasename}, and ${pathSeparator} in command, args, env, url, and headers; a bare ${NAME} is not one of its forms. envFile works only for stdio servers.
- Fix
- Use ${env:NAME} for environment variables, export them where Cursor can read them, and pass remote server secrets through headers with interpolation instead of envFile.
- Apply
"env": { "API_KEY": "${env:API_KEY}" }, "headers": { "Authorization": "Bearer ${env:MY_SERVICE_TOKEN}" }- Affected
- Cursor .cursor/mcp.json and ~/.cursor/mcp.json, as of 2026-10
- Sources
Last verified 2026-10-15 · Confirmed by 0 builders