GitHub MCP Server – Repositories and Pull Requests
GitHub's official MCP server gives AI agents controlled access to live GitHub repositories, code, issues, pull requests, Actions workflows, notifications, releases, organizations, users, and supported security data. Use it for codebase analysis, repository maintenance, development workflow automation, and collaborative software engineering tasks.
Overview
The official GitHub MCP server connects an MCP-compatible AI agent to live
GitHub data and actions. Instead of working only from code or issue text pasted
into a conversation, the agent can use structured tools to inspect repositories,
retrieve files, review issues and pull requests, check workflow activity, and
interact with other GitHub resources permitted by the authenticated account.
What the MCP server enables
GitHub organizes its MCP capabilities into toolsets for areas such as
repositories, issues, pull requests, Actions, releases, organizations, users,
notifications, discussions, projects, labels, and code security. Depending on
the enabled tools and token permissions, an AI agent can:
- Search repositories, code, issues, pull requests, users, and organizations.
- Read files, branches, commits, releases, tags, and repository metadata.
- Create or update issues, comments, pull requests, branches, and files.
- Inspect workflow runs, jobs, logs, and supported security findings.
- Assist with triage, code review, release preparation, and repository upkeep.
When to use it
Use the GitHub MCP server when an AI workflow needs current repository context
or must perform authenticated GitHub operations. Typical uses include analyzing
an unfamiliar codebase, summarizing open issues, preparing pull-request reviews,
investigating failed Actions runs, maintaining labels, creating branches or
files, and coordinating work across repositories.
Connection and authentication
GitHub provides a hosted Streamable HTTP server at
https://api.githubcopilot.com/mcp/. Compatible clients can authenticate using
GitHub OAuth. Clients without the required OAuth flow can use a GitHub personal
access token in the Authorization header.
GitHub also provides an official local server through the
ghcr.io/github/github-mcp-server Docker image. The local stdio configuration
receives a token through GITHUB_PERSONAL_ACCESS_TOKEN.
Key considerations
Tool availability and write access depend on the enabled toolsets and the
permissions granted to the authenticated account or token. Use the least
privileges necessary, prefer fine-grained personal access tokens where
appropriate, and require human confirmation before destructive or
security-sensitive changes. GitHub's older npm package
@modelcontextprotocol/server-github is no longer supported; use the official
remote server or Docker image instead.
Supported Transports
streamable_http
URL: https://api.githubcopilot.com/mcp/
stdio
Command: docker
Args:
run-i--rm-eGITHUB_PERSONAL_ACCESS_TOKENghcr.io/github/github-mcp-server
Frequently Asked Questions
- When should an AI agent use the GitHub MCP server?
- Use it when a task requires current GitHub repository context or authenticated GitHub operations, such as codebase analysis, issue triage, pull-request review, workflow investigation, release preparation, or repository maintenance.
- What does the GitHub MCP server add to an AI agent's capabilities?
- It gives the agent structured access to live GitHub data and tools, allowing it to retrieve repository content, inspect collaboration activity, and perform permitted actions instead of relying only on static model knowledge or manually pasted context.
- What can an AI agent access or manage through the GitHub MCP server?
- Depending on enabled toolsets and permissions, the agent can work with repositories, files, branches, commits, issues, pull requests, Actions, releases, notifications, projects, organizations, users, and supported code-security information.
- How is authentication configured for the GitHub MCP server?
- The hosted server supports GitHub OAuth in compatible MCP clients. A client may alternatively send a narrowly scoped personal access token as a Bearer token. The local Docker server reads the token from the GITHUB_PERSONAL_ACCESS_TOKEN environment variable.
- Which transport should be used for the GitHub MCP server?
- Use Streamable HTTP for GitHub's managed remote server when the client supports remote MCP and the required authentication flow. Use stdio with the official Docker image when a local process is preferred or the client cannot connect to the hosted server.