# GitHub (MCP Server)

> Manage repos, issues, pull requests and Actions from your AI agent

- Type: MCP server
- Publisher: GitHub (official)
- Categories: Development, DevOps & Cloud
- Website: https://github.com/github/github-mcp-server
- Source: https://github.com/github/github-mcp-server
- Transport: streamable-http
- Server URL: https://api.githubcopilot.com/mcp/
- Launch command: docker run -i --rm -e GITHUB_PERSONAL_ACCESS_TOKEN ghcr.io/github/github-mcp-server
- Sign-in: oauth
- Environment variables: GITHUB_PERSONAL_ACCESS_TOKEN
- GitHub stars: 33300
- Listed: 2025-04-04

## Overview

GitHub's own MCP server gives an agent the parts of GitHub that aren't in your local checkout: issues, pull requests and reviews, Actions runs, security alerts and code in other repositories. In practice it's most useful for questions like "why did CI fail on main?", "which PRs are waiting on my review?" or "open a PR for this branch with a summary", and for agents that work across several repositories at once.

It suits developers who work in Codex, the OpenAI API or another MCP client. In ChatGPT, OpenAI's GitHub app is usually easier.

## From the publisher

GitHub's official MCP server connects AI tools to repositories, issues, pull requests, Actions, code security alerts and more. It is available as a hosted remote server with OAuth or as a local Docker/binary server using a personal access token. Toolsets can be enabled selectively to limit the exposed tools.

## What you need

- **A GitHub account.** The server can only reach what your credential can; GitHub enforces its normal permissions.
- **Remote or local.** GitHub hosts the server at `https://api.githubcopilot.com/mcp/` (Streamable HTTP). There is also a local server as a Docker image or binary, which is the only option for GitHub Enterprise Server.
- **A token or OAuth.** The hosted server accepts a personal access token as a bearer token, which is what GitHub's Codex guide uses. OAuth only works in clients that have registered a GitHub or OAuth app; OpenAI's GitHub plugin includes one for Codex. The local server can sign you in through the browser or use `GITHUB_PERSONAL_ACCESS_TOKEN`.
- **Org approval, sometimes.** Organization policies on MCP in Copilot, OAuth apps, tokens and SSO can block access.

## Good to know

- **Write tools are on by default.** The default toolsets (context, repos, issues, pull requests, users) include tools that create branches, open and merge pull requests and edit issues. Keep tool approvals on.
- **Load only what you need.** Each toolset has its own URL, such as `/mcp/x/actions`, and more toolsets (Actions, code security, Dependabot, projects) are opt-in.
- **Issues and comments are untrusted input.** Anyone can write text in a public issue that tries to redirect the agent. Lockdown mode hides content from users without push access, but GitHub calls it a best-effort filter, not an authorization boundary.
- **Scope tokens tightly.** Grant only the scopes your tasks need, use separate tokens per project and rotate them.
- **Rate limits apply.** Calls count against GitHub's normal API limits.

## Install

1. **Connect it in ChatGPT** Turn on Developer mode in ChatGPT (Settings → Security and login), open Plugins, select + and paste https://api.githubcopilot.com/mcp/ as the MCP server URL, then sign in with OAuth. Add it to a chat from the composer's tools menu.

2. **Or add it to Codex or the API**

   Codex CLI:

   ```bash
   codex mcp add github --url https://api.githubcopilot.com/mcp/
   codex mcp login github
   ```

   config.toml:

   ```toml
   [mcp_servers.github]
   url = "https://api.githubcopilot.com/mcp/"
   ```

   Responses API:

   ```python
   import os
   from openai import OpenAI
   
   client = OpenAI()
   
   response = client.responses.create(
       model="gpt-6-astra",
       tools=[{
           "type": "mcp",
           "server_label": "github",
           "server_url": "https://api.githubcopilot.com/mcp/",
           "authorization": os.environ["GITHUB_PERSONAL_ACCESS_TOKEN"],
           "require_approval": "never",
       }],
       input="List the open issues assigned to me in my-org/api",
   )
   print(response.output_text)
   ```

## Remove it

1. **In ChatGPT** Open the connection's details page in your plugin settings (chatgpt.com/plugins) and disconnect or delete it.

