like this:
env GITHUB_PERSONAL_ACCESS_TOKEN=xxxxxxxxx npx -y @modelcontextprotocol/server-github
It happened to me but after closing and opening it worked, by the way do you have node installed so you can run npx, try the command in the console it should work
Once installed, entering and exiting the cursor should work
maybe a solution…
Yes I have the Github MCP working via smithery it solves the env issue.
The alternative (as per the cursor docs) is to create a bash script and set the env in that script and then use that script as the mcp target.
This Issue was annoying me so much that I created an NPM package that fixes it
you can use the terminal generator at mcprunner.com this will create a one line command that will work in cursor using that package ![]()
Really effective, great!
With the new remote mcp server config, is there a way to set env var?
For example, Github config requires a personal token:
{
"mcpServers": {
"github": {
"url": "https://api.githubcopilot.com/mcp/",
"headers": {
"Authorization": "Bearer YOUR_GITHUB_PAT"
}
}
}
}
did you find a solution?
Also using the Github MCP here. I could not get the remote server working with any kind of env interpolation.
As a workaround, I ended up using the Docker version instead, passing in an .env file containing GITHUB_PERSONAL_ACCESS_TOKEN like so:
{
"mcpServers": {
"github": {
"command": "docker",
"args": ["run", "-i", "--rm", "-e", "GITHUB_PERSONAL_ACCESS_TOKEN", "ghcr.io/github/github-mcp-server"],
"envFile": "${workspaceFolder}/.env"
}
}
}



