NativeAIHub
GitHub MCP Server

GitHub MCP Server

Connect your AI agent directly to GitHub. Manage repositories, pull requests, issues, code search, branches, and releases without leaving your terminal.

MCP Serverยท4 sectionsยท1 min read
codingdevops
Install Prompt

Paste this into Claude Code to set it up:

I want to add the GitHub MCP Server to my Claude Code setup.

IMPORTANT: Never use Read/Edit tools on ~/.claude.json. Use jq via Bash instead.

First, get your GitHub personal access token by running:
```bash
gh auth token
```

Then run this command to add the MCP server (replace YOUR_TOKEN with the token from the previous command):
```bash
jq '.mcpServers["github"] = {"type": "http", "url": "https://api.githubcopilot.com/mcp", "headers": {"Authorization": "Bearer YOUR_TOKEN"}}' ~/.claude.json > /tmp/claude-json-tmp && mv /tmp/claude-json-tmp ~/.claude.json
```

IMPORTANT: The URL is https://api.githubcopilot.com/mcp, NOT api.github.com. This is the official MCP endpoint provided by GitHub.

After adding, restart Claude Code. On first connection, your browser will open a GitHub OAuth prompt. Grant the permissions the agent needs, and the connection persists across sessions.

01What It Does

GitHub, without the browser

Instead of switching to the browser to check issues, create pull requests, or review code, the agent handles everything within your conversation. It can read repositories, search code across your entire organization, manage branches, and handle the full pull request lifecycle.
๐Ÿ”
Code SearchSearch across repositories for function usage, patterns, deprecated calls, or configuration values across your whole org.
๐Ÿ”€
Pull Request LifecycleCreate branches, push code, open PRs, submit reviews with comments, and merge. The full cycle in one conversation.
๐Ÿ“‹
Issue ManagementList, search, create, comment on, and update issues. Filter by labels, assignee, or state.

02Real Scenarios

1

"Fix issue #42"

The agent reads the issue, explores the codebase, writes the fix, creates a branch, pushes changes, and opens a pull request linking back to the issue.

2

"Review the latest PR"

The agent fetches the PR, reads every changed file, analyzes the diff, and posts a detailed review with inline comments.

3

"Find all usages of the deprecated auth function"

The agent runs code search across your repositories and summarizes every file that needs updating.

4

"Create a release for v2.1.0"

The agent creates a tag, generates release notes from merged PRs since the last release, and publishes the release.

03Setup

# Add to ~/.claude.json under mcpServers
"github": {
  "type": "http",
  "url": "https://api.githubcopilot.com/mcp"
}
The URL is api.githubcopilot.com, not api.github.com. This is the official MCP endpoint provided by GitHub. On first connection, your browser opens a GitHub OAuth prompt. Grant the permissions the agent needs, and the connection persists across sessions.

04Works Well With

โœ…
Todoist MCPConvert GitHub issues into Todoist tasks for personal prioritization. Sync issue status between both systems.
๐Ÿ“
Notion MCPStore project documentation and architecture decisions in Notion while keeping code and issues on GitHub.
๐Ÿ”
Code Reviewer AgentA specialized agent persona that reviews PRs with deep expertise in your tech stack and coding standards.
๐Ÿ“ฆ
Commit and Review SkillsThe /commit skill creates clean commits. The /review-pr skill performs thorough reviews. Both integrate with GitHub MCP.