> ## Documentation Index
> Fetch the complete documentation index at: https://docs.routemcp.io/llms.txt
> Use this file to discover all available pages before exploring further.

# GitHub

> Code hosting, version control, and developer collaboration via the GitHub REST API. 417 tools covering repos, issues, pull requests, workflows, releases, gists, and org/team administration — all accessible through the MCP runtime endpoint.

<img src="https://icon.horse/icon/github.com" alt="GitHub" style={{ width: "48px", height: "48px", marginBottom: "16px" }} />

## Overview

| Property   | Value                    |
| ---------- | ------------------------ |
| Slug       | `github`                 |
| Category   | Developer                |
| Auth       | OAuth 2.0 (no PKCE)      |
| Base URL   | `https://api.github.com` |
| Tool count | 417                      |
| Rate limit | 10 req/sec, 100 req/min  |

## Tool catalogue

GitHub tools are surfaced through the **MCP runtime** (`POST /api/v1/mcp/:serverId`) and the **HTTP chat** endpoint (`POST /api/v1/mcp/:serverId/chat`). In router mode the model uses `SEARCH_TOOLS` to discover the right slug at runtime — you don't bind a fixed REST resource ahead of time. The catalogue covers:

| Area                           | Sample slugs                                                                                                                                                                | Approx. count |
| ------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------- |
| Repositories                   | `GITHUB_CREATE_A_REPOSITORY`, `GITHUB_GET_A_REPOSITORY`, `GITHUB_LIST_REPOSITORY_LANGUAGES`, `GITHUB_GET_REPOSITORY_CONTENT`                                                | 90+           |
| Issues                         | `GITHUB_ISSUES_CREATE`, `GITHUB_ADD_LABELS_TO_AN_ISSUE`, `GITHUB_ADD_ASSIGNEES_TO_AN_ISSUE`, `GITHUB_LIST_ISSUE_COMMENTS`                                                   | 35+           |
| Pull requests                  | `GITHUB_CREATE_A_PULL_REQUEST`, `GITHUB_FIND_PULL_REQUESTS`, `GITHUB_MERGE_A_PULL_REQUEST`, `GITHUB_DISMISS_A_REVIEW_FOR_A_PULL_REQUEST`                                    | 35+           |
| Commits, branches, refs        | `GITHUB_CREATE_A_COMMIT`, `GITHUB_COMPARE_TWO_COMMITS`, `GITHUB_CREATE_A_BLOB`, `GITHUB_GENERATE_RELEASE_NOTES_CONTENT_FOR_A_RELEASE`                                       | 40+           |
| Workflows, runs, runners       | `GITHUB_CANCEL_A_WORKFLOW_RUN`, `GITHUB_DOWNLOAD_WORKFLOW_RUN_LOGS`, `GITHUB_ENABLE_A_WORKFLOW`, `GITHUB_ADD_RUNNER_LABELS`                                                 | 45+           |
| Releases & artifacts           | `GITHUB_DOWNLOAD_AN_ARTIFACT`, `GITHUB_DOWNLOAD_A_REPOSITORY_ARCHIVE_ZIP`, `GITHUB_EXPORT_A_SOFTWARE_BILL_OF_MATERIALS_SBOM_FOR_A_REPOSITORY`                               | 20+           |
| Gists                          | `GITHUB_GIST_S_CREATE`, `GITHUB_GIST_S_LIST_PUBLIC`, `GITHUB_FORK_A_GIST`, `GITHUB_CHECK_IF_A_GIST_IS_STARRED`                                                              | 15+           |
| Users, followers, social       | `GITHUB_GET_THE_AUTHENTICATED_USER`, `GITHUB_FOLLOW_A_USER`, `GITHUB_ADD_EMAIL_ADDRESS_FOR_THE_AUTHENTICATED_USER`, `GITHUB_ADD_SOCIAL_ACCOUNTS_FOR_THE_AUTHENTICATED_USER` | 30+           |
| Organisations & teams          | `GITHUB_ADD_OR_UPDATE_TEAM_MEMBERSHIP_FOR_A_USER`, `GITHUB_ADD_OR_UPDATE_TEAM_REPOSITORY_PERMISSIONS`, `GITHUB_ADD_REPO_TO_ORG_SECRET_WITH_SELECTED_VISIBILITY`             | 50+           |
| Secrets, variables, OIDC       | `GITHUB_ENCRYPT_ORG_SECRETS_USING_PUBLIC_KEY`, `GITHUB_ENCRYPT_AND_UPDATE_DEV_SECRET`, `GITHUB_CONFIGURE_OIDCSUBJECT_CLAIM_TEMPLATE`                                        | 25+           |
| Notifications, stars, starring | `GITHUB_ACTIVITY_STAR_REPO_FOR_AUTHENTICATED_USER`, `GITHUB_ACTIVITY_LIST_STARGAZERS_FOR_REPO`                                                                              | 10+           |
| Branch protection & checks     | `GITHUB_ADD_STATUS_CHECK_CONTEXTS`, `GITHUB_ADD_APP_ACCESS_RESTRICTIONS`, `GITHUB_CREATE_A_CHECK_RUN`, `GITHUB_CREATE_A_CHECK_SUITE`                                        | 20+           |

