GitHub MCP server
Repositories, issues, pull requests, Actions and code search, through GitHub's hosted MCP server.
How it connects
New to MCP? What is an MCP server?
- Runs on
- GitHub's own MCP endpoint
- Connects with
- Credentials you paste in once: Personal Access Token
- Category
- Developer Tools
What it does
GitHub's MCP server gives an agent the repositories, issues and pull requests that your token can reach, and it acts as the token's owner. GitHub hosts it at https://api.githubcopilot.com/mcp/, and the code is open source in github/github-mcp-server if you would rather run it yourself. With no extra settings it offers 46 tools. Another 45, including everything for Actions and security alerts, stay hidden until you ask for their toolset.
Tools
With no toolset selected, the server loads five toolsets: context, repos, issues, pull_requests and users. That gives these 46 tools.
You and your account
| Tool | What it does | Reads or changes |
|---|---|---|
get_me | Returns the profile of the user who owns the token. | Reads |
get_teams | Lists the teams that user belongs to. | Reads |
get_team_members | Lists the members of one team in an organization. | Reads |
search_users | Finds GitHub users by username, name or profile details. | Reads |
ui_get | Fetches picker data for MCP Apps: labels, assignees, milestones, issue types, branches, issue fields and reviewers. | Reads |
Repositories and code
| Tool | What it does | Reads or changes |
|---|---|---|
get_file_contents | Reads a file or lists a directory at a branch, tag or commit. | Reads |
search_code | Searches code across all of GitHub, public repositories included, with GitHub's code search. | Reads |
search_repositories | Finds repositories by name, description, readme or topics. | Reads |
get_commit | Gets one commit with per-file stats, or the full patch. | Reads |
list_commits | Lists commits on a branch, filterable by author, path and date. | Reads |
search_commits | Searches commits on default branches with commit search syntax. | Reads |
list_branches | Lists a repository's branches. | Reads |
list_tags | Lists a repository's git tags. | Reads |
get_tag | Gets one git tag. | Reads |
list_releases | Lists a repository's releases. | Reads |
get_latest_release | Gets the latest release. | Reads |
get_release_by_tag | Gets the release for a tag. | Reads |
list_repository_collaborators | Lists a repository's collaborators. | Reads |
create_branch | Creates a branch from another branch. | Changes |
create_or_update_file | Creates or overwrites one file and commits it to a branch. | Changes |
push_files | Commits several files to a branch in one commit. | Changes |
delete_file | Deletes a file and commits the deletion. | Changes (deletes) |
create_repository | Creates a repository in your account or an organization. Private unless the agent sets private to false. | Changes |
fork_repository | Forks a repository into your account or an organization. | Changes |
Issues
| Tool | What it does | Reads or changes |
|---|---|---|
issue_read | Gets an issue, its comments, sub-issues, parent or labels. | Reads |
list_issues | Lists a repository's issues, filterable by state, labels and fields. | Reads |
search_issues | Searches issues by meaning, for queries like "login fails after reset". | Reads |
list_issue_types | Lists the issue types a repository or organization supports. | Reads |
list_issue_fields | Lists custom issue field definitions and their options. | Reads |
get_label | Gets one label from a repository. | Reads |
issue_write | Creates an issue or updates one: title, body, labels, assignees, milestone, type, or closing it as completed or a duplicate. | Changes |
add_issue_comment | Comments or reacts on an issue or pull request. | Changes |
update_issue_comment | Rewrites the body of an existing issue or pull request comment. | Changes |
sub_issue_write | Adds, removes or reorders sub-issues under a parent issue. | Changes |
assign_copilot_to_issue | Assigns Copilot to an issue, which starts Copilot's coding agent on a pull request. | Changes |
Pull requests
| Tool | What it does | Reads or changes |
|---|---|---|
pull_request_read | Gets a pull request, its diff, files, commits, status, check runs, reviews or comments. | Reads |
list_pull_requests | Lists a repository's pull requests. | Reads |
search_pull_requests | Searches pull requests with issue search syntax. | Reads |
create_pull_request | Opens a pull request, optionally as a draft with reviewers. | Changes |
update_pull_request | Edits a pull request's title, body, base, reviewers or draft state, or closes it. | Changes |
update_pull_request_branch | Brings the base branch's latest changes into the pull request branch. | Changes |
merge_pull_request | Merges a pull request by merge, squash or rebase. Not undoable from the server. | Changes |
pull_request_review_write | Creates, submits or deletes your review, including Approve and Request changes, and resolves review threads. | Changes |
add_comment_to_pending_review | Adds a line comment to your pending review. | Changes |
add_reply_to_pull_request_comment | Replies or reacts to a review comment. | Changes |
request_copilot_review | Asks Copilot to review a pull request. | Changes |
Toolsets that are off by default
These 45 tools exist in the server but are not offered until you enable their toolset. The token also needs the matching repository permission, such as Actions or Dependabot alerts, or the calls fail at GitHub.
| Toolset | Tools it adds |
|---|---|
actions | actions_list, actions_get, get_job_logs, and actions_run_trigger, which runs, re-runs and cancels workflows and deletes run logs |
code_security | list_code_scanning_alerts, get_code_scanning_alert |
code_quality | get_code_quality_finding |
dependabot | list_dependabot_alerts, get_dependabot_alert |
secret_protection | list_secret_scanning_alerts, get_secret_scanning_alert |
security_advisories | list_global_security_advisories, get_global_security_advisory, list_repository_security_advisories, list_org_repository_security_advisories |
discussions | list_discussions, get_discussion, get_discussion_comments, list_discussion_categories, discussion_comment_write |
projects | projects_list, projects_get, projects_write |
labels | list_label, label_write |
notifications | list_notifications, get_notification_details, dismiss_notification, mark_all_notifications_read, manage_notification_subscription, manage_repository_notification_subscription |
gists | list_gists, get_gist, create_gist, update_gist |
governance | repository_ruleset_read, create_repository_ruleset, custom_properties_read, custom_properties_write |
git | get_repository_tree |
orgs | search_orgs |
stargazers | list_starred_repositories, star_repository, unstar_repository |
copilot_issue_intents | assign_copilot_to_issue_with_intent |
On the hosted server you pick toolsets with the X-MCP-Toolsets header, for example repos,issues,pull_requests,actions, or with a path such as https://api.githubcopilot.com/mcp/x/actions. Unknown toolset names are ignored without an error, so check the tool list after a change. X-MCP-Tools takes an exact list of tool names instead, and a misspelled name stops the server from starting. For read-only mode, send X-MCP-Readonly: true or add /readonly to the path. It drops every write tool, including the comment tools.
Set it up
The hosted server takes a personal access token as a bearer token. Create a fine-grained one under Settings → Developer settings → Fine-grained tokens. Give it access to only the repositories the agent should see. Set Contents, Issues and Pull requests to Read-only, plus Actions if you enable that toolset, and switch an area to Read and write only where the agent has to change something. Metadata is added automatically, and no account permissions are needed.
Claude Code, directly. GitHub's install guide uses add-json:
claude mcp add-json github '{"type":"http","url":"https://api.githubcopilot.com/mcp","headers":{"Authorization":"Bearer YOUR_GITHUB_PAT"}}'Add "X-MCP-Toolsets" or "X-MCP-Readonly" to the headers object to change what loads. Where the token ends up and how scopes work is covered in How to add MCP servers to Claude Code.
Cursor, directly. In ~/.cursor/mcp.json:
{
"mcpServers": {
"github": {
"url": "https://api.githubcopilot.com/mcp/",
"headers": {
"Authorization": "Bearer YOUR_GITHUB_PAT"
}
}
}
}More on the file and reloading it is in How to set up MCP servers in Cursor.
Through Statio. Install GitHub from the catalog and paste the token under Credentials. Then grant tools to yourself or to an agent under Permissions. Nothing is granted until you do. The desktop app writes the client config for you (mcphub config claude-code does it for Claude Code). By hand, both clients point at the local proxy with no token in the file:
claude mcp add --transport http github http://127.0.0.1:7777/github/mcpIn Cursor that is "url": "http://127.0.0.1:7777/github/mcp" with no headers. The path uses the server's name in your dashboard. Agents that run without a person need their own identity, which is set up as shown in Connect a client. If tools are missing after connecting, start with How to debug an MCP server that won't connect.
What to hold back
Every write lands under the token owner's name. A comment, an approval or a merge from the agent looks like you did it.
Coding agents. An agent that writes code needs create_branch, push_files and create_pull_request. Hold back merge_pull_request. With Contents set to write, the token can also push to the default branch unless a branch protection rule or ruleset blocks it, so set one up on GitHub's side. Hold back pull_request_review_write too. An approval from it counts as a review by the token owner, and if the agent is working with your token on someone else's pull request, that can meet a required-review rule nobody checked. Keep delete_file and create_repository away from it as well. New repositories are private by default, but the agent can pass private: false, and one push_files call later your code is public.
Triage agents. A bot that sorts incoming issues usually needs issue_read, search_issues, add_issue_comment, and some way to set labels. issue_write is the hard one. The same tool that sets a label also closes issues and marks them as duplicates, and the token permission can't separate the two. If the bot only comments, make add_issue_comment its only write tool. Read-only mode would remove that one too.
Anything that reads public content. search_code, search_issues and the read tools return text written by strangers, which can carry instructions aimed at your agent. Keep write tools away from agents that read untrusted repositories. GitHub's X-MCP-Lockdown header hides public content written by users without push access. GitHub describes it as a best-effort filter that does not change what the token can read or write.
Tools that start other work. assign_copilot_to_issue sets Copilot's coding agent to work on its own pull request. actions_run_trigger, once you enable actions, can run or cancel workflows, which may include your deploys.
Toolsets and read-only mode apply to everyone using that client config. Per-tool grants let one agent comment while another only reads, on the same server. See MCP permissions for how that works, and How to give an AI agent read-only GitHub access for the read-only setup step by step.
Questions
What Statio adds
- You choose which of its tools each agent may call. A tool you hold back is removed from that agent's tool list, and a call to it is refused.
- The credentials stay encrypted in Statio, so they never sit in an agent config file.
- Every call is recorded with the agent that made it, when, how long it took and whether it succeeded.
Lock down your first tool in minutes.
Three MCP servers, one of them hosted, and 10,000 calls a month, free and without a card. If you outgrow it the next plan is $19.
Two steps: create your account, then install the desktop app on each machine that runs an AI client.
- Keys encrypted at rest, never handed to an agent
- Cancel anytime, nothing is deleted
- How Statio handles credentials