Cursor 1.0 broke ENV forwarding from Cursor -> MCP server

Describe the Bug

Before Cursor 1.0 we relied on using the direnv VS Code plugin to load a .env file (among other things) that contained per-user secrets for the MCP servers we had configured on the project level. This allowed us to centrally configure, whilst personally authenticating to both the official Github MCP server as well as some custom ones.
Since the update to the MCP server management in 1.0, it seems that Cursor’s ENV is no longer forwarded to the context of the MCP servers, thus breaking this integration.

Steps to Reproduce

  1. Configure direnv VS Code Plugin
  2. Add an .envrc file in the root of your project with the line dotenv
  3. Add a .cursor/mcp.json file with contents:
{
  "mcpServers": {
    "github": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "-e",
        "GITHUB_PERSONAL_ACCESS_TOKEN",
        "ghcr.io/github/github-mcp-server"
        ]
    }
  }
}
  1. Add a .env file to the root of the repository with GITHUB_PERSONAL_ACCESS_TOKEN specified
  2. Try on version 1.0 of Cursor

Expected Behavior

The MCP server starts and uses the GITHUB_PERSONAL_ACCESS_TOKEN for authorization towards Github

Operating System

Linux

Current Cursor Version (Menu → About Cursor → Copy)

Version: 1.0.0
VSCode Version: 1.96.2
Commit: 53b99ce608cba35127ae3a050c1738a959750860
Date: 2025-06-04T19:25:40.367Z (2 days ago)
Electron: 34.5.1
Chromium: 132.0.6834.210
Node.js: 20.19.0
V8: 13.2.152.41-electron.0
OS: Linux x64 6.12.27-amd64

Additional Information

I have downgraded to 0.51.2 again.

Does this stop you from using Cursor

Yes - Cursor is unusable

I should make a reservation to this bug report in that it may be the entire direnv plugin is broken in Cursor 1.0 and not just the MCP integration. We also have noticed that the $PATH (which we also modify using the direnv VS Code plugin) in the VS Code shell doesn’t work anymore either.

1 Like

For security purposes we no longer pass through arbitrary env vars, you’ll need to write a wrapper script that loads the .env and then calls the docker command

Sorry for the hassle on this, i wish security wasn’t an issue

1 Like

I’m sorry to complain here, but this is becoming a decision point for me to consider go back to use VScode. Many hours spent trying to fix an issue just to find out this was a problem with the tool I was using. The terminal does NOT work as expected. I simply can’t trust it is running with the right .env. I lost data and had to recover things from backup after it reused the previous .env file. I understand that the team have priorities, but this is happening for 8 MONTHS already. It is a serious problem and nothing was done about. Can some attention be given to this, please?

There is a similar problem: if you remove a value from the .env, it will still exist unless you restart the terminal.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.