This is still broken as of 2026.01.02-80e4d9b. Means I am having to wrap all my MCP server commands I put in mcp.json with wrappers which source environment variables another way. Currently I am running the agent headless in a container, passing in my MCP authentication tokens via environment variables at container execution time. The CURSOR_API_KEY is interpolated up by the agent but not for defined MCP servers.
replacing <GITLAB_MCP_TOKEN> with the raw token works, but with ${env.GITLAB_MCP_TOKEN} , while GITLAB_MCP_TOKEN is exported in my ~/.zshrc file fails (I get 401 (unauthorized) status from the server).
I just tried this for our SmartSheet MCP server as I was having the same issue. I think the key is you had env. instead of env:
Using”Bearer ${env:SS_API_KEY}” I finally got this to work.
Thanks @Ryan_Sturm ; unfortunately, that didn’t help - running the agent CLI with “${TOKEN}” works, while “${env:TOKEN}" doesn’t.
for those of you who want a quick check, you can use this command (this is how I checked it everytime):
❯ cat ~/.cursor/commands/check-mcp.md
# Check MCP connections
Check connection to the following MCP servers - <relevant MCP servers>
For each server, perform an arbitrary opreration that requires a valid authentiation token.
Do not modify any files in the filesystem.
when done, print to the screen a brief summary.
EDIT:
I think I found an interesting phenomenon - looks like the IDE and the CLI interpret things differently:
IDE - ${env:VAR} works, while ${VAR} doesn’t
CLI - ${VAR} works, while ${env:VAR} doesn’t
(assumption - both tools use ~/.cursor/mcp.json)
if someone from Cursor’s team can check this, that’d be great