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 xemii43251-jpg-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 connects your AI tools to GitHub, enabling natural language interactions with GitHub data. With this remote server, AI agents can read repositories and code files, browse project structures, analyze commits, and query code across repositories you have access to. It also supports automation tasks like creating and updating issues and pull requests, triaging bugs, and managing project boards. Additionally, it can monitor and analyze GitHub Actions workflows, track build failures, and provide insights into your development pipeline. To use it, configure the server in your MCP host (for example via Docker as shown) and supply a GitHub Personal Access Token when prompted or via your host’s inputs. Tools exposed by the server include repository search and code analysis, issue/PR management, workflow monitoring, and security findings review, enabling agents to perform multi-step interactions with GitHub data in a natural, conversational manner.

How to install

Prerequisites:

  1. Docker installed and running on your machine.
  2. A GitHub Personal Access Token (PAT) with permissions suitable for your needs (repos, workflow, issues, etc.).

Step-by-step installation:

  1. Create a GitHub PAT at https://github.com/settings/personal-access-tokens/new and grant the required permissions.
  2. Run the MCP server in Docker using the token. Example (replace YOUR_TOKEN with your PAT):
docker run -i --rm \
  -e GITHUB_PERSONAL_ACCESS_TOKEN=YOUR_TOKEN \
  ghcr.io/github/github-mcp-server
  1. If you are integrating with an MCP host, configure the host to point to the remote server using the documented host configuration (as shown in the README example with http URL or the Docker-based setup above).
  2. In your MCP host, provide the GitHub token when prompted by the host or via the specified inputs (e.g., input name github_token).

Notes:

  • Ensure Docker is logged in if the image is under a private registry.
  • Rotate or revoke tokens as needed and update the server config accordingly.

Additional notes

Tips and considerations:

  • Use a GitHub PAT with only the permissions you need to minimize risk. Enable 2FA and rotate tokens periodically.
  • The server exposes read access to repositories you have access to; manage permissions accordingly in your AI workflows.
  • If you encounter docker pull errors due to authentication, run docker logout ghcr.io and re-authenticate.
  • In MCP host configurations, you can switch between local (Docker) and remote HTTP-based deployments depending on your environment.
  • For PAT security, consider using environment variable injections or host input prompts rather than hard-coding tokens.
  • Ensure the host environment provides the github_token input when launching the server to populate GITHUB_PERSONAL_ACCESS_TOKEN.
Sponsor this space

Reach thousands of developers