Where does the bug appear (feature/product)?
Cursor CLI
Describe the Bug
It seems that not all MCP tools are available to Cursor CLI. I am specifically having trouble with Github MCP.
I am using the Github MCP here: GitHub - github/github-mcp-server: GitHub's official MCP Server
I have used the “1 click” button option in the Cursor instructions.
Here is my mcp.json:
Using Docker:
"GitHub": {
"command": "zsh",
"args": [
"-lc",
"GITHUB_PERSONAL_ACCESS_TOKEN=\"$CURSOR_GITHUB_TOKEN\" GITHUB_HOST=\"https://github.<ENTERPRISE-NAME>.com\" docker run -i --rm -e GITHUB_PERSONAL_ACCESS_TOKEN -e GITHUB_HOST ghcr.io/github/github-mcp-server stdio"
],
"env": {
"CURSOR_GITHUB_TOKEN": "${env:CURSOR_GITHUB_TOKEN}"
}
},
Config to point to MCP built from source:
"github3": {
"command": "/Users/<USERNAME>/Documents/github-mcp-server/github-mcp-server",
"args": ["stdio", "--gh-host", "https://github.<ENTERPRISE-NAME>.com"],
"env": {
"GITHUB_PERSONAL_ACCESS_TOKEN": "${env:CURSOR_GITHUB_TOKEN}",
"GITHUB_TOOLSETS": "pull_requests,repos,context"
}
},
Here is my command:
cursor-agent -p --model auto --force --approve-mcps "Use github MCP to get PR 3551 from <ORG>/<REPO>. If you encounter an error explain what happened in detail. Tell me if you are able to use the Github mcp or not and why. If there is an authentication issue, tell me what token for github you see. Literally print out the name of the ENV var you are trying to read from. Tell me what tool you attempted to use and all arguments you gave it."
Here is what the Agent is responding with:
**Can I use the GitHub MCP?**
**No, I cannot successfully use the GitHub MCP tools.**
**What happened in detail:**
1. **Tool attempted**: `pull_request_read`
2. **Arguments provided**:
- `method`: "get"
- `owner`: "<ORG>"
- `repo`: "<REPO>"
- `pullNumber`: 3551
3. **Error received**: `401 Bad credentials` when trying to access `https://github.<ENTERPRISE-NAME>.com/api/v3/repos/<ORG>/<REPO>/pulls/3551`
**Authentication details:**
- **Environment variable name**: `CURSOR_GITHUB_TOKEN`
- **Environment variable value**: `<CORRECT-TOKEN>`
- **GitHub host**: `https://github.<ENTERPRISE-NAME>.com` (internal GitHub Enterprise instance)
**Why the MCP failed but direct API works:**
The GitHub token is valid and has proper access to the repository (as proven by the successful direct curl command), but the GitHub MCP server (`github`) is not properly passing or using the authentication token. This suggests there's a configuration issue with the MCP server itself, not with the authentication credentials.
Note that
- Other MCP tools for Atlassian and Sonarqube work fine
- I have no issues using the Github MCP tools in Cusor IDE, it works there no problem
- I am trying to make a call to enterprise Github
- I made sure cursor-agent is up-to-date
Other things I have tried:
- Use a local
.cursor/mcp.jsonfile with the same config in case Cursor CLI was not seeing the full contents of the global file - Built the MCP from source and updated my
mcp.jsonto point to it
Steps to Reproduce
- Install Cursor CLI
- Setup the Github MCP: GitHub - github/github-mcp-server: GitHub's official MCP Server
- Run this in your terminal:
cursor-agent -p --model auto --force --approve-mcps "Use github MCP to get PR 3551 from <ORG>/<REPO>. If you encounter an error explain what happened in detail. Tell me if you are able to use the Github mcp or not and why. If there is an authentication issue, tell me what token for github you see. Literally print out the name of the ENV var you are trying to read from. Tell me what tool you attempted to use and all arguments you gave it."
Expected Behavior
A successful Github MPC call ![]()
Operating System
MacOS
Current Cursor Version (Menu → About Cursor → Copy)
Version: 1.7.54 (Universal)
VSCode Version: 1.99.3
Commit: 5c17eb2968a37f66bc6662f48d6356a100b67be0
Date: 2025-10-21T19:07:38.476Z
Electron: 34.5.8
Chromium: 132.0.6834.210
Node.js: 20.19.1
V8: 13.2.152.41-electron.0
OS: Darwin arm64 23.6.0
For AI issues: which model did you use?
auto
But have also tried with sonnet-4
Does this stop you from using Cursor
No - Cursor works, but with this issue