← All MCP servers
MCP server

Context7

mcp:upstash/context7

Up-to-date docs for AI agents

Verdict
Suspicious

Risky behavior the analysis could not rule out.

Analyzed Oct 26, 2026, 12:55 UTC at 5b623bf
4
findings
high
highest severity
2
threat classes
555
files scanned
2,954/2,954
checks satisfied
0
package advisories

Why this verdict

mcp-server . Suspicious
  • suspicious: finding mcp-server:.:packages/cli/src/commands/setup.ts:320:SUPPLY
  • suspicious: finding mcp-server:.:packages/cli/src/setup/templates.ts:38:PRIVESC
  • suspicious: finding mcp-server:.:packages/cli/src/setup/templates.ts:4:SUPPLY
  • suspicious: finding mcp-server:.:pnpm-lock.yaml:249:SUPPLY
mcp-server packages/admin-mcp No issues found
  • benign: 259 checks satisfied, no findings for mcp-server:packages/admin-mcp
mcp-server packages/mcp No issues found
  • benign: 570 checks satisfied, no findings for mcp-server:packages/mcp
plugin plugins/claude/context7 No issues found
  • benign: 26 checks satisfied, no findings for plugin:plugins/claude/context7
skill packages/opencode/skills/context7-mcp No issues found
  • benign: 21 checks satisfied, no findings for skill:packages/opencode/skills/context7-mcp
skill packages/pi/skills/context7-docs No issues found
  • benign: 13 checks satisfied, no findings for skill:packages/pi/skills/context7-docs
skill plugins/agent-plugins/context7/skills/context7-mcp No issues found
  • benign: 21 checks satisfied, no findings for skill:plugins/agent-plugins/context7/skills/context7-mcp
skill plugins/antigravity/context7/skills/context7-mcp No issues found
  • benign: 21 checks satisfied, no findings for skill:plugins/antigravity/context7/skills/context7-mcp
skill plugins/codex/context7/skills/context7-mcp No issues found
  • benign: 21 checks satisfied, no findings for skill:plugins/codex/context7/skills/context7-mcp
skill plugins/copilot/context7/skills/context7-mcp No issues found
  • benign: 21 checks satisfied, no findings for skill:plugins/copilot/context7/skills/context7-mcp
skill plugins/cursor/context7/skills/context7-mcp No issues found
  • benign: 21 checks satisfied, no findings for skill:plugins/cursor/context7/skills/context7-mcp
skill skills/context7-cli No issues found
  • benign: 45 checks satisfied, no findings for skill:skills/context7-cli
skill skills/context7-mcp No issues found
  • benign: 21 checks satisfied, no findings for skill:skills/context7-mcp
skill skills/find-docs No issues found
  • benign: 33 checks satisfied, no findings for skill:skills/find-docs

Security findings 4

Supply chain

highContextual risklow confidence

The setup command downloads skill files (and rule content via getRuleContent) from a remote source at runtime and installs them into agent skill/rule directories, so agent instructions come from mutable remote content, with bundled fallback.

const files = await fetchSetupSkillFiles("context7-mcp");
conceal:remotevector:code
Counter-argument considered

Skill content is fetched from a mutable GitHub raw branch at runtime and installed into agent skill directories. A bundled fallback exists, but the remote copy is preferred and the fetch is not declared.

Supply chain

highContextual riskmedium confidence

The setup command fetches agent rule and skill instruction content from mutable GitHub raw URLs (master/main branches) at runtime and installs it into the user's agent rules/skills directories, so upstream changes silently alter agent instructions; a bundled fallback exists but the remote copy is preferred.

"https://raw.githubusercontent.com/upstash/context7/master"
conceal:remotevector:code
Counter-argument considered

Rule and skill instruction content is pulled from mutable master/main GitHub raw URLs and preferred over the bundled fallback. Upstream changes would silently alter the agent instructions written into user config.

Privilege escalation