Discover the full list at runtime:

```bash theme={null}
curl -N -X POST "https://api.routemcp.io/api/v1/mcp/<workspace_id>/chat" \
  -H "x-api-key: <YOUR_API_KEY>" \
  -H "x-session-id: <SESSION_ID>" \
  -H "content-type: application/json" \
  -d '{"message": "List every GitHub tool that can create or update pull request reviews."}'
```

The model will call `SEARCH_TOOLS({query: "pull request review"})` and stream the matched slugs back.

## Connect setup

GitHub uses OAuth 2.0 against a GitHub-registered **OAuth App** (not the GitHub App flow). One app per platform is enough — your end users supply their own GitHub credentials by going through the consent screen.

<Steps>
  <Step title="Register a GitHub OAuth App">
    Go to [github.com/settings/developers](https://github.com/settings/developers) → **OAuth Apps** → **New OAuth App**. Set the **Authorization callback URL** to:

    ```
    https://api.routemcp.io/api/v1/connect/oauth/callback
    ```

    Copy the **Client ID** and generate a new **Client Secret**.
  </Step>

  <Step title="Required OAuth scopes">
    The default scope set requested at consent time:

    * `repo` — repo read/write
    * `read:org` — read org membership and teams
    * `user` — read profile + email
    * `gist` — manage gists
    * `workflow` — manage GitHub Actions workflows
    * `notifications` — read user notifications
    * `read:packages` — download packages
  </Step>

  <Step title="Connect via the widget">
    The end user opens the Connect widget, picks GitHub, and is redirected to GitHub's consent screen.
  </Step>
</Steps>

## Usage

### Through the chat endpoint (recommended)

```bash theme={null}
curl -N -X POST "https://api.routemcp.io/api/v1/mcp/<workspace_id>/chat" \
  -H "x-api-key: sk_live_your_key" \
  -H "x-session-id: user-42" \
  -H "content-type: application/json" \
  -d '{"message": "Open a PR titled `fix: typo in README` from branch `keval/typo-fix` to `main` on `org/repo`."}'
```

The agent loop picks `GITHUB_CREATE_A_PULL_REQUEST`, executes it with the connected user's token, and streams the result back as SSE.

### Direct MCP JSON-RPC (Claude Desktop / Cursor / custom MCP clients)

```json theme={null}
{
  "mcpServers": {
    "routemcp": {
      "url": "https://api.routemcp.io/api/v1/mcp/<workspace_id>",
      "headers": {
        "x-api-key": "<YOUR_API_KEY>",
        "x-session-id": "<SESSION_ID>"
      }
    }
  }
}
```

Once connected, MCP clients can invoke any of the 417 tools by slug via the standard `tools/call` JSON-RPC method.
