Set up the GitHub MCP server in Cursor
GitHub runs an official remote MCP server. You add one URL, sign in, and your agent can read repos and work with issues and pull requests.
Updated Oct 15, 2026 · 4 sources
§11. Add the server
Open (or create) ~/.cursor/mcp.json for all projects, or .cursor/mcp.json for one project, and add GitHub's remote endpoint:
{
"mcpServers": {
"github": {
"url": "https://api.githubcopilot.com/mcp/"
}
}
}§22. Authenticate
GitHub documents two methods: OAuth on the remote server, or a Personal Access Token. With a PAT, send it as a header; Cursor supports ${env:NAME} interpolation so the token stays out of the file:
{
"mcpServers": {
"github": {
"url": "https://api.githubcopilot.com/mcp/",
"headers": { "Authorization": "Bearer ${env:GITHUB_PAT}" }
}
}
}Anthropic's Claude Code docs recommend a fine-grained token limited to the repositories you want the agent to work with. GitHub's README does not list required scopes, so grant the least you need and widen only when a tool fails.
§33. Test it
- Open Cursor's MCP settings and check the server shows as connected.
- If it fails, open the Output panel (Cmd+Shift+U) and pick "MCP Logs".
- Ask: "Summarize the open pull requests in my repo that are waiting on review."
§4Same server in other clients
{
"servers": {
"github": { "type": "http", "url": "https://api.githubcopilot.com/mcp/" }
}
}claude mcp add --transport http github https://api.githubcopilot.com/mcp/ \
--header "Authorization: Bearer YOUR_GITHUB_PAT"claude mcp add github -e GITHUB_PERSONAL_ACCESS_TOKEN=$GITHUB_PAT -- docker run -i --rm -e GITHUB_PERSONAL_ACCESS_TOKEN ghcr.io/github/github-mcp-serverGitHub's official MCP server: work with repos, issues, pull requests, Actions and code security from your agent.
§5FAQ
- What is the GitHub MCP server URL?
- https://api.githubcopilot.com/mcp/ — GitHub's hosted remote server.
- Do I need a personal access token?
- No. The remote server supports OAuth or a Personal Access Token. A PAT is useful where OAuth is not available, such as with a static header.
- Can I run the GitHub MCP server locally?
- Yes, GitHub publishes a Docker image (ghcr.io/github/github-mcp-server) that takes GITHUB_PERSONAL_ACCESS_TOKEN.
§6Sources
- Cursor docs — Model Context Protocol ↗
- VS Code docs — Add and manage MCP servers ↗
- Claude Code docs — Connect Claude Code to tools via MCP ↗
- github/github-mcp-server README ↗
Sources checked Oct 15, 2026. Spot something out of date? Tell us.