mediumContextual risklow confidence

A rule template written into Codex's AGENTS.md tells the agent to rerun failing Context7 CLI commands outside Codex's default sandbox, steering the agent to bypass sandbox restrictions.

rerun it outside the sandbox instead of retrying inside the sandbox
vector:instruction
Counter-argument considered

A rule written into Codex's agent instructions tells the agent to rerun failing commands outside its sandbox. This is an undeclared instruction that steers sandbox bypass, even though it is scoped to Context7 network errors.

Supply chain

lowContextual risklow confidence

The packages/opencode devDependencies list both the official-looking '@opencode-ai/plugin' and a similarly named '@opencode/plugin', a possible look-alike package that the artifact does not explain.

'@opencode/plugin':
vector:metadata
Counter-argument considered

The lockfile lists a similarly named `@opencode/plugin` next to the official `@opencode-ai/plugin` as a devDependency with no explanation. Nothing shown refutes the look-alike concern, though it is dev-only and no execution chain is shown.

Refuted findings 13

Candidates the review stage examined and rejected, kept for transparency.

Supply chain

highRefutedlow confidence

The Gemini extension manifest launches the MCP server via `npx -y @upstash/context7-mcp` with no version pin, so whatever is current on the registry is fetched and executed at each start, and the API key is passed on the command line.

"args": ["-y", "@upstash/context7-mcp", "--api-key", "${CONTEXT7_API_KEY}"]
Why it was refuted

The unpinned npx launch is the extension's own vendor MCP server, which is its declared core capability. The API key comes from the user-configured env setting for the wrapped service, so no carve-out is exceeded.

Persistence

highRefutedlow confidence

The `ctx7 setup` command writes Context7 rule files or appends sections to agent rule files such as AGENTS.md at dynamic paths. This is an agent control-plane write, but it matches the command's declared purpose of configuring Context7 for coding agents, so it is not concealed.

await writeFile(rulePath, ruleContent, "utf-8");
Why it was refuted

Writing the rule file is the declared purpose of `ctx7 setup`, which is explicitly documented as installing a rule for an agent. The user runs the command, and the file contents are the vendor's Context7 rule.

Persistence

highRefutedlow confidence

The `ctx7 setup` command reads and rewrites per-agent MCP configuration files, including the user's API key, to register the Context7 server. This is an agent control-plane write, but it is the declared purpose of the setup command and the user explicitly runs it.

else await writeJsonConfig(mcpPath, config);
Why it was refuted

Registering the Context7 MCP server in the agent config is the declared core function of `ctx7 setup`. The user runs the command explicitly, and only a Context7 entry is merged in.

Code execution

highRefutedlow confidence

The upgrade command spawns a command and arguments taken from an upgrade plan (with shell enabled on Windows), run after a confirmation prompt or --yes; the plan's origin is in another file.

