---
title: "GitHub MCP Server Setup Guide and Schema"
slug: "github"
category: "dev-tools"
package: "@modelcontextprotocol/server-github"
transport: "stdio"
canonical: "https://mcp-codex.com/servers/github"
source: "MCP Codex (https://mcp-codex.com)"
dateModified: "2026-09-28"
---

# GitHub MCP Server

> Full GitHub API integration for repositories, issues, PRs, and code search.

## Overview
Connect your AI agent to GitHub to manage repositories, create and review pull requests, search code, manage issues and labels, and automate workflows. The official GitHub MCP server provides read and write access to the GitHub API through a standardized MCP interface.

## Quick Install
```bash
npx -y @modelcontextprotocol/server-github
```

## Environment Variables

| Variable | Description | Required |
| :--- | :--- | :--- |
| `GITHUB_PERSONAL_ACCESS_TOKEN` | GitHub Personal Access Token with repo scope | **Yes** |

## Client Configurations

### Claude Desktop (`claude_desktop_config.json`)
```json
{
  "mcpServers": {
    "github": {
      "command": "npx",
      "args": [
        "-y",
        "@modelcontextprotocol/server-github"
      ],
      "env": {
        "GITHUB_PERSONAL_ACCESS_TOKEN": "ghp_xxxxxxxxxxxxxxxxxxxx"
      }
    }
  }
}
```

### Cursor (`mcp.json`)
```json
{
  "mcpServers": {
    "github": {
      "command": "npx",
      "args": [
        "-y",
        "@modelcontextprotocol/server-github"
      ],
      "env": {
        "GITHUB_PERSONAL_ACCESS_TOKEN": "ghp_xxxxxxxxxxxxxxxxxxxx"
      }
    }
  }
}
```

### OpenAI Codex CLI (`~/.codex/config.toml`)
```toml
[mcp_servers.github]
command = "npx"
args = ["-y", "@modelcontextprotocol/server-github"]

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

## Available Tools (7)

- `create_or_update_file`
- `search_repositories`
- `create_issue`
- `create_pull_request`
- `get_file_contents`
- `list_commits`
- `push_files`

## Documentation & Links
- Canonical Web Page: https://mcp-codex.com/servers/github
- Weekly Protocol Changelog: https://mcp-codex.com#newsletter
- GitHub Repository: https://github.com/github/github-mcp-server
- Official Documentation: https://modelcontextprotocol.io/docs/servers/github
- Setup Tutorial Guide: https://mcp-codex.com/articles/github-mcp-server-setup

