GitHub MCP Server — Official GitHub AI Integration
GitHub's official MCP server that lets AI assistants manage repos, issues, PRs, Actions, and code search through the Model Context Protocol.
What it is
GitHub MCP Server is the official Model Context Protocol server built by GitHub that connects AI coding assistants to the GitHub platform. It translates natural language requests into GitHub API calls, enabling AI tools to manage repositories, issues, pull requests, code reviews, Actions workflows, and security alerts.
The server targets developers using AI coding assistants like Claude Code who want their agent to interact with GitHub directly -- creating issues, reviewing PRs, searching code, and monitoring CI/CD pipelines without switching to the browser.
How it saves time or tokens
Without the MCP server, interacting with GitHub from an AI assistant requires manual copy-paste of URLs, issue descriptions, and PR diffs. The MCP server provides structured access to all GitHub data, so the assistant can read, search, and write to GitHub in a single conversation. This eliminates context switching between the AI tool and the GitHub web interface.
The token estimate is approximately 636 tokens for the server configuration itself. Actual token usage depends on the scope of GitHub operations performed.
How to use
- Add the MCP server to your AI assistant configuration:
{
"mcpServers": {
"github": {
"command": "docker",
"args": [
"run", "-i", "--rm",
"-e", "GITHUB_PERSONAL_ACCESS_TOKEN",
"ghcr.io/github/github-mcp-server"
],
"env": {
"GITHUB_PERSONAL_ACCESS_TOKEN": "<your-token>"
}
}
}
}
- Generate a GitHub Personal Access Token with the scopes your workflow needs (repo, issues, pull requests).
- Start your AI assistant. The MCP server connects automatically and exposes GitHub tools.
Example
Once configured, your AI assistant can perform GitHub operations directly:
# Example interactions through the MCP server:
# 'Search for open issues labeled bug in my-org/my-repo'
# 'Create a PR from feature-branch to main with this description'
# 'Show me the failing CI checks on PR #42'
# 'List recent commits on the main branch'
The server exposes tools for:
- Repository: search, browse files, list branches, read commits
- Issues: create, update, comment, label, close
- Pull Requests: create, review, merge, request changes
- Actions: list workflows, view run logs, re-run jobs
- Code Search: search across public and private repos
- Security: code scanning alerts, Dependabot, secret scanning
Related on TokRepo
- GitHub MCP Integration -- Detailed GitHub MCP setup and configuration
- AI Tools for Coding -- Developer productivity tools and integrations
Common pitfalls
- The Personal Access Token scope determines what the MCP server can access. A token with only public_repo scope cannot interact with private repositories. Create a fine-grained token with exactly the permissions you need.
- The Docker-based setup requires Docker running locally. For environments without Docker, the server can also run as a standalone Go binary.
- Rate limiting applies to all GitHub API calls made through the MCP server. Heavy usage (bulk issue creation, large code searches) can exhaust your hourly API quota.
Frequently Asked Questions
The token needs scopes matching your use case. For basic repo and issue operations, the repo scope is sufficient. For Actions, add the workflow scope. For security alerts, add the security_events scope. Fine-grained tokens let you limit access to specific repositories.
Yes, if the Personal Access Token has the repo scope. The MCP server accesses GitHub through the authenticated API, so it can see everything the token owner can see.
Yes. Add the MCP server configuration to your Claude Code MCP settings. Claude Code will discover the GitHub tools automatically and can use them during conversations.
Yes. The GitHub MCP server is MIT licensed and the source code is available on GitHub. It is built in Go and can be compiled from source or run as a Docker container.
The MCP server can be configured to point at GitHub Enterprise Server instances by setting the appropriate base URL environment variable. Check the repository README for Enterprise-specific configuration.
Citations (3)
- GitHub MCP Server Repository— GitHub MCP Server is the official MCP server built by GitHub
- MCP Specification— Model Context Protocol specification for AI tool integration
- GitHub Docs— GitHub REST API documentation for repository and issue management
Related on TokRepo
Source & Thanks
- GitHub: github/github-mcp-server
- License: MIT
- Stars: 28,000+
- Maintainer: GitHub, Inc.
Thanks to the GitHub team for building the official integration that sets the standard for MCP server quality and security.