Resources / MCP Server Risk Directory / Context7 MCP Server
Is the Context7 MCP Server safe? Risks, permissions and safe setup
Developers using Cursor, Claude Code or Copilot who want current library documentation pulled into the agent's context. Here is what an AI agent can do through it, its published vulnerabilities and how to set it up safely.
Baseline risk
- Capabilities: 0 of 40
- Read-plus-exfiltrate: no
- 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
- Upstash
- Publisher
- Official (published by the maker)
- Runs
- Local or remote
- Transport
- stdio, streamable-http
- Authentication
- API key (Authorization: Bearer or --api-key) or OAuth via https://mcp.context7.com/mcp/oauth for remote HTTP clients
- Tools
- 2
- License
- MIT
- Source
- github.com/upstash/context7
- Last verified
- 2026-11-23
What an agent can do through it
| Tool | Type | What it does |
|---|---|---|
| resolve-library-id | Read | Resolves a library name into a Context7-compatible library ID |
| query-docs | Network | Returns documentation for a library ID from Context7's community-contributed index |
Known vulnerabilities
| ID | Issue | Published | Fixed in |
|---|---|---|---|
| CVE-2026-75130 CVSS 3.1 9.0 Critical; CVSS 4.0 6.4 Medium (VulnCheck) | Context7 prompt injection via Custom AI Instructions (ContextCrush) Affected: Context7 through 2.1.2 per the CVE record; Upstash says the flaw was server-side and affected all npm package versions. | 2026-08-18 | Server-side fix deployed 2026-02-23 (per Upstash); the CVE record lists no fixed version |
Main risks
Community-contributed docs and rules inject instructions into coding agents
LLM01:2025 Prompt Injection
CVE-2026-75130 (ContextCrush) showed library owners could plant Custom Rules that were served verbatim to every agent querying that library, telling it to read .env files and delete files. Upstash now screens rules, titles and descriptions, but returned docs are still third-party content.
Poisoned documentation as a supply chain vector
ASI04 Agentic Supply Chain Vulnerabilities
The README says Context7 projects are community-contributed and Upstash cannot guarantee their accuracy or security. A malicious or hijacked library entry can steer agents toward unsafe code or packages.
Agent acts on docs with other powerful tools
ASI01 Agent Goal Hijack
Context7 itself only returns text, but it is usually paired with shell, file and git tools in coding agents. Injected docs can redirect the agent's goal to running commands those other tools allow.
Queries reveal what you are building
LLM02:2025 Sensitive Information Disclosure
query-docs sends the agent's query text to Context7's hosted backend, which is private and not in the repo. Queries may include internal code or project details.
How to set it up safely
- Require confirmation before the agent runs shell commands, deletes files or makes network requests, as Upstash recommends after ContextCrush.
- Keep secrets out of plaintext .env files in directories the agent can read.
- Prefer the remote server with OAuth (https://mcp.context7.com/mcp/oauth) so no API key sits in local config.
- If you run it locally, pin the package (npx -y @upstash/context7-mcp@<version>) instead of the unversioned or @latest examples.
- Restrict which libraries the agent pulls docs for, ideally an allowlist of known library IDs.
- Report suspicious library content with the Report button on the Context7 project page.
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 Context7 MCP Server
Is the Context7 MCP Server safe to use?
It can be, with the right setup. At baseline it scores 0 (Low) in the AccuroAI method because an agent using it can reach the data it exposes. Limit its scopes or tools, keep a person in the loop for write actions and pin the version you reviewed.
Does the Context7 MCP Server have known vulnerabilities?
Yes. 1 published issue is 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 Context7 MCP Server?
Grant the narrowest token, account or directory it needs, approve the server centrally, pin the version you reviewed and require confirmation for actions that write, send or delete.
Related servers
Git MCP Server (mcp-server-git) · GitHub MCP Server · GitLab MCP server · Sentry MCP Server · All servers
Sources
- https://github.com/upstash/context7
- https://context7.com/docs/resources/all-clients
- https://context7.com/guides/contextcrush
- https://nvd.nist.gov/vuln/detail/CVE-2026-75130
- https://services.nvd.nist.gov/rest/json/cves/2.0?cveId=CVE-2026-75130
- https://github.com/upstash/context7/security/advisories
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.