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.
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:
-
Clone the repository: git clone https://github.com/cyanheads/github-mcp-server.git cd github-mcp-server
-
Install dependencies: npm install
-
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
-
Build the project: npm run build
-
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
mcp-framework
A framework for writing MCP (Model Context Protocol) servers in Typescript
MCP-Nest
A NestJS module to effortlessly create Model Context Protocol (MCP) servers for exposing AI tools, resources, and prompts.
obsidian
Obsidian Knowledge-Management MCP (Model Context Protocol) server that enables AI agents and development tools to interact with an Obsidian vault. It provides a comprehensive suite of tools for reading, writing, searching, and managing notes, tags, and frontmatter, acting as a bridge to the Obsidian Local REST API plugin.
git
An MCP (Model Context Protocol) server enabling LLMs and AI agents to interact with Git repositories. Provides tools for comprehensive Git operations including clone, commit, branch, diff, log, status, push, pull, merge, rebase, worktree, tag management, and more, via the MCP standard. STDIO & HTTP.
mcp-ts-template
TypeScript template for building Model Context Protocol (MCP) servers. Ships with declarative tools/resources, pluggable auth, multi-backend storage, OpenTelemetry observability, and first-class support for both local and edge (Cloudflare Workers) runtimes.
Matryoshka
MCP server for token-efficient large document analysis via the use of REPL state