Home / MCP / GitHub MCP Server
Connect AI tooling to GitHub data and actions via an HTTP MCP server or a local stdio server.
Configuration
View docs{
"mcpServers": {
"github_http_mcp": {
"url": "https://api.githubcopilot.com/mcp/"
}
}
}You connect your AI tools to GitHub using an MCP Server, enabling natural language interactions to read repositories, analyze code, manage issues and PRs, and automate workflows directly within GitHub. It powers agents and assistants to operate with GitHub context, reducing manual steps and speeding up development workflows.
Set up a remote MCP connection to GitHub to enable your AI tools to access repositories, issues, PRs, and workflow data. Use the remote HTTP server when you want a centralized GitHub MCP URL, or run a local MCP server in your environment for full control.
Once configured in your MCP client, you can ask your AI agent to browse code, search files, review pull requests, triage issues, monitor Actions workflows, and fetch security findings. You can also enable or disable tool groups to tailor what capabilities your AI assistant can invoke.
Practical usage patterns include: querying repository structure and contents, creating or updating issues and PRs, triggering CI/CD insights, analyzing security alerts, and coordinating team discussions. Tools are organized into toolsets to help the model pick the right actions for a given task.
Prerequisites exist for running the MCP Server locally or connecting to a remote host. You need a GitHub Personal Access Token (PAT) with appropriate permissions and a runtime environment for your chosen MCP host.
Option A — Remote HTTP server (preferred for quick start) on your MCP host: you will point to the remote GitHub MCP URL.
Option B — Local MCP Server (docker-based) to run on your machine or in your CI: use the Docker image ghcr.io/github/github-mcp-server and pass your PAT as an environment variable.
{
"servers": {
"github": {
"type": "http",
"url": "https://api.githubcopilot.com/mcp/"
}
}
}{
"servers": {
"github": {
"type": "http",
"url": "https://api.githubcopilot.com/mcp/",
"headers": {
"Authorization": "Bearer ${input:github_mcp_pat}"
}
}
},
"inputs": [
{
"type": "promptString",
"id": "github_mcp_pat",
"description": "GitHub Personal Access Token",
"password": true
}
]
}{
"mcp": {
"servers": {
"github": {
"command": "/path/to/github-mcp-server",
"args": ["stdio"],
"env": {
"GITHUB_PERSONAL_ACCESS_TOKEN": "<YOUR_TOKEN>"
}
}
}
}
}The GitHub MCP Server supports enabling or disabling specific tool groups via a toolsets flag. This helps control which GitHub API capabilities are available and can optimize context usage for the AI agent.
When using a remote HTTP server, ensure your host is configured with the correct MCP URL and any necessary authentication headers. When running locally, keep your GitHub PAT secure and avoid committing tokens into version control.
If you need to run in read-only mode, you can enable a read-only configuration that only exposes non-destructive operations to the AI agent.
If you choose to build the MCP server from source, ensure you have Go tooling installed and compile the binary for your platform. The final start command should be the stdio execution path with the required environment variables set.
Get the repository tree; requires repo scope and owner/repo parameters to specify the target repository.
Get contents of a file or directory in a repository; supports path and optional ref.
Open a new pull request with specified base, head, and title.
List pull requests for a repository with optional filtering by base, head, state, and other fields.
Get the authenticated user's GitHub profile.
Retrieve the latest release information for a repository.