Skip to content
Hidden Logic Lab

Official Context7 MCP 4.9.1 defaults to remote documentation lookup only, but official `ctx7 setup` writes an unpinned `@upstash/context7-mcp` stdio entry and fetches skills from GitHub HEAD, retrieved docs are not untrusted-fenced, and a local HTTP listener binds all interfaces while accepting any non-JWT bearer token at the gate

Published

The official Context7 MCP is a first-party Model Context Protocol server that lets a connected AI client resolve a library name to a Context7 library ID and retrieve up-to-date, version-specific documentation and code examples from Context7’s index. Publisher: Upstash, Inc. The public repository is upstash/context7. The npm package operators install for a local server is @upstash/context7-mcp; its bin is context7-mcp (dist/index.js). Official product documentation is at context7.com/docs/installation. The hosted documentation endpoint named in official docs is https://mcp.context7.com/mcp. The official setup and docs CLI is a separate npm package, ctx7. The official Admin MCP, which manages teamspaces, libraries, Docs7 sites, and Ask sites, is a further hosted product at https://admin.mcp.context7.com/mcp. The license is MIT. The repository root LICENSE is the stock MIT text and names “Copyright (c) 2021 Upstash, Inc.”

The repository README states, and we treated as a hard evidence limit, that this repository hosts the MCP server source, and that “the supporting components — API backend, parsing engine, and crawling engine — are private and not part of this release.” Claims about how documentation is crawled, classified, or stored can come only from official public documentation, not from code we can open here. We also cannot prove that the hosted servers at mcp.context7.com or admin.mcp.context7.com run the commit pinned below.

This review pins the latest stable npm latest release of the MCP package at research time, 4.9.1, which matches git tag @upstash/context7-mcp@4.9.1. It is a static review: we cloned the tagged commit, read first-party source and official docs, downloaded the official npm tarballs for the MCP server and for the official ctx7 CLI that the install docs tell people to run, downloaded the official context7.mcpb GitHub Release asset, and checked hashes and registry metadata. We did not run the MCP server, the ctx7 CLI, npx ctx7 setup, npx @upstash/context7-mcp, postinstall hooks, Docker, the mcpb bundle, or any installer. We did not log into Context7, and we used no API key or OAuth token.