const child = spawn(command, args, {
Why it was refuted

The spawn is the declared core capability of the `ctx7 upgrade` subcommand, which is user-invoked and shows the exact command before running it. It runs only after a confirmation prompt or an explicit --yes. The D7 'contradiction' comes from an agent rule about question handling and has no bearing on this CLI feature. The plan's origin file was not shown, but nothing shown makes the spawn concealed or agent-directed.

Persistence

highRefutedlow confidence

The setup CLI's patchTomlStdioApiKey edits an existing agent MCP TOML config in place and writes the user's Context7 API key into the server's args, a control-plane write that is the setup command's declared purpose and only affects a Context7 stdio entry.

await writeFile(filePath, content, "utf-8");
Why it was refuted

The function only patches the `args` of an existing Context7 stdio entry as part of the declared setup flow. It preserves every other byte and refuses to edit non-Context7 entries.

Supply chain

highRefutedlow confidence

The rules file instructs the agent to run the CLI via `npx ctx7@latest`, which fetches and executes whatever the latest published package version is at runtime rather than a pinned version; this is the vendor's own CLI, so the risk is limited.

npx ctx7@latest library <name>
Why it was refuted

The rule invokes the vendor's own ctx7 CLI via npx, which is the declared core capability of the rule. The CLI is the product the rule exists to use.

Persistence

highRefutedlow confidence

The documented `ctx7 setup` command writes MCP server entries, rule files, and skills into the agent's control-plane config (.mcp.json, .cursor/mcp.json, skills dirs), and `--yes` skips confirmation; this is the declared core purpose of the tool but modifies agent configuration.

MCP server entry in the agent's config file (`.mcp.json` for Claude, `.cursor/mcp.json` for Cursor, `.opencode.json` for OpenCode)
Why it was refuted

The skill openly documents `ctx7 setup` writing MCP entries as its declared core purpose of configuring Context7. The user chooses to run it.

Persistence

highRefutedlow confidence

ctx7 setup writes MCP config entries, a rule file that steers the agent, and skills into the agent's control-plane directories; this is the declared core purpose but is still an agent-config write.

A Context7 rule file instructing the agent to use Context7 for library docs
Why it was refuted

The rule file and skills written by setup are the documented, declared core purpose of the command. The `--yes` flag only skips setup prompts that the user opted into by running the command.

Supply chain

mediumRefutedlow confidence

Generated stdio MCP configs run an unpinned package via `npx -y @upstash/context7-mcp`, so whatever is latest on the registry executes inside the user's agent without version pinning.

const args = ["-y", STDIO_PACKAGE];
Why it was refuted

The unpinned npx entry runs the vendor's own MCP package, which is the declared core capability of the setup tooling. setup.ts also preserves any user pin already present.

Supply chain

mediumRefutedlow confidence

The pi package declares wildcard (`*`) peer dependency ranges for @earendil-works/pi-coding-agent and typebox, leaving host-resolved versions unpinned; this is a common peer-dependency convention for host-provided packages and is low risk.

"@earendil-works/pi-coding-agent": "*",
Why it was refuted

Wildcard peerDependencies on host-provided packages are a normal convention and do not install anything themselves. The pi package's own devDependencies are pinned by the lockfile.

Supply chain

mediumRefutedlow confidence

The server shows an elicitation dialog telling the user to run an unpinned `npx ctx7 setup ... -y` command, which fetches and runs remote code and writes credentials into MCP client config; the server does not run it itself and the user must act.

`npx ctx7 setup ${flag} --mcp${transportFlag} -y`
Why it was refuted

The command is only displayed to the human in an elicitation dialog, and the server never runs it. The code comment states this explicitly, so there is no source-to-sink chain.

Supply chain

mediumRefutedlow confidence

The skill tells the agent to globally install the ctx7 npm package at the unpinned @latest tag before running commands, so whatever is published at that tag runs on the host.

npm install -g ctx7@latest
Why it was refuted

A fenced install of the vendor's own CLI is the skill's declared core capability and a vendor installer in install docs. The skill is the usage guide for that CLI.

Supply chain

mediumRefutedlow confidence

The skill instructs the agent to run the CLI via `npx ctx7@latest`, which fetches and executes the newest published package on each run without a pinned version; this is the skill's declared mechanism and the vendor's own CLI.

Run commands with `npx ctx7@latest` so setup always uses the latest CLI without a global install:
Why it was refuted

The `npx ctx7@latest` invocation is the skill's declared, openly stated mechanism: the vendor's own CLI from the official npm registry. It is the core capability of a documentation-lookup skill and falls under the pinned/official-registry and vendor-installer carve-outs. Using @latest is a version-floating choice, not a concealed or contradicting behavior, and nothing in the artifact hides it.

Coverage gaps 2

Parts of the artifact the static analysis could not fully examine.

parse_error tree-sitter typescript parse has errors; extraction may be partial
packages/sdk/src/client.ts
no_tools_extracted MCP server target with no statically extractable tools/prompts/resources
server.json