Where does the bug appear (feature/product)?
Cursor IDE
Describe the Bug
Per Cursor’s MCP documentation, config interpolation with ${env:NAME} syntax should work in the headers field. However, for remote HTTP/SSE MCP servers, the variable is not resolved - the literal string ${env:VAR_NAME} is sent instead of the environment variable value.
(Note: Config interpolation does work with local / STDIO servers).
Steps to Reproduce
- Set environment variable:
export MY_API_KEY="actual_secret_key"
- Configure remote MCP server in mcp.json:
{
"mcpServers": {
"my-server": {
"url": "https://example.com/mcp/",
"headers": {
"Authorization": "Bearer ${env:MY_API_KEY}"
}
}
}
}
- Restart Cursor and connect to the MCP server
Expected Behavior
Server receives Authorization: Bearer actual_secret_key
Actual behavior:
Server receives Authorization: Bearer ${env:MY_API_KEY} (literal string)
Operating System
Linux
Version Information
Version: 2.6.21
VSCode Version: 1.105.1
Commit: fea2f546c979a0a4ad1deab23552a43568807590
Date: 2026-03-21T22:09:10.098Z
Build Type: Stable
Release Track: Default
Electron: 39.8.1
Chromium: 142.0.7444.265
Node.js: 22.22.1
V8: 14.2.231.22-electron.0
OS: Linux x64 6.8.0-106-generic
For AI issues: which model did you use?
N/A
For AI issues: add Request ID with privacy disabled
N/A
Additional Information
Workaround: Use hardcoded API key directly in config (not ideal for security)
Documentation Reference: MCP integrations | Cursor Docs - “Config interpolation” section states ${env:NAME} is supported for headers field.
Does this stop you from using Cursor
No - Cursor works, but with this issue