Get the FREE Ultimate OpenClaw Setup Guide →

github

GitHub's official MCP Server

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio amelianoir-github-mcp-server docker run -i --rm -e GITHUB_PERSONAL_ACCESS_TOKEN ghcr.io/github/github-mcp-server \
  --env GITHUB_PERSONAL_ACCESS_TOKEN="${input:github_token}"

How to use

The GitHub MCP Server exposes GitHub capabilities to your AI tools via a remote MCP host. It enables reading repositories and code files, browsing project structures, querying commits, managing issues and pull requests, analyzing CI/CD workflows, and performing code analysis and security checks — all through natural language prompts and multi-step agent workflows. To use it, configure your MCP host (e.g., VS Code UI or another remote host) to point at this server image and provide a GitHub Personal Access Token if required by your environment. Once running, select the github MCP server as your remote backend and leverage the toolset to perform tasks like repository browsing, issue/PR automation, workflow insights, and code analysis directly from your AI assistant.

Typical tool capabilities include:

  • Repository exploration: search files, read code, understand project structure.
  • Issue and PR automation: create, update, assign, label, and triage issues/PRs via natural language prompts.
  • CI/CD insight: monitor Actions workflows, analyze failures, and retrieve build status.
  • Code analysis: review security findings, Dependabot alerts, and code patterns across repositories.
  • Team collaboration: access discussions and automate routine collaboration tasks. Use the remote server in your MCP host configuration by selecting the github server and providing the required GitHub token when prompted.

How to install

Prerequisites:

  • Docker installed and running on your host. Ensure the Docker daemon is accessible to your user.
  • A GitHub Personal Access Token (PAT) with appropriate scopes for the tasks you intend to perform (e.g., repo, workflow, read:org).

Installation steps:

  1. Obtain a GitHub Personal Access Token (PAT) from GitHub with the necessary scopes for your use case.
  2. Run the GitHub MCP Server container with your PAT:
# Replace ${GITHUB_TOKEN} with your actual token or environment variable
docker run -i --rm \
  -e GITHUB_PERSONAL_ACCESS_TOKEN=${GITHUB_TOKEN} \
  ghcr.io/github/github-mcp-server
  1. Verify the server starts and is reachable by your MCP host. Consult your host's remote server documentation for exact integration steps.
  2. In your MCP host configuration, add a remote server named github pointing to the docker-based MCP image (as shown in the mcp_config section) and provide the GitHub PAT when prompted.

Optional: If you prefer to pass the token via an environment file or environment variable, adapt the docker run command accordingly and ensure the token is kept secret.

Additional notes

Tips and considerations:

  • The GITHUB_PERSONAL_ACCESS_TOKEN environment variable must be provided for the container to authenticate with GitHub. Ensure the token has necessary scopes for the actions you want to perform.
  • When running in environments with strict token handling, consider mounting a secure secret store or using a host-managed secret to inject the token at runtime.
  • The container image ghcr.io/github/github-mcp-server is public; if you encounter pull errors, verify your Docker login and token validity.
  • If your MCP host requires additional headers or authentication flows (OAuth, GitHub App), configure those in your host’s remote server settings per its documentation.
  • For large organizations or GitHub Enterprise setups, ensure the token has access to the targeted repositories and that any enterprise endpoints are reachable from the host.
  • Monitor Docker resource usage and set appropriate limits to avoid performance impacts on your host system.

Related MCP Servers

Sponsor this space

Reach thousands of developers