ipIterPrompt
MCP serverProject ManagementVerified Last verified 2026-07-24

GitHub MCP Server

by GitHub

GitHub's official MCP server lets an AI agent read and act on your repositories: browse code, open and comment on issues and pull requests, review diffs, and inspect Actions runs. It's offered both as a remote hosted endpoint and as a local server, and authenticates with a GitHub token or OAuth.

Works with

The Model Context Protocol (MCP).

When to use it

  • When you want the agent working from your real backlog, not a paste
  • Automating PR triage, issue grooming, or release notes
  • Letting an agent open a PR at the end of a task

When not to

  • On untrusted repos where issue/PR text could carry prompt injection — scope the token

What it does

  • Read repositories, files, issues, and pull requests
  • Create/update issues and PRs and post comments
  • Inspect Actions workflow runs and logs

How to install

Setup steps with copy-paste config. Sources are cited under each method.

Remote server (OAuth)

Requires: An MCP host that supports remote servers · A GitHub account

  1. Add the remote endpoint

    Point your host at GitHub's hosted MCP endpoint and authorize via OAuth — no local install.

    url
    https://api.githubcopilot.com/mcp/
  2. Authorize

    Complete the OAuth flow when prompted; scope the grant to only the repos you want the agent to touch.

Local server (Docker + token)

Requires: Docker · A GitHub personal access token

  1. Add to your host's MCP config

    For Claude Code, add it to `.mcp.json`; other hosts use an equivalent MCP settings block.

    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": "<your-token>" }
        }
      }
    }
  2. Restart the host

    Reload the agent so it discovers the new server's tools.

How to prompt it

Copy-paste prompts written to exercise this plugin, with what to expect.

Triage open issues

Your repo has a pile of unlabeled issues.

List open issues in owner/repo with no labels, group them by theme, and propose a label and priority for each. Don't apply anything yet.

What to expect: The agent uses the GitHub tools to pull real issues and returns a grouped, prioritized plan you can approve before it writes labels.

  • Ask for a dry run first, then say 'apply the labels you proposed' once you're happy.

Draft a PR from a branch

You've pushed a feature branch and want a PR.

Open a pull request from feature/pricing into main. Summarize the diff, list test coverage, and flag anything risky.

What to expect: A PR is created with a diff-grounded description; risky areas are called out rather than glossed over.

Tips for getting the most out of it

  • Use a fine-grained token scoped to specific repos — the agent can only reach what the token allows.
  • Treat issue and PR bodies as untrusted input; they can contain injection attempts.

Prompts to pair with it

Real prompts from the IterPrompt library you can copy or run.

Pull Request Review Assistant

Turn any AI chat into a pull request review assistant with this community persona prompt.

1,150 copiesOpen ↗

Claude Code Skill (Slash Command): push-and-pull-request.md

Turn any AI chat into a claude code skill (slash command): push-and-pull-request.md with this community persona prompt.

2,246 copiesOpen ↗

Pull Request Deep Review — TypeScript & React

Review a PR like production depends on it. Purpose-built for typescript & react contexts.

2,979 copiesOpen ↗

Pull Request Deep Review — Python Backend

Review a PR like production depends on it. Purpose-built for python backend contexts.

2,841 copiesOpen ↗

PR Description Writer

Reviewable pull request descriptions generated from the actual diff.

2,650 copiesOpen ↗

GitHub Expert

Turn any AI chat into a github expert with this community persona prompt.

4,783 copiesOpen ↗
See more prompts in the library

Frequently asked questions

Remote or local — which should I use?+

The remote OAuth endpoint is the fastest to set up and needs no Docker. The local server gives you full control over the token and network, which some orgs require.

Does it work outside Claude?+

Yes. It's an MCP server, so it works with Cursor, Windsurf, Cline, VS Code, Zed, and any other MCP-compatible host.

Pairs well with

Related guides

Alternatives to GitHub MCP Server

Sources & verification

The facts on this page and where they come from. Anything unverified is labeled — we'd rather say "unknown" than guess.

Install steps, pricing, and availability change often. Always confirm on the official page before relying on setup details.