Home / MCP / GitHub MCP Server
Connect AI tools to GitHub data and actions for code reading, issue/PR automation, and workflow insights.
Configuration
View docs{
"mcpServers": {
"github_mcp_http": {
"url": "https://api.githubcopilot.com/mcp/"
}
}
}You can connect your AI tools directly to GitHub to read repositories, analyze code, manage issues and pull requests, and automate workflows. This MCP server lets you interact with GitHub data and actions through simple natural language prompts and agent workflows, making it faster to perform code review, project management, and CI/CD insights.
You use an MCP client to talk to the GitHub MCP Server. Start the remote server to access GitHub data via HTTP, or run a local MCP server instance to host it on your machine. With the MCP server running, you can ask your AI tools to browse repositories, inspect files, create or comment on issues and pull requests, and monitor workflows and security alerts. The server exposes a wide set of tools that map to GitHub capabilities, so you can perform complex, multi-step tasks through natural language.
Prerequisites: you need Docker installed and running on your machine. You also need a GitHub Personal Access Token with appropriate scopes for the actions you want to allow your AI tools to perform.
{
"mcp": {
"servers": {
"github_http": {
"type": "http",
"url": "https://api.githubcopilot.com/mcp/",
"args": []
},
"github_local": {
"type": "stdio",
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"-e",
"GITHUB_PERSONAL_ACCESS_TOKEN",
"ghcr.io/github/github-mcp-server"
],
"env": {
"GITHUB_PERSONAL_ACCESS_TOKEN": "${input:github_token}"
}
}
}
}
}HTTP remote server is hosted by the GitHub MCP provider and can be used if your MCP host supports remote systems. Local hosting via Docker lets you run the server on your own machine using your GitHub Personal Access Token. Each host configuration may require a GitHub App or OAuth App to enable remote access.
Treat your GitHub Personal Access Token as a sensitive secret. Use the minimum scopes you need, rotate tokens regularly, and avoid embedding tokens directly in files that can be committed. Prefer environment variables or secret managers to supply tokens to the MCP server configuration.
1. Install Docker and start the Docker daemon on your machine.
2. Create a GitHub Personal Access Token with the required permissions for your use case.
3. Create a configuration that includes both the HTTP remote server URL and a local Docker-based MCP server definition. Ensure your environment references the PAT securely.
4. Start your MCP client and point it to one of the configured MCP servers. Begin by asking your agent to query repositories, inspect code, or manage issues.
You can use one-click install flows or manually configure MCP hosts in IDEs that support MCP. If you configure manually, use the JSON blocks shown above to declare the servers and environment variables.
Get repository tree for a given owner/repo, path, and tree SHA to inspect file structures.
Fetch file or directory contents from a repository, with optional ref and sha to specify the exact version.
List issues with filters for labels, state, and date range, and support pagination.
Open a new pull request with specified base, head, title, and optional body/draft state.
List pull requests with filtering by base/head, state, and pagination.
Retrieve details about a specific GitHub Actions workflow run.
List workflows in a repository with pagination.
Get a specific label from a repository by name.
Create, update, or delete a label on a repository with color and description options.
Get the authenticated user profile.
Search issues across repositories using GitHub's search syntax.
List gists for a user and support creation/updating of gists.
Download artifacts produced by a workflow run.