# GitHub MCP server

> Enables AI agents to manage repositories, pull requests, issues, and GitHub Actions through a token-optimized hybrid tool architecture.

- Repository: https://github.com/sumirati/mcp-github
- Page: https://hostedmcp.org/servers/sumirati/mcp-github
- Transport: stdio
- Stars: 1
- License: MIT
- Latest version: 2.2.0

## Install

### Claude Code

```sh
claude mcp add --env GITHUB_PERSONAL_ACCESS_TOKEN=<YOUR_GITHUB_PERSONAL_ACCESS_TOKEN> mcp-github -- npx -y @sumirati/mcp-github
```

### Cursor (`~/.cursor/mcp.json`)

```json
{
  "mcpServers": {
    "mcp-github": {
      "command": "npx",
      "args": [
        "-y",
        "@sumirati/mcp-github"
      ],
      "env": {
        "GITHUB_PERSONAL_ACCESS_TOKEN": "<YOUR_GITHUB_PERSONAL_ACCESS_TOKEN>"
      }
    }
  }
}
```

### VS Code (`.vscode/mcp.json`)

```json
{
  "servers": {
    "mcp-github": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "@sumirati/mcp-github"
      ],
      "env": {
        "GITHUB_PERSONAL_ACCESS_TOKEN": "<YOUR_GITHUB_PERSONAL_ACCESS_TOKEN>"
      }
    }
  }
}
```

### Claude Desktop (`claude_desktop_config.json`)

```json
{
  "mcpServers": {
    "mcp-github": {
      "command": "npx",
      "args": [
        "-y",
        "@sumirati/mcp-github"
      ],
      "env": {
        "GITHUB_PERSONAL_ACCESS_TOKEN": "<YOUR_GITHUB_PERSONAL_ACCESS_TOKEN>"
      }
    }
  }
}
```

### Codex (`~/.codex/config.toml`)

```toml
[mcp_servers.mcp-github]
command = "npx"
args = ["-y", "@sumirati/mcp-github"]

[mcp_servers.mcp-github.env]
GITHUB_PERSONAL_ACCESS_TOKEN = "<YOUR_GITHUB_PERSONAL_ACCESS_TOKEN>"
```

### Gemini CLI (`~/.gemini/settings.json`)

```json
{
  "mcpServers": {
    "mcp-github": {
      "command": "npx",
      "args": [
        "-y",
        "@sumirati/mcp-github"
      ],
      "env": {
        "GITHUB_PERSONAL_ACCESS_TOKEN": "<YOUR_GITHUB_PERSONAL_ACCESS_TOKEN>"
      }
    }
  }
}
```

## Environment variables

| Name | Required | Secret | Description |
|---|---|---|---|
| `GITHUB_PERSONAL_ACCESS_TOKEN` | yes | yes | GitHub Personal Access Token (classic or fine-grained) |
| `GITHUB_API_URL` | no | no | GitHub API URL (defaults to https://api.github.com) |
| `GITHUB_EXPOSE_ALL_TOOLS` | no | no | Set to 'true' to expose all 83 tools directly instead of the 5-tool hybrid discovery mode |
| `GITHUB_READ_ONLY` | no | no | Enable 3-tier read-only safety mode (true/false) |
| `MCP_OUTPUT_FORMAT` | no | no | Default output format for tool responses ('markdown' or 'json') |

## Tools (5)

- `github_find_actions`
- `github_execute_action`
- `get_file_contents`
- `get_repository`
- `get_commit`

## FAQ

### How does the server handle large numbers of GitHub tools without wasting tokens?

It uses a 5-Tool Hybrid Surface that exposes only 5 eager tools for common tasks, while the remaining 83 actions are accessed on-demand via dynamic discovery.

### Can I use this server in read-only mode?

Yes, you can enable a 3-tier read-only mode by setting the GITHUB_READ_ONLY environment variable to true, 1, or yes.

### What are the most commonly used tools available immediately?

The three eager tools for instant execution are getting file contents, getting repository metadata, and getting commit details.
