GitHub MCP Server

Enables file operations, repository management, and search functionality for the GitHub API.

Local serverstdioTypeScript★ 1

What is the GitHub MCP Server?

Enables file operations, repository management, and search functionality for the GitHub API.

The short version

  • Automatic Branch Creation — When creating/updating files or pushing changes, branches are automatically created if they don't exist
  • Comprehensive Error Handling — Clear error messages for common issues
  • Git History Preservation — Operations maintain proper Git history without force pushing
  • Batch Operations — Support for both single-file and multi-file operations
  • Advanced Search — Support for searching code, issues/PRs, and users

More MCP options

Compare MCP servers by category, or browse hosted MCP servers if you prefer an endpoint over a local process.

Maintainer setup documentation.

How to install the GitHub MCP Server

{
  "mcpServers": {
    "github": {
      "command": "npx",
      "args": [
        "-y",
        "@modelcontextprotocol/server-github"
      ],
      "env": {
        "GITHUB_PERSONAL_ACCESS_TOKEN": "<YOUR_TOKEN>"
      }
    }
  }
}

Configuration as documented by the project. Restart the client after saving.

Configuration

VariableDescriptionRequired
GITHUB_PERSONAL_ACCESS_TOKENCredential the server authenticates with.Yes

Example prompts to try

  • “Use GitHub to Inputs.”
  • “Use GitHub to Returns.”
  • “Use GitHub to Features.”

Frequently asked questions

This tool lets you automate common GitHub tasks like creating/updating files, managing repositories, creating pull requests, searching code/issues/users, and more, all through the GitHub API.