AccuroAI
Book a demo

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

60High
  • 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

Writes to code repositories · 15Reads and writes SaaS data · 10Sends messages externally · 15Runs code or commands · 15
ToolTypeWhat it does
get_file_contentsReadReads files and directories from any repository the token can access, including private repos
search_codeReadSearches code across repositories the token can reach
issue_readReadReads issues and comments, which can carry attacker-written text from public repos
create_or_update_fileWriteCreates or overwrites a file in a repository (needs repo and workflow scopes)
push_filesWritePushes multiple files in one commit
create_pull_requestSendOpens a pull request, which can publish content to a public repo
merge_pull_requestWriteMerges a pull request (accepts expectedHeadSha as a guard)
delete_fileDeleteDeletes a file from a repository
delete_repositoryDeleteDeletes a repository (needs delete_repo scope)
actions_run_triggerExecuteTriggers 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

IDIssuePublishedFixed 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-091.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-20See 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

  1. 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.
  2. Enable only the toolsets you need with --toolsets or X-MCP-Toolsets (for example repos,issues), never all.
  3. Use a fine-grained PAT or GitHub App limited to specific repositories, without delete_repo or workflow scopes unless required.
  4. Turn on --lockdown-mode (GITHUB_LOCKDOWN_MODE=1) when the agent reads public repos, while treating it as a filter, not a boundary.
  5. Do not give one session access to both private repos and public repos it can write to; use separate tokens per project.
  6. Pin the docker image to a released tag at or above 1.1.2 instead of the untagged ghcr.io/github/github-mcp-server.
  7. Keep branch protection and required reviews on default branches so merge_pull_request cannot land unreviewed code.
  8. 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.

MCP Security
Find every copy of GitHub MCP Server on your fleet

AccuroAI finds the MCP servers configured in AI clients on managed devices, gives each a risk level and blocks a server across the fleet.

Book a demoStart a free pilot

Finds MCP servers on managed devices · Risk level per server · Block a server across the fleet