Get the FREE Ultimate OpenClaw Setup Guide →

github

MCP server from infracloudio/github-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 infracloudio-github-mcp-server docker run -i infracloud/github-mcp-server \
  --env GITHUB_TOKEN="your_github_token"

How to use

The GitHub MCP Server provides a collection of secure, stateless tools for interacting with GitHub data. It exposes facilities to list pull requests and issues, search issues by keyword, retrieve pending PR reviews, create new issues, and analyze issue priority. These tools are designed to be integrated with LLM agents and automation workflows, enabling you to automate repository maintenance, triage, and collaboration tasks with consistent, permission-checked access to your GitHub data. To start using the server, ensure you have a valid GitHub token and run the server in your preferred environment (e.g., via Docker).

Once running, you can invoke the available tools by referencing their names (list_prs, list_issues, search_issues, get_pending_reviews, create_issue, analyze_issue_priority) in your MCP client or agent. Each tool requires authentication and enforces permission checks to protect your repository data. The server is designed to be easily integrated into automation pipelines, chat-based assistants, or agent-based workflows that need structured access to GitHub information and actions.

How to install

Prerequisites:

  • Docker installed and running (or adapt to your deployment method)
  • A valid GitHub token with the necessary scopes (stored securely as GITHUB_TOKEN)
  • Optional: Docker image infracloud/github-mcp-server if using the provided container

Option A: Run with Docker (recommended)

  1. Pull and run the server image, providing your GitHub token: docker run -i -e GITHUB_TOKEN=your_github_token infracloud/github-mcp-server

  2. Verify the server is responding (the MCP protocol handshake should succeed as part of your client integration).

Option B: Build and run from source (Go)

  1. Install Go 1.20+ and ensure your environment is configured.
  2. Clone the repository: git clone https://github.com/himanshusharma89/github-mcp-server.git
  3. Build the binary: cd github-mcp-server go build -o bin/github-mcp-server main.go
  4. Run the server with the required environment variable: export GITHUB_TOKEN=your_github_token ./bin/github-mcp-server

Note: If you choose to run via Docker, replace the image name with the appropriate image tag if needed and ensure GITHUB_TOKEN is supplied to the container.

Additional notes

Environment variable suggestions:

  • GITHUB_TOKEN: Personal access token for authenticating to GitHub.
  • Optional: GITHUB_TOKEN_EXPIRY or token scopes customization depending on your security requirements.

Common issues:

  • Invalid or missing GITHUB_TOKEN leading to authentication failures.
  • Insufficient GitHub token scopes for certain operations (e.g., repo scope for managing issues/PRs).
  • Network/firewall restrictions preventing Docker from pulling images or contacting GitHub.

Security tips:

  • Do not hard-code tokens in code or configuration files; use environment variables or secret management.
  • Rotate tokens regularly and revoke unused tokens.
  • Ensure MCP server instances run with least privilege necessary for their tasks.

Related MCP Servers

Sponsor this space

Reach thousands of developers