You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The @modelcontextprotocol/server-github package cannot access private GitHub repositories, consistently returning a "Not Found" error despite having a correctly authorized Personal Access Token (PAT). The same server successfully accesses public repositories with or without a token, indicating that the authentication mechanism is not being properly applied to API requests for private repositories.
Environment
OS: macOS 24.3.0
Node.js version: Latest stable
MCP server package: @modelcontextprotocol/server-github (latest)
Configuration: Using npx to run the server
Cursor v0.46.8
Reproduction Steps
Create a GitHub Personal Access Token (PAT) with the repo scope
Result: Successfully returns issues from the private repository.
Using a custom Node.js script:
// Custom script with same tokenconstfetch=require('node-fetch');asyncfunctiongetIssues(){constresponse=awaitfetch('https://api.github.com/repos/OWNER/PRIVATE_REPO/issues',{headers: {Authorization: `token ${process.env.GITHUB_TOKEN}`,'User-Agent': 'GitHub-API-Test'}});if(response.ok){constissues=awaitresponse.json();console.log(JSON.stringify(issues,null,2));}else{console.error('Error:',response.status,awaitresponse.text());}}getIssues();
Result: Successfully returns issues from the private repository.
Additional Information
Various environment variable names were tried (GITHUB_TOKEN, GH_TOKEN) with no difference in results
The token permissions were thoroughly verified and confirmed to have the necessary repo scope
The error only occurs when trying to access private repositories through the MCP GitHub server
The MCP server appears to be ignoring the authentication token when making API requests to GitHub for private repositories, as the behavior is identical with or without a token
The text was updated successfully, but these errors were encountered:
attilapolgar
changed the title
MCP GitHub Server Cannot Access Private Repositories
MCP GitHub Server Cannot Access Private Repositories (Cursor)
Mar 3, 2025
Confirming same for me, I think its because the builds are failing which means the latest changes aren't being released to NPM.
I added a PR yesterday that should fix the typescript/NPM build – #722.
Description
The
@modelcontextprotocol/server-github
package cannot access private GitHub repositories, consistently returning a "Not Found" error despite having a correctly authorized Personal Access Token (PAT). The same server successfully accesses public repositories with or without a token, indicating that the authentication mechanism is not being properly applied to API requests for private repositories.Environment
@modelcontextprotocol/server-github
(latest)Reproduction Steps
repo
scopeActual Result
Expected Result
The MCP server should successfully list issues from the private repository, similar to how it works with public repositories.
Verification Steps
Token authentication works correctly with public repositories:
Result: Successfully returns issues from the microsoft/vscode repository.
Direct API calls to the private repository using the same token work properly:
Using curl:
Result: Successfully returns issues from the private repository.
Using a custom Node.js script:
Result: Successfully returns issues from the private repository.
Additional Information
repo
scopeThe text was updated successfully, but these errors were encountered: