# GitHub MCP server

> Lets an AI client read GitHub repositories, issues, pull requests, and commits using a read-only connection.

- Repository: https://github.com/AbdulMuhaiminKhan/github-mcp
- Page: https://hostedmcp.org/servers/abdulmuhaiminkhan/github-mcp
- Transport: stdio
- Stars: 0
- License: MIT
- Latest version: 1.2.0

## Install

### Claude Code

```sh
claude mcp add --env 'GITHUB_TOKEN=<YOUR_GITHUB_TOKEN>' github-mcp -- uvx github-mcp-readonly
```

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

```json
{
  "mcpServers": {
    "github-mcp": {
      "command": "uvx",
      "args": [
        "github-mcp-readonly"
      ],
      "env": {
        "GITHUB_TOKEN": "<YOUR_GITHUB_TOKEN>"
      }
    }
  }
}
```

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

```json
{
  "servers": {
    "github-mcp": {
      "type": "stdio",
      "command": "uvx",
      "args": [
        "github-mcp-readonly"
      ],
      "env": {
        "GITHUB_TOKEN": "<YOUR_GITHUB_TOKEN>"
      }
    }
  }
}
```

### VS Code CLI

```sh
code --add-mcp '{"name":"github-mcp","type":"stdio","command":"uvx","args":["github-mcp-readonly"],"env":{"GITHUB_TOKEN":"<YOUR_GITHUB_TOKEN>"}}'
```

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

```json
{
  "mcpServers": {
    "github-mcp": {
      "command": "uvx",
      "args": [
        "github-mcp-readonly"
      ],
      "env": {
        "GITHUB_TOKEN": "<YOUR_GITHUB_TOKEN>"
      }
    }
  }
}
```

### Codex

```sh
codex mcp add github-mcp --env 'GITHUB_TOKEN=<YOUR_GITHUB_TOKEN>' -- uvx github-mcp-readonly
```

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

```toml
[mcp_servers.github-mcp]
command = "uvx"
args = ["github-mcp-readonly"]

[mcp_servers.github-mcp.env]
GITHUB_TOKEN = "<YOUR_GITHUB_TOKEN>"
```

### Gemini CLI

```sh
gemini mcp add -s user -e 'GITHUB_TOKEN=<YOUR_GITHUB_TOKEN>' github-mcp uvx -- github-mcp-readonly
```

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

```json
{
  "mcpServers": {
    "github-mcp": {
      "command": "uvx",
      "args": [
        "github-mcp-readonly"
      ],
      "env": {
        "GITHUB_TOKEN": "<YOUR_GITHUB_TOKEN>"
      }
    }
  }
}
```

## Environment variables

| Name | Required | Secret | Description |
|---|---|---|---|
| `GITHUB_TOKEN` | yes | yes | Fine-grained GitHub token with read-only access (Metadata, Contents, Issues, Pull requests). |
| `GITHUB_MCP_TOOLSET` | no | no | Tool descriptions to serve: v2 (default, optimized), v1 or v1b (benchmark baselines). |

## FAQ

### Is this server read-write or read-only?

The server provides least-privilege, read-only access to GitHub data.

### What specific GitHub data can the AI access?

The server provides tools to list repositories, get repository details, list open issues, search issues, list pull requests, and get recent commits.

### Does the server support searching for closed issues?

No, the current implementation of the open-issues tool does not support closed issues; the model may attempt to pass a closed state which will fail.