What we pinned

  • Git tag @upstash/context7-mcp@4.9.1, a lightweight tag pointing at commit f65b49389be58035d302d854a744f0fd329a1579 (chore(release): version packages (#3954)). The commit date is 27 November 2026, 16:36:10 Asia/Hong_Kong (08:36:10 UTC; the commit itself is dated 11:36:10 +0300). The GitHub Release of the same name was published 27 November 2026, 16:36:51 Asia/Hong_Kong (08:36:51 UTC) by github-actions[bot]. The tag itself is not annotated and carries no tag signature (git cat-file -t '@upstash/context7-mcp@4.9.1' is commit). The pointed-to commit is authored by github-actions[bot] and committed by GitHub <noreply@github.com>; after GitHub’s web-flow public keys were present, git verify-commit reported a good signature from GitHub <noreply@github.com> with fingerprint 9684 79A1 AFF9 27E3 7D1A 566B B569 0EEE BB95 2194. That confirms GitHub’s merge signature, not a maintainer-signed annotated tag. The same commit is also tagged mcpb-v4.9.1.
  • npm package @upstash/context7-mcp@4.9.1, which was still dist-tags.latest when we re-checked the registry on 30 November 2026, 06:21 Asia/Hong_Kong (29 November evening America/New_York). It was published 27 November 2026, 16:38:05 Asia/Hong_Kong (08:38:05 UTC) by npm user fahreddin.ozcan (fahreddin@upstash.com). The package metadata has no gitHead. The official tarball hashes we computed match the registry: sha256 35b00e3a3b72628141f8e74325750063ce19b12339c2907a18ca77011c96ab61, sha1 713cba1946a40345eb81ebd8e3f5a29a9d078184, integrity sha512-SQ5LZJV+RnzwGNqm7DbGtZMAUZgiW8BW2WRboetGnzHm55M0uODHOxB61L3m9voJuON1tfiHWbn6mRVH05Lm4w==. The package carries npm registry signatures with keyid SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U. We did not independently verify those signatures. The registry attestations endpoint for this version returned HTTP 404. That is consistent with .github/workflows/release.yml, which publishes through Changesets and NPM_TOKEN and does not request id-token on the npm publish job or pass --provenance in the workflow text we opened.
  • Official MCP bundle context7.mcpb from GitHub Release mcpb-v4.9.1, published 27 November 2026, 16:37:18 Asia/Hong_Kong (08:37:18 UTC). Downloaded asset sha256 d2238ddfa5a5a6eb51c66d7ced1f1fdef510e7771a41f2124f0f055c626a3d91, sha1 a262676f4120a5e1ca7e31fae6850b5d5b80e474. A zip listing (we did not run the bundle) contains manifest.json version 4.9.1, package.json, icon.png, and server/dist/index.mjs. The manifest lists tools resolve-library-id and query-docs, and an optional CONTEXT7_API_KEY.
  • Official setup CLI ctx7@0.13.1, npm latest at research time, which is the CLI named in official installation docs. Git tag ctx7@0.13.1 is also lightweight and unsigned, and points at a79b264e08bf441ee8f4ef65a27b93783b92d45d (26 November 2026, 23:38:34 Asia/Hong_Kong / 15:38:34 UTC), with the same style of GitHub web-flow commit signature. The GitHub Release was published 26 November 2026, 23:39:23 Asia/Hong_Kong (15:39:23 UTC). npm publication was 26 November 2026, 23:41:56 Asia/Hong_Kong (15:41:56 UTC). Tarball sha256 59fa5ea206df763b204dc67e98bf1458cd05f0f7d5b2ab15b1fb34a0d0d270c0, sha1 180b6378da63f0c35181f6f466d712bb0d471079, integrity sha512-KZkYHp5qPnRwmuecnGpsN50nlvPU3zE/phs0DK4bhGSzsaVBYCtMdM+AaG4Kgr56iG+jEJt4/Tvkh7kRG5Y/4w==. No gitHead, no attestations. packages/cli at the 4.9.1 commit is identical to this tag (git diff was empty), so the CLI source we read in the MCP pin is the 0.13.1 source.
  • Other first-party packages exist in this monorepo pin, including @upstash/context7-sdk@0.7.1, @upstash/context7-tools-ai-sdk@1.0.4, @upstash/context7-opencode@0.2.2, and @upstash/context7-pi@0.2.0. @upstash/context7-admin-mcp@0.1.2 is "private": true and is not on the npm registry. They are not the primary documentation-MCP install path, and we did not review them at the same depth.

Scope

This is a static review of upstash/context7 at f65b49389be58035d302d854a744f0fd329a1579 (tag @upstash/context7-mcp@4.9.1), of official npm tarballs @upstash/context7-mcp@4.9.1 and ctx7@0.13.1, of the official context7.mcpb Release asset, and of official public documentation on context7.com. We read first-party source, tests, workflows, Docker/smithery metadata, registry metadata, and the docs pages listed in the Limits section.

We did not run the server or the setup CLI. We did not rebuild dist/ from TypeScript, so we cannot independently prove that every compiled file was produced from the tagged sources, only that the MCP tarball’s dist/ filenames match packages/mcp/src and that the published tarball hashes match the registry. We cannot prove the hosted MCP or Admin MCP runs this commit.

Verdict

In this pin, the documentation MCP is a remote lookup server. Its default tools send a library name and a query to Context7’s API and return documentation into the model. They do not expose a general local filesystem, and they do not spawn a shell. Experimental tools that search a library’s indexed source, generate an upgrade guide, or submit feedback stay off unless the operator opts in or a signed-in dashboard choice turns them on.

The operational risk that the official install path creates is larger than that default tool list suggests. Official documentation still tells operators, and in get-started.md tells coding agents, to run unpinned npx ctx7@latest setup. For a local stdio install, ctx7 setup --stdio writes npx -y @upstash/context7-mcp with no version. The same setup command, against hosted Context7, fetches the rule and skill files it writes into the client from raw.githubusercontent.com on master and main, not from the CLI version that is running. Default setup without --oauth can also mint a Context7 API key after login and write that key into agent configuration. Retrieved documentation is injected into the model without the untrusted-data fencing that Admin MCP applies to third-party text. If someone runs the local package with --transport http, the process listens on all interfaces by default and will accept any non-JWT bearer token at the HTTP gate, leaving authoritative key checks to the Context7 API, which we did not exercise.

Those are facts about this source and these official docs. They are not a demonstration that a hosted session was taken over, and they are not a claim that Context7’s private index classifier does nothing. We did not run the server.

Architecture and trust boundaries

Operators meet this product on four paths that should not be assumed to share defaults.

  1. The hosted remote documentation server at https://mcp.context7.com/mcp, and the OAuth URL https://mcp.context7.com/mcp/oauth described in Set Up OAuth. Official OAuth documentation says OAuth is only for remote HTTP connections, and that stdio should use an API key instead. server.json in this pin, and many README examples, treat Authorization as optional on /mcp. In source, MCP_AUTH_ENFORCEMENT defaults to required (packages/mcp/src/lib/mcp-http-auth.ts parseMcpAuthMode). We cannot see the hosted process environment, so we cannot say which of those two stories the production endpoint currently follows.
  2. The local npm package @upstash/context7-mcp. packages/mcp/src/index.ts defaults --transport to stdio. An API key may be passed as --api-key or CONTEXT7_API_KEY. The same binary can serve Streamable HTTP with --transport http (default port 3000). Official docs say the local server does not serve teamspace “Skills over MCP”; those are listed only when the hosted server has a team-skills snapshot, which in this source requires MCP_CLIENT_IP_ASSERTION_KEY (packages/mcp/src/index.ts warns when that key is absent).
  3. The official ctx7 CLI. Official CLI documentation says it both fetches library documentation from the terminal and configures Context7 for supported agents. ctx7 setup writes MCP server entries, rules, and skill files. Default scope is global unless --project is passed. Default MCP transport for setup is hosted HTTP unless --stdio is passed.
  4. The official Admin MCP at https://admin.mcp.context7.com/mcp, documented at Context7 Admin MCP. This is not the documentation server. The in-repo package @upstash/context7-admin-mcp is private and unpublished. Treat it as a separate product.

What leaves the machine on the documentation path is the tool arguments plus request metadata, not the user’s raw editor buffer as a matter of protocol. packages/mcp/src/lib/encryption.ts generateHeaders sends X-Context7-Source, X-Context7-Server-Version, optional Authorization: Bearer <apiKey>, optional client IDE/version and transport headers, and, when MCP_CLIENT_IP_ASSERTION_KEY is a 64-hex key, an encrypted mcp-client-ip-assertion. Queries go to CONTEXT7_API_URL or the default https://context7.com/api (packages/mcp/src/lib/constants.ts). Official security overview says original prompts stay with the assistant and Context7 receives “search queries formulated by the MCP client, which is instructed to strip sensitive data before sending them.” That instruction is tool-description text in packages/mcp/src/index.ts. It is not a server-side guarantee that a model will obey it.

Returned documentation, library source excerpts from the experimental code tools, and any teamspace rule text the private backend prepends, go back into the model. The documentation MCP does not wrap that text in untrusted-data fences. Admin MCP does, for tools marked untrusted in packages/admin-mcp/src/tools.ts.

Tools and defaults

packages/mcp/src/lib/tool-names.ts is the catalog. The tools the server can list are:

  • resolve-library-id and query-docs — always the core tools in official experimental-tools documentation. They search and fetch from /v2/libs/search and /v2/context.
  • get-upgrade-guide — experimental. Calls /v2/version-upgrade-guide.
  • submit-docs-feedback — experimental. POSTs /v2/feedback. Official docs say this sends the rating fields, the MCP client name and version, and the account when a key or OAuth is used; they also say the tool does not send the user’s code or files. We did not call it.
  • grep-code, glob-code, read-code, and find-symbol — experimental source-code tools, grouped under the dashboard name code-tools. They call /v2/code for a Context7 library ID and version. CODE_TOOLS_INSTRUCTIONS in packages/mcp/src/lib/code-tools.ts tells the agent to use them on “the library’s source at one version” when that source “is not in the user’s project.”

--experimental, CONTEXT7_EXPERIMENTAL=1, the older CONTEXT7_RESEARCH_PREVIEW=1 / --research-preview / ?research_preview=1 names, or ?experimental=1 on an HTTP URL, turn on every experimental tool and take precedence over the dashboard choice (packages/mcp/src/index.ts, official Experimental Tools docs). Without a flag, a signed-in API key or OAuth token can list the tools turned on at context7.com/dashboard?tab=settings. Without a credential, fetchExperimentalTools returns an empty list.

The local stdio server also attaches a first-party skill resource skill://context7-mcp/SKILL.md (packages/mcp/src/lib/skills.ts). Teamspace skills, when the hosted snapshot is enabled, are fetched by digest and refused if the bytes do not match. Official docs say a teamspace admin can still install a skill that failed Context7’s and skills.sh’s checks with “Install anyway…”, after which later versions of that skill skip those checks.

Admin MCP tools are a different, much larger set: members, libraries, rules, policies, usage, Docs7, Ask, and feedback to the Context7 team. Official docs say billing, API keys, SSO, and teamspace create/delete stay in the dashboard. Destructive Admin MCP actions are marked for client confirmation; packages/admin-mcp/src/confirm.ts uses form elicitation when the client declares it, and otherwise requires a confirm argument that the comment in that file says strong models may fill without asking.

Malware check

This malware check is a static review of first-party source in packages/mcp, packages/cli, and packages/admin-mcp at f65b49389be58035d302d854a744f0fd329a1579, plus the files inside the official @upstash/context7-mcp@4.9.1 and ctx7@0.13.1 tarballs we extracted, plus a zip listing of official context7.mcpb. We looked at package scripts, install hooks, spawned processes, network destinations in first-party code, and unexpected files in the tarballs.

The npm packages declare no postinstall, preinstall, or prepare hooks. The MCP tarball contains dist/, package.json, LICENSE, and README.md, matching its files field. Compiled MCP dist/ stems match the TypeScript sources in packages/mcp/src; there was no extra JavaScript module in the tarball that lacked a corresponding source file. First-party MCP code does not import child_process. The readFileSync uses we opened are for package.json and, optionally, NODE_EXTRA_CA_CERTS. The only first-party child_process.spawn in the CLI/MCP scope we searched is ctx7 upgrade, which runs a package-manager upgrade plan — often a *@latest command the operator can also refuse. The CLI’s open import is used to open a browser during login (packages/cli/src/commands/auth.ts).

No malware was found in that first-party scope. This is not a statement about third-party npm dependencies, about the private backend, about a future latest tarball, or about the hosted servers. Static review cannot give a clean bill of health.

Permissions and data access

On the documentation MCP, the default permission story is: the client may call two read tools that query Context7’s public (and, with a suitable credential, private) documentation index. Rate limits and private-library access depend on the credential, according to official docs. A free account is documented as including 1,000 API calls per month. An API key is documented as optional for higher limits and private repositories; OAuth is documented as the way to sign in without placing a long-lived key in client config, on remote HTTP only.

What a signed-in session can see is a hosted-policy question we could not verify at runtime. Official docs describe teamspace policies that filter libraries, and “Skills over MCP” that serve team-installed skills to every member who connects to the hosted MCP with that teamspace’s OAuth or API key. Teamspace rules, a Pro and Enterprise feature, are prepended to retrieved documentation. Those features are not implemented as local file writes in the MCP package; they are hosted configuration that changes the text the model receives.

submit-docs-feedback, when enabled, is a write to Context7 about a library and a query. The experimental code tools are reads of Context7’s library source index, not of the operator’s disk.

Admin MCP is the path that can change a teamspace. Official docs: a read-only API key can read libraries, rules, policies, usage, and some site metadata; Write access is required to change the teamspace or to read personal data such as members, invitations, Ask questions, and the GitHub account behind a Docs7 build. OAuth is broader in a different way: “One OAuth connection reaches every teamspace you are a member of, with your role in each.” Do not point a general-purpose coding agent at Admin MCP with a write-capable credential if you only wanted documentation lookup.

Network, file, credential, and telemetry risks

Unpinned install is the most concrete supply-chain issue in the official path. packages/mcp/README.md still documents npx -y @upstash/context7-mcp@latest and unpinned @upstash/context7-mcp, including a Smithery one-liner that also uses @smithery/cli@latest (we did not review Smithery). ctx7 setup --stdio writes the unpinned package name. Official get-started.md tells an agent to run npx ctx7@latest setup --<client> --mcp --oauth --yes, to “Write the user’s global configuration, keep their other MCP entries,” and not to wait on a command that needs the user. --yes skips confirmation. That is an intentional, documented config-mutation path, not a hidden hook. A careful pin does not follow it.

The second official mutation is content not bound to the CLI version. packages/cli/src/setup/templates.ts defines GITHUB_RAW_URLS as raw.githubusercontent.com/upstash/context7/master and .../main. For hosted setup, rule and skill files are taken from those branches when the fetch succeeds. Anyone who can change those branches, or who can cause that fetch to be served unexpected text, can change what ctx7 setup writes into Cursor, Claude, VS Code, Codex, and the other agents packages/cli/src/setup/agents.ts knows about, even if the operator ran a hashed ctx7@0.13.1 binary. The bundled fallback exists only when the fetch fails, or for --base-url / on-prem setup.

API keys are easy to leave in the wrong file. Stdio README examples pass --api-key YOUR_API_KEY on the command line, where process listings can see it. Setup without --oauth can write the key into ~/.cursor/mcp.json, ~/.claude.json, VS Code mcp.json, Codex config.toml, and similar paths. The CLI’s own store is more careful: packages/cli/src/utils/auth.ts writes credentials.json under the XDG config dir (~/.config/context7/ by default, with a legacy ~/.context7/) at mode 0o600. Prefer OAuth on the hosted /mcp/oauth endpoint, or an environment variable the client expands, over a key baked into a world-readable JSON file. Official API key docs say keys are shown once, start with ctx7sk-, and can be created with or without Write access; Write access matters for Admin MCP and the management API, not only for documentation.

Local HTTP should be treated as a different deployment than stdio. app.listen(port) does not pass a host, so the default is not loopback. CORS allows any origin. MCP_AUTH_ENFORCEMENT defaults to required, which is better than an open gate, but evaluateMcpAuthentication accepts any non-JWT token as a present API key and leaves real validation to the Context7 API. Combined with a listener on all interfaces, that is a wider local attack surface than stdio. The official Dockerfile goes further: it binds HTTP on 8080, sets OTEL_EXPORTER_PROMETHEUS_HOST=0.0.0.0, and exposes port 9464.

Telemetry is on unless disabled, and the disable flags differ. HTTP-mode MCP may start Prometheus on 127.0.0.1:9464 unless OTEL_SDK_DISABLED=true. We saw no default remote OTLP exporter in first-party MCP code; metrics stay in-process, plus that local scrape endpoint, unless the operator adds OpenTelemetry configuration. The CLI is different: trackEvent posts to /api/v2/cli/events on context7.com, and official docs say CTX7_TELEMETRY_DISABLED stops those events but not the npm update check, unless a custom --base-url is set.

Prompt injection sits at the center of this product’s design, because the product’s job is to pour third-party documentation into a coding agent. Official Data Safety documentation describes a classifier that blocks flagged chunks from the public index. That classifier is not in this repository. The public MCP package does not additionally fence query-docs output. Teamspace rules are designed to be prepended as instructions. Skills over MCP can be installed from public GitHub or skills.sh, and the safety checks can be turned off per skill. Those are reasons to treat Context7 results as untrusted tool output in the client, even when the private backend claims to have screened them. We did not attempt to bypass the classifier.

Who it is for

Context7 MCP is for developers and teams who want a coding agent to look up current library documentation without browsing the web, and who are willing to send those lookup queries to Upstash’s Context7 API. The default documentation path is a reasonable fit for that job, provided the operator pins versions, prefers hosted OAuth over a key in a config file, and treats returned docs as untrusted context.

It is not a local workspace tool. People looking for a server that reads their repo, runs commands, or manages cloud infrastructure are looking at the wrong product — and should not add Admin MCP to the same agent “just in case.” Teams that install Skills over MCP, enable experimental tools, or attach Admin MCP with Write access or a broad OAuth session are expanding the agent’s reach beyond documentation lookup, and should do that deliberately.

How a careful operator would pin and restrict it

We did not run these commands. They are guidance from the artifacts we read, not a live install.

Pin the CLI and the MCP package by version, and prefer a content hash where the client can take one:

# Inspect, do not run setup from @latest
npm view @upstash/context7-mcp@4.9.1 dist.integrity
npm view ctx7@0.13.1 dist.integrity

For a local stdio server, write the version yourself instead of letting ctx7 setup --stdio emit an unpinned specifier. A pinned shape consistent with this package is npx -y @upstash/context7-mcp@4.9.1, or the integrity string above, with the API key supplied from the environment (CONTEXT7_API_KEY) rather than as a --api-key argument. Do not use @latest.

For most coding-agent installs, prefer the hosted OAuth endpoint over a local process, and over a long-lived key in mcp.json:

{
  "mcpServers": {
    "context7": {
      "url": "https://mcp.context7.com/mcp/oauth"
    }
  }
}

Add the server in the client, then complete the client’s own authenticate step. Official OAuth docs say most clients will not authenticate automatically. This still trusts the hosted service and the current deploy on mcp.context7.com, which we cannot pin to f65b493….

If you use ctx7 setup at all, avoid ctx7@latest and --yes until you have read what it will write. Prefer --oauth over the default “login and mint an API key” path. Prefer --project over the global default. After setup, open the written MCP config, rule file, and SKILL.md and check that they match what you expect — especially since rule and skill bodies may have come from GitHub master/main at the moment of setup, not from 0.13.1. Do not run setup against a client list you did not intend; --yes configures detected agents.

Leave experimental tools off unless you need them. Do not append ?experimental=1 or pass --experimental as a habit. Do not enable Skills over MCP, or “Install anyway…”, without reviewing the skill. Do not connect Admin MCP to a general coding agent with a Write-access key or an OAuth session that covers teamspaces you do not want the model to administer.

If you must run --transport http yourself, bind it behind a loopback-only reverse proxy or a firewall; do not assume the “localhost” log line means the socket is loopback-only. Leave MCP_AUTH_ENFORCEMENT at required. Do not run the official Dockerfile’s OTEL_EXPORTER_PROMETHEUS_HOST=0.0.0.0 on a network you do not consider part of the trust boundary. Set OTEL_SDK_DISABLED=true and CTX7_TELEMETRY_DISABLED=1 if you do not want the default metrics and CLI events.

Treat every query-docs (and, if enabled, code-tool) result as untrusted tool output. Official security docs already ask the model not to put secrets in queries; the client should also not follow instructions that appear inside retrieved documentation or teamspace rules without a human check.

Limits of this review

This was a static review of upstash/context7 at f65b49389be58035d302d854a744f0fd329a1579 (tag @upstash/context7-mcp@4.9.1) and of the official npm packages @upstash/context7-mcp@4.9.1 and ctx7@0.13.1, plus the official GitHub Release asset context7.mcpb from tag mcpb-v4.9.1. We read source, official docs (including https://context7.com/docs/installation, https://context7.com/get-started.md, https://context7.com/docs/clients/cli, https://context7.com/docs/howto/oauth, https://context7.com/docs/howto/api-keys, https://context7.com/docs/howto/admin-mcp, https://context7.com/docs/howto/experimental-tools, https://context7.com/docs/howto/skills-over-mcp, https://context7.com/docs/howto/rules, and the security pages under https://context7.com/docs/security), registry metadata, and first-party tests and workflows. We verified the downloaded tarball and mcpb hashes against the registry or against the files we fetched from GitHub.

We did not run the server, the ctx7 CLI, npx, setup, Docker, Smithery, or the mcpb bundle. We did not log into Context7 or either hosted MCP, and we used no credential. We did not rebuild dist/ from TypeScript, so we cannot independently prove that every compiled file was produced from the tagged sources, only that the published MCP tarball’s dist/ layout matches the tagged sources we opened and that the registry hashes match the bytes we downloaded. The packages carry no gitHead and no SLSA attestations we could use as a second binding. We did not independently verify npm registry signatures. We did not audit third-party dependency implementations, the private API, parser, or crawler, or the exact commit the hosted servers run.

No malware was found in that first-party scope. Official install paths still disagree with a careful pin: they use unpinned npx ctx7@latest, unpinned npx @upstash/context7-mcp, and setup-time fetches from GitHub HEAD. The documentation MCP does not fence retrieved text. Local HTTP in this pin is not loopback-only. We did not run the server. This is not a clean bill of health.

More skill reviews

← All skill reviews