home / mcp / github mcp server
Connects AI tools to GitHub context to read repos, manage issues/PRs, analyze code, and automate workflows via natural language prompts.
Configuration
View docs{
"mcpServers": {
"github-github-mcp-server": {
"url": "https://api.githubcopilot.com/mcp/",
"headers": {
"GITHUB_PERSONAL_ACCESS_TOKEN": "YOUR_TOKEN"
}
}
}
}You connect AI tools directly to GitHub to read repositories, manage issues and PRs, analyze code, and automate workflows through natural language interactions. This MCP server enables you to access GitHub context from your AI tools, empowering you to perform code searches, issue triage, workflow analysis, and repository operations with simple prompts.
You will run this MCP server as either a remote HTTP service or a local, containerized process. Your MCP client (such as an IDE integration or agent) talks to the server to perform GitHub actions in natural language. Start with a remote server for quick setup, or run a local server if you prefer hosting everything on your machine.
Once connected, you can ask your AI agent to list issues, read repository trees, inspect pull requests, search code, or monitor actions and security alerts. You can also enable or disable groups of capabilities (toolsets) to tailor the available actions to your needs. If you enable read-only mode, only non-destructive operations will be exposed.
Choose a method that matches your environment. You can connect via a remote MCP server or run a local MCP server on your host. Below are concrete steps for both approaches. Follow the exact commands and example configurations to ensure proper operation.
Two primary connection methods are supported: HTTP (remote) and STDIO (local). Use the following configuration blocks as exact templates in your MCP host or IDE integration. The HTTP method points to the remote GitHub MCP server; the STDIO method runs the server locally via Docker.
Handle GitHub Personal Access Tokens (PATs) securely. Store tokens in environment variables when possible, avoid committing tokens, and scope tokens to the minimum permissions needed. Rotate tokens regularly and keep them out of version control. If you are using an IDE or host that supports it, prefer token references via environment variables rather than embedding tokens directly in configuration files.
If you encounter startup errors, verify that the MCP server command or URL is correct and that tokens or headers are configured as shown in examples. Ensure your MCP host supports the chosen connection type and that network access to the remote server is permitted. If you are using Docker, confirm the container image ghcr.io/github/github-mcp-server is accessible and that your token is valid.
Get details of GitHub Actions resources such as workflows, workflow runs, jobs, and artifacts. Requires repo scope.
List GitHub Actions workflows in a repository. Supports pagination and filtering by workflow or run IDs.
Trigger a GitHub Actions workflow with inputs. Requires repo scope.
Fetch logs for a GitHub Actions workflow job. Can return actual content or URLs and supports filtering by run and job.
Retrieve a specific code scanning alert by number. Requires security_events scope.
List code scanning alerts with optional filters like severity and state.
Get details about your own GitHub user profile.
Fetch the file tree for a repository, with optional recursive traversal.
Read contents of a file or directory in a repository with optional ref or sha.
List branches for a repository with pagination support.
List issues in a repository with filters for state, labels, and date ranges.
Read issue details, comments, or labels with multiple operation modes.
Create or update an issue, including assignees, labels, and milestones.
Search code across repositories using GitHub code search syntax.
Search repositories with options for minimal output, sort, and pagination.
List pull requests with filters for base, head, state, and pagination.
Get details about a pull request, including files, reviews, and comments.
Open a new pull request with base, head, title, and optional body.
Edit pull request properties such as title, body, state, and reviewers.
Fetch the latest release for a repository.
Retrieve details for a specific tag in a repository.
List releases for a repository with pagination.
List all tags for a repository with pagination.
Push files to a repository by creating or updating files with a commit message.