Context7

Up-to-date, version-specific library documentation directly in the prompt – against outdated or hallucinated APIs in AI-generated code.

Description

Context7 gives AI coding assistants up-to-date, version-specific documentation for libraries and frameworks directly in the prompt, instead of relying on the model's (often outdated) training knowledge. The service is operated by Upstash.

The server runs as a hosted remote MCP endpoint at mcp.context7.com – no local server installation is needed, only client configuration.

The recommended setup uses the bundled CLI, which connects the client with a generated API key automatically:

npx ctx7 setup

For Claude Code, the target can be specified directly:

npx ctx7 setup --claude

Alternatively, configure it manually in the client's MCP configuration:

{
  "mcpServers": {
    "context7": {
      "url": "https://mcp.context7.com/mcp",
      "env": {
        "CONTEXT7_API_KEY": "YOUR-API-KEY"
      }
    }
  }
}

Without an API key the service works with lower rate limits; a free API key for higher limits can be generated at context7.com/dashboard.

Why up-to-date documentation in the prompt matters

AI language models are trained up to a cutoff date and don't know about library versions released afterward, or they mix up APIs from different versions because both appeared during training. The result is often plausible-looking but incorrect function calls, outdated parameters, or invented methods — a well-known problem with AI-generated code. Context7 addresses this by feeding current, version-specific documentation directly into the prompt on every request, instead of relying on frozen training knowledge. The model no longer has to guess the correct API; it's supplied directly.

How Context7 fits into a workflow

In practice, a simple prompt hint like "use context7" is enough for a compatible coding agent to automatically pull in the matching library documentation before suggesting or changing code. This is especially useful for fast-moving frameworks whose APIs differ significantly between major versions, as well as for less common libraries with little example code in the training material. For teams working with multiple versions of the same dependency, version specificity helps prevent the agent from accidentally suggesting code for a different version than the one actually installed.

Limits and context

Context7 doesn't replace your own quality assurance: the documentation it delivers comes from publicly available sources and should still be reviewed for security-critical code. As a purely remote service, Context7 also depends on the availability of Upstash's infrastructure; if the service goes down, documentation enrichment stops and the agent falls back to working with its training knowledge alone.

Frequently asked questions

Do I need an API key to use Context7? No, the service also works without one, though with lower rate limits. Does Context7 run locally or only remotely? Exclusively remotely via mcp.context7.com; a local server installation is not offered. Which libraries have documentation available? Per the provider, a growing number of common frameworks and libraries, though coverage detail can vary by project.

Requirements

An MCP client with remote MCP support. For the CLI setup (npx ctx7 setup), also Node.js 18 or newer.

Installation instructions

Fastest via npx ctx7 setup, which generates an API key via OAuth and configures the client automatically. Manually, enter the remote URL with API key into the MCP configuration instead (see description).

npx ctx7 setup

Authentication

Optional but recommended: a free API key (environment variable CONTEXT7_API_KEY) for higher rate limits, generated via OAuth through the CLI or manually in the dashboard.

Required access permissions

The client sends library names or identifiers to the remote endpoint and receives documentation excerpts back. No access to local files or your own code unless the client itself includes such content.

Transmitted or stored data

Requests (library names, search terms) pass through Upstash/Context7 servers. With an API key, requests are attributable to that account. Storage details are governed by the provider's privacy policy, which was not separately reviewed at the time of this check.

Security risks

As a remote service outside your own control: availability and response content depend on the provider. The API key should be treated as a secret (environment variable, not in version control). Since documentation content flows into the model's context, it should be treated like any external text, not as trusted instructions.

License and costs

License
MIT
Cost
free

Free to use, even without an API key (with lower rate limits). A free API key for higher limits is available through the dashboard.

Alternatives

Not recorded yet.

At a glance

Provider
Upstash
Status
Official server
Deployment
Remote
Current version
Not recorded yet.
GitHub stars
62,485
Last reviewed
07.09.2026

Repository and documentation

Categories

Supported clients