Get the FREE Ultimate OpenClaw Setup Guide →

github

A Model Context Protocol (MCP) server built in TypeScript that integrates with GitHub's API, enabling AI assistants to manage repositories, issues, pull requests, and code while providing a structured interface for LLM agents to perform GitHub operations.

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio cyanheads-github-mcp-server node build/index.js \
  --env LOG_LEVEL="Logging level (e.g., debug, info)" \
  --env SERVER_NAME="Human-friendly server name (optional)" \
  --env GITHUB_TOKEN="GitHub personal access token (required for API access)"

How to use

This MCP server exposes a suite of tools that interact with the GitHub API through the MCP framework. It provides modular capabilities for repository management (create, list, get), branch handling, issue tracking, pull request operations, file changes, and release management. Each tool is designed to be invoked via MCP-compatible clients, allowing LLM agents to perform GitHub operations in a structured, validated, and rate-limited manner. Authentication is handled via a GitHub personal access token, which must be supplied through environment configuration (GITHUB_TOKEN).

How to install

Prerequisites:

  • Node.js v16 or newer installed on your system
  • A GitHub personal access token with the necessary permissions

Setup steps:

  1. Clone the repository: git clone https://github.com/cyanheads/github-mcp-server.git cd github-mcp-server

  2. Install dependencies: npm install

  3. Create a .env file in the project root (or set environment variables inline) with your GitHub token and configuration: GITHUB_TOKEN=your_github_personal_access_token LOG_LEVEL=info SERVER_NAME=github-mcp-server

  4. Build the project: npm run build

  5. Start the server: node build/index.js

Additional notes

Notes and tips:

  • The server relies on a GitHub token; ensure it has the appropriate scopes for the intended operations (repos, issues, pull requests, etc.).
  • If you plan to run multiple MCP servers in parallel, customize SERVER_NAME to avoid naming collisions.
  • The build step outputs to build/index.js, which is what node build/index.js executes. If you change build configurations, re-run npm run build.
  • For production deployments, consider setting LOG_LEVEL to warn or error and enabling proper logging targets.
  • If you encounter rate-limit issues with the GitHub API, the internal Rate Limiter will help mitigate them, but you may also need to adjust token scopes or use a token with higher rate limits.
  • Environment variables can be provided via a .env file or your deployment platform’s secret management; ensure GITHUB_TOKEN is kept secure.

Related MCP Servers

Sponsor this space

Reach thousands of developers