---
title: "GitHub MCP, read PRs, issues, code from any repo | Recipe — StudioMeyer Academy"
description: "Official GitHub MCP server gives Claude direct access to PRs, issues, code search, and review workflows. Hosted remote (api.githubcopilot.com/mcp) or local Docker. 19 toolsets."
canonical: "https://studiomeyer.academy/en/recipes/2.5-github-mcp"
language: en
markdown_versions: ["https://studiomeyer.academy/en/recipes/2.5-github-mcp.md"]
publisher: "StudioMeyer Academy, https://studiomeyer.academy (llms.txt: https://studiomeyer.academy/llms.txt)"
---

[← Alle Recipes](https://studiomeyer.academy/recipes)

Phase 2 · Connectivity·5 steps

# GitHub MCP, read PRs, issues, code from any repo

Official GitHub MCP server gives Claude direct access to PRs, issues, code search, and review workflows. Hosted remote (api.githubcopilot.com/mcp) or local Docker. 19 toolsets.

5 steps0%

Du liest ohne Account. Mit [Login](https://studiomeyer.academy/login?next=/recipes/2.5-github-mcp) speichern wir Step-Fortschritt + Notes.

# GitHub MCP

The official `github/github-mcp-server` is the most polished MCP server for any third-party service. It exposes **19 toolsets** organized by area: `repositories`, `issues`, `pull_requests`, `actions`, `code_security`, `context`, `copilot`, `dependabot`, `discussions`, `gists`, `git`, `labels`, `notifications`, `organizations`, `projects`, `secret_protection`, `security_advisories`, `stargazers`, `users`. Each toolset can be enabled or disabled with the `--toolsets` flag.

There are two ways to install it. The hosted remote (`api.githubcopilot.com/mcp/`) works with Claude Code, Cursor, and VS Code 1.101+. The local Docker image (`ghcr.io/github/github-mcp-server`) is needed for Claude Desktop, which does not yet support OAuth connectors for GitHub MCP.

The hosted remote URL is free with any GitHub account, the "copilot" in the domain name does not mean you need a Copilot subscription.

### Step 1: Create a GitHub Personal Access Token

Go to https://github.com/settings/tokens?type=beta (fine-grained tokens). Create a token with:

- **Repository access:** the repos you want Claude to see (or "All repositories" if you trust your client)
- **Permissions:** Contents (Read), Issues (Read/Write), Pull requests (Read/Write), Metadata (Read)

Copy the token (it starts with `github_pat_`). You only see it once.

For more access (private orgs, etc.) use a classic PAT with `repo` scope.

## Step 2a: Install via hosted remote (Claude Code, fastest path)

No Docker, no images to keep up-to-date. One command:

```bash
claude mcp add --transport http github https://api.githubcopilot.com/mcp \
  --header "Authorization: Bearer github_pat_xxxxxxxxxxxxxxx"
```

This is the official syntax from `code.claude.com/docs/en/mcp`. Works with both fine-grained PATs (`github_pat_*`) and classic PATs (`ghp_*`).

## Step 2b: Install via Docker (Claude Desktop or local-only)

If you are on Claude Desktop, or you want everything to run locally, use the Docker image:

```bash
claude mcp add github -s user \
  -e GITHUB_PERSONAL_ACCESS_TOKEN=github_pat_xxxxxxxxxxxxxxx \
  -- docker run -i --rm -e GITHUB_PERSONAL_ACCESS_TOKEN ghcr.io/github/github-mcp-server
```

The `-e` flag in `claude mcp add` passes the env var to the docker container.

For Claude Desktop directly, edit `claude_desktop_config.json` (Mac: `~/Library/Application Support/Claude/`, Windows: `%APPDATA%\Claude\`, Linux: `~/.config/Claude/`):

```json
{
  "mcpServers": {
    "github": {
      "command": "docker",
      "args": ["run", "-i", "--rm", "-e", "GITHUB_PERSONAL_ACCESS_TOKEN", "ghcr.io/github/github-mcp-server"],
      "env": {
        "GITHUB_PERSONAL_ACCESS_TOKEN": "github_pat_xxxxxxxxxxxxxxx"
      }
    }
  }
}
```

### Step 2: Codex equivalent

In `~/.codex/config.toml`:

```toml
[mcp_servers.github]
command = "docker"
args = ["run", "-i", "--rm", "-e", "GITHUB_PERSONAL_ACCESS_TOKEN", "ghcr.io/github/github-mcp-server"]

[mcp_servers.github.env]
GITHUB_PERSONAL_ACCESS_TOKEN = "github_pat_xxxxxxxxxxxxxxx"
```

### Step 3: Verify

Run `academy_validate_step`, checks for `github` in `claude mcp list`. Then prove it works:

In a fresh Claude Code session:

```
"list the open issues in anthropics/claude-code"
```

Claude calls `list_issues` on the GitHub MCP server. You get the latest 30 issues with titles, authors, labels.

### Step 4: Three killer workflows

Now that GitHub is wired up, three workflows pay off immediately:

**1\. Triage your inbox of PR notifications:**

```
"what PRs from <my-org> need my review and what are they about?"
```

Claude calls `list_pull_requests` filtered to the user, then `pull_request_read` on each, then summarizes.

**2\. Search code across repos you can read:**

```
"show me how the studiomeyer-io org handles MCP server OAuth"
```

Claude calls `search_code`, much faster than git clone + grep.

**3\. Auto-draft PR descriptions from a diff:**

```
"draft a PR description from the diff of feature-x → main, focused on the why"
```

Claude reads the diff via `get_commit` and the writing-voice rules from your CLAUDE.md.

### Step 5: Avoid the rate-limit footgun

The GitHub API has tight rate limits per token. If Claude does 30 sequential API calls in one prompt you can hit the wall. Two mitigations:

1. **Use `minimal_output: true` parameter** for `list_*` tools, strips out boilerplate fields.
2. **Use `search_*` over `list_*` + filter**, search returns ranked results in one call instead of paginating.

Add to CLAUDE.md:

```markdown
## GitHub MCP usage

When using the github MCP server, prefer search_* over list_* + manual filter,
and use minimal_output: true for broad queries. Each tool call counts against
the PAT's rate limit (5000/hour for fine-grained, less for some endpoints).
```

You now have all five core MCP servers: First MCP, Memory, Web Research, Code Intel, GitHub. Phase 3 onwards uses them, basic workflows in Phase 3, deep memory tricks in Phase 4, daily rituals in Phase 5.

Client check · run on your machine

claude mcp list 2>&1 | grep -i "github" | head -3

**Expect:** A GitHub MCP is listed.

**If stuck:** Add it with \`claude mcp add github -s user -e GITHUB\_PERSONAL\_ACCESS\_TOKEN=ghp\_... -- docker run -i --rm -e GITHUB\_PERSONAL\_ACCESS\_TOKEN ghcr.io/github/github-mcp-server\`.

[← Code intelligence, codebase-me](https://studiomeyer.academy/recipes/2.4-code-intelligence) [Slash commands and built-in sh →](https://studiomeyer.academy/recipes/3.1-slash-commands)

Phase 2

Your first MCP servers (Memory, Research, GitHub, Code Intel)

[Alle Phasen →](https://studiomeyer.academy/recipes)

Concepts

[github MCP](https://studiomeyer.academy/concepts/github_mcp)

## Sitemap

Public pages of this site as Markdown: [sitemap](https://studiomeyer.academy/sitemap.md). Curated entry point: [llms.txt](https://studiomeyer.academy/llms.txt), full text: [llms-full.txt](https://studiomeyer.academy/llms-full.txt).
