Resources / MCP Server Risk Directory / GitHub MCP Server
Is the GitHub MCP Server safe? Risks, permissions and safe setup
Engineering teams using Copilot, Claude or Cursor agents to triage issues, review PRs and edit code across GitHub repos. Here is what an AI agent can do through it, its published vulnerabilities and how to set it up safely.
Baseline risk
- Capabilities: 40 of 40
- Read-plus-exfiltrate: +20
- Hidden instructions (publicly verified): none known
- Third-party publisher: no (official)
Before your own factors: version pinning, number of users and policy coverage. How we score
- Maker
- GitHub
- Publisher
- Official (published by the maker)
- Runs
- Local or remote
- Transport
- stdio, streamable-http
- Authentication
- OAuth via GitHub (remote and local, tokens held in memory) or GitHub personal access token (GITHUB_PERSONAL_ACCESS_TOKEN); GitHub App auth for non-interactive stdio
- Tools
- Not documented as a count
- Built-in limits
- --read-only flag (local) or /readonly URL suffix and X-MCP-Readonly header (remote); --toolsets / GITHUB_TOOLSETS (default: context, repos, issues, pull_requests, users) or X-MCP-Toolsets header and /x/{toolset} URLs; --lockdown-mode / GITHUB_LOCKDOWN_MODE=1 or X-MCP-Lockdown header (best-effort content filter, not a security boundary)
- License
- MIT
- Source
- github.com/github/github-mcp-server
- Last verified
- 2026-11-23
What an agent can do through it
| Tool | Type | What it does |
|---|---|---|
| get_file_contents | Read | Reads files and directories from any repository the token can access, including private repos |
| search_code | Read | Searches code across repositories the token can reach |
| issue_read | Read | Reads issues and comments, which can carry attacker-written text from public repos |
| create_or_update_file | Write | Creates or overwrites a file in a repository (needs repo and workflow scopes) |
| push_files | Write | Pushes multiple files in one commit |
| create_pull_request | Send | Opens a pull request, which can publish content to a public repo |
| merge_pull_request | Write | Merges a pull request (accepts expectedHeadSha as a guard) |
| delete_file | Delete | Deletes a file from a repository |
| delete_repository | Delete | Deletes a repository (needs delete_repo scope) |
| actions_run_trigger | Execute | Triggers GitHub Actions workflow runs (run_workflow method) |
Read-plus-exfiltrate: this server can both read sensitive data and send data out, so a single prompt injection in content the agent reads could move private data to an outside party without any other server involved.
Known vulnerabilities
| ID | Issue | Published | Fixed in |
|---|---|---|---|
| GHSA-pjp5-fpmr-3349 / CVE-2026-48529 Moderate (CVSS 6.0) | Lockdown mode singleton in HTTP server causes cross-user GraphQL client confusion Affected: >= 0.22.0, < 1.1.2. | 2026-06-09 | 1.1.2 |
| GHSA-w4q6-qw23-4rg7 / CVE-2026-47427 High (CVSS 7.5) | Nil Pointer Dereference DoS in completion/complete Handler Affected: 0.33.0 and earlier, and main at time of publication. | 2026-07-20 | See advisory |
Main risks
Prompt injection from public issues, PRs and comments steers the agent
LLM01:2025 Prompt Injection
Tools like issue_read and pull_request_read return text written by anyone who can comment on a public repo. GitHub's own docs describe lockdown mode as a best-effort filter, not a security boundary, so injected instructions can still reach the model.
Private code leaks to a public repo through a write tool
LLM02:2025 Sensitive Information Disclosure
One token can read private repos with get_file_contents and also write to public repos with create_or_update_file or create_pull_request. An injected instruction can chain the two and publish private source or secrets.
Over-scoped token gives the agent destructive powers
ASI03 Identity and Privilege Abuse
With a broad classic PAT or the all toolset, the agent can call delete_repository, merge_pull_request or actions_run_trigger. The server acts with the full privileges of the credential, and lockdown mode does not reduce them.
Agent triggers CI or merges code without review
LLM06:2025 Excessive Agency
actions_run_trigger and merge_pull_request let the model start workflows and land code on protected branches if rules allow it. A bad merge or workflow run can ship code or spend CI minutes with no human in the loop.
Self-hosted HTTP mode bugs affect multi-user deployments
ASI04 Agentic Supply Chain Vulnerabilities
GHSA-pjp5-fpmr-3349 let one user's GraphQL client be reused for other users in lockdown mode, and GHSA-w4q6-qw23-4rg7 let an unauthenticated client crash the server. Unpinned docker images pick up whatever version is current.
How to set it up safely
- Start with --read-only locally, or the /readonly URL suffix or X-MCP-Readonly: true header on the remote server, and add write access only when a task needs it.
- Enable only the toolsets you need with --toolsets or X-MCP-Toolsets (for example repos,issues), never all.
- Use a fine-grained PAT or GitHub App limited to specific repositories, without delete_repo or workflow scopes unless required.
- Turn on --lockdown-mode (GITHUB_LOCKDOWN_MODE=1) when the agent reads public repos, while treating it as a filter, not a boundary.
- Do not give one session access to both private repos and public repos it can write to; use separate tokens per project.
- Pin the docker image to a released tag at or above 1.1.2 instead of the untagged ghcr.io/github/github-mcp-server.
- Keep branch protection and required reviews on default branches so merge_pull_request cannot land unreviewed code.
- In Copilot Business or Enterprise, control use through the MCP servers in Copilot policy.
How we score
Baseline scores use the method from our guide to scoring every MCP server on employee laptops. Score the servers in your own environment with the free MCP Server Risk Checklist.
1. What the server can do (capped at 40)
- Sends messages externally: 15
- Fetches arbitrary URLs: 15
- Writes to code repositories: 15
- Reads and writes databases: 15
- Writes or deletes local files: 10
- Automates a browser: 10
- Reads and writes SaaS data: 10
- Reads local files: 5
- Runs code or commands: 15 (added for this directory)
- Changes cloud infrastructure: 15 (added for this directory)
- Moves money or changes payments: 15 (added for this directory)
2. What we found
- Read-plus-exfiltrate: reads sensitive data and can also send data out: 20
- Hidden instructions in a tool description (publicly verified): 30, and always Critical
- Third-party: not published by the maker of the system it connects to: 10
3. Band
0–24 Low · 25–49 Medium · 50–74 High · 75–100 Critical.
This is a baseline. The full method also adds points for unpinned package versions, how many employees use the server and whether a policy covers it; those depend on your setup, so check them in your own environment.
How AccuroAI helps
The AccuroAI Endpoint Agent finds the MCP servers configured in AI clients on managed devices and lists the tools each local server exposes. Each server gets a risk level with its capabilities, and you can block a server once in the console to enforce the block on every device: Claude Code and Cursor refuse calls to it, and for other clients the agent stops the server process. Tool calls from coding agents can be graded by risk, then allowed, confirmed with the employee or blocked.
MCP security · MCP server inventory · How to red team an MCP server
Questions about the GitHub MCP Server
Is the GitHub MCP Server safe to use?
It can be, with the right setup. At baseline it scores 60 (High) in the AccuroAI method because an agent using it can writes to code repositories, reads and writes saas data, sends messages externally. Limit its scopes or tools, keep a person in the loop for write actions and pin the version you reviewed.
Does the GitHub MCP Server have known vulnerabilities?
Yes. 2 published issues are listed on this page with the affected versions and the fix, as of 2026-11-23. Update to a fixed version and check the maker's advisories before approving a new release.
How do I restrict the GitHub MCP Server?
Use the controls the maker provides: --read-only flag (local) or /readonly URL suffix and X-MCP-Readonly header (remote); --toolsets / GITHUB_TOOLSETS (default: context, repos, issues, pull_requests, users) or X-MCP-Toolsets header and /x/{toolset} URLs; --lockdown-mode / GITHUB_LOCKDOWN_MODE=1 or X-MCP-Lockdown header (best-effort content filter, not a security boundary). Then grant the narrowest token or account, approve the server centrally and block other copies of it.
Related servers
Context7 MCP Server · Git MCP Server (mcp-server-git) · GitLab MCP server · Sentry MCP Server · All servers
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/security/advisories
- https://github.com/github/github-mcp-server/security/advisories/GHSA-pjp5-fpmr-3349
- https://github.com/github/github-mcp-server/security/advisories/GHSA-w4q6-qw23-4rg7
- https://docs.github.com/en/copilot/how-tos/provide-context/use-mcp/use-the-github-mcp-server
Facts were verified on 2026-11-23 against the server’s own repository and documentation and public vulnerability records. Servers change often: check the maker’s latest release notes before approving a new version. This page is general security guidance, not a guarantee about any product.