2. **In Codex**

   Codex CLI:

   ```bash
   codex mcp remove github
   ```

## Tools

- `get_me`
- `get_file_contents`
- `list_issues`
- `search_issues`
- `issue_write`
- `create_pull_request`
- `pull_request_read`
- `merge_pull_request`
- `create_branch`
- `actions_list`
- `list_code_scanning_alerts`
- `projects_write`

## Example prompts

- "List the open issues assigned to me in my-org/api"
- "Open a pull request from feature/login into main with a summary of the changes"
- "Why did the latest GitHub Actions run on main fail?"
- "Show code scanning alerts for this repository"

## Also available as

- plugin: [GitHub](https://chatgptplugins.directory/plugins/github.md)
- app: [GitHub](https://chatgptplugins.directory/apps/github.md)

## GitHub alternatives

- [Chrome DevTools MCP](https://chatgptplugins.directory/mcp/chrome-devtools.md): Let coding agents control and debug a live Chrome browser
- [Playwright MCP](https://chatgptplugins.directory/mcp/playwright.md): Browser automation for agents via Playwright accessibility snapshots
- [Context7](https://chatgptplugins.directory/mcp/context7.md): Pull up-to-date, version-specific library docs into your coding agent
- [Supabase](https://chatgptplugins.directory/mcp/supabase.md): Manage Supabase databases, migrations, edge functions and logs
- [Stripe](https://chatgptplugins.directory/mcp/stripe.md): Query and act on your Stripe account and search Stripe docs from any agent
- [Atlassian Rovo (Jira & Confluence)](https://chatgptplugins.directory/mcp/atlassian-rovo.md): Work with Jira issues and Confluence pages through Atlassian's hosted MCP

## FAQ

### Can I use the GitHub MCP server in ChatGPT?

In ChatGPT, the straightforward route is OpenAI's [GitHub app](/apps/github) or [GitHub plugin](/plugins/github). Developer mode can add MCP servers by URL with OAuth or no auth, but GitHub says each client must register its own app for OAuth, and ChatGPT isn't in its list of documented hosts, so we can't confirm the sign-in works there. See [Add an MCP server to ChatGPT](/tutorials/add-mcp-server-to-chatgpt).

### What's the difference between the GitHub MCP server, app and plugin?

The [GitHub app](/apps/github) is OpenAI's first-party connector for ChatGPT, and some features such as Codex require it. The [GitHub plugin](/plugins/github), also by OpenAI, combines a GitHub app connection with a config for this hosted MCP server using OAuth, so in Codex you can skip creating a token. The MCP server itself is GitHub's, works in any MCP client and offers toolsets and read-only mode.

### How do I make the GitHub MCP server read-only?

On the hosted server, add `/readonly` to the URL (for example `https://api.githubcopilot.com/mcp/readonly`) or send the `X-MCP-Readonly: true` header. For the local server, pass `--read-only` or set `GITHUB_READ_ONLY=1`. Only read tools are offered then. A token with read-only permissions adds a second layer.

### Can I use it with the OpenAI API?

Yes. The Responses API's `mcp` tool can call the hosted server: set `server_url` to `https://api.githubcopilot.com/mcp/` and pass a personal access token in `authorization`. Use `allowed_tools` to limit what the model can call and keep approvals for write tools. See [Use remote MCP servers in the OpenAI API](/tutorials/mcp-in-the-openai-api).

_Guide updated 2026-10-24. Sources: https://github.com/github/github-mcp-server, https://github.com/github/github-mcp-server/blob/main/docs/remote-server.md, https://github.com/github/github-mcp-server/blob/main/docs/installation-guides/install-codex.md, https://github.com/github/github-mcp-server/blob/main/docs/policies-and-governance.md, https://github.com/openai/plugins/tree/main/plugins/github, https://learn.chatgpt.com/docs/extend/mcp, https://developers.openai.com/api/docs/guides/tools-connectors-mcp._

---
Source: https://chatgptplugins.directory/mcp/github · Index: https://chatgptplugins.directory/llms.txt · Independent and community-run. Not affiliated with or endorsed by OpenAI. ChatGPT is a trademark of OpenAI.
