ISSUE 086  ·  17 NOVEMBER 2026 ELEN RSS
CodeCity
KNOWLEDGE & MEMORY № 0009

Context7 MCP — the assistant reads documentation, it does not remember it

The assistant can sound sure and still hand you a function that no longer exists. Context7 MCP gives it current library documentation at the moment you ask. It is useful because it narrows the gap between what the model remembers and what the library actually says now.

Context7 MCP — ο βοηθός διαβάζει την τεκμηρίωση, δεν τη θυμάται

What it does

You ask for code for a library. The assistant answers with confidence. Only the function it gives you may no longer exist, or the parameters may have changed two releases ago. That is called a hallucination: the assistant produces something that sounds right. It does not do it out of malice. It answers from what it learned during training, and that is old.

Context7 is an MCP server. MCP means model context protocol; in practice, a standard way to connect external tools to the assistant so it can call them on its own. Context7 gives it one thing: up-to-date library documentation, tied to a specific version (documentation).

The idea of use is simple. You write your request normally, and at the end you add the phrase use context7. The assistant finds the library, pulls the right pieces, and answers with code that fits the current version.

It exposes only two tools: resolve-library-id, which finds the library identifier, and query-docs, which fetches the documentation. It works without an API key. With a key, you simply raise the usage limits.

What it does not do

It is not a runner or an execution environment. Context7 brings version-pinned documentation, but it does not run code and it does not verify that the code it shows actually works. When you ask for a fix, debugging, or proof that something works, you will notice the absence of execution steps and automated tests. It does not keep conversation memory for docs; each request fetches the pieces again. It also does not do magic for private repos or unlisted source code — it brings what exists in its base, not what exists inside your network.

The trap is the feeling that “it is solved now.” The documentation in the base is community-maintained, and some entries are incomplete or old. The assistant can ignore context7, or hallucinate again if it does not follow the findings closely. The setup is sensitive — the wrong header name or the wrong file means silent failure. It is a service: it needs network and depends on third parties. We only tested library identification (resolve-library-id) and did not run full documentation retrieval in all clients, so do not assume it will work smoothly in every environment.

Who it is for

For anyone writing code that depends on other libraries. That means almost everyone.

It shines when you work with something that changes quickly: frameworks, SDKs, automation tools.

It makes no sense when you write your own code without external dependencies. There is no documentation to fetch there.

Installation

The easiest route is a tool called ctx7. You run it with npx, the helper that comes with Node.js, without installing anything permanently.

ctx7 makes the connection to Context7, gives you a key, and writes the configuration into the right folder for your assistant. Here it is, with Claude Code as the example:

npx ctx7 setup --claude

The flag changes depending on the assistant. The connection is made with a short code that you open from any device, so it also works on a remote machine.

If you want to set it up by hand, each assistant has its own section below.

Node.js is required on the machine, because everything goes through npx.

Use in each LLM

This is the part that most articles miss. There are two paths: the automatic one, which sets everything with one command, and the manual one, where you write the configuration yourself. I start with the automatic one, then I give the manual one for each assistant.

Claude Code

Automatic setup:

npx ctx7 setup --claude

After installation, a skill takes over and calls Context7 when you ask about a library, without you saying anything.

If you prefer manual setup, with the remote server:

claude mcp add --scope user --header "CONTEXT7_API_KEY: YOUR_API_KEY" --transport http context7 https://mcp.context7.com/mcp

Or with a local server, which downloads the package onto your machine:

claude mcp add --scope user context7 -- npx -y @upstash/context7-mcp --api-key YOUR_API_KEY

There is also a plugin, which connects to the remote server without a key. You enable it from inside Claude Code:

/plugin marketplace add upstash/context7
/plugin install context7@context7-marketplace

Then restart and choose Context7 in /mcp.

Codex CLI

Same logic, different key:

npx ctx7 setup --codex

This writes the configuration into the ~/.codex/config.toml file and into AGENTS.md. Know this: Codex CLI, Codex Desktop, and the editor extension all read the same file, so one setup covers all three.

Manually, from the terminal:

codex mcp add context7 -- npx -y @upstash/context7-mcp --api-key YOUR_API_KEY

If you want to write no key at all, open ~/.codex/config.toml and declare the remote server with the address https://mcp.context7.com/mcp. Also set a wait limit around 20000 milliseconds, because the server is a little slow on first start.

There is also a plugin for Codex:

codex plugin marketplace add upstash/context7
codex plugin add context7@context7-marketplace

Then open a new conversation, so Codex loads the skill and the tools.

Cursor

Cursor has the cleanest path of the three:

npx ctx7 setup --cursor

This installs a skill that calls Context7 on its own. If you prefer a rule, open Cursor, go to settings, then Rules and Commands, and write a line that says to use Context7 every time you ask for library documentation. You can also put it in a .cursorrules file at the project root, so it travels with the code.

Manually, the configuration lives in ~/.cursor/mcp.json for all projects, or in .cursor/mcp.json for one project only. There you declare the server with the address https://mcp.context7.com/mcp and your key in a header named CONTEXT7_API_KEY. Watch the header name; that is where half the failures happen.

Where it wins, where it loses

It wins on the problem it solves. Code based on old data is one of the most expensive mistakes, because it costs time before you understand why it does not run.

It wins on simplicity. Only two tools, no key, and one phrase in your request.

It also wins on maturity. The repository has 62,851 stars, 3,060 forks, and an MIT license, with creation in March 2025 (repository).

It loses on dependency. It is a service, not a file on your disk. It needs network, and the content is maintained by the community, not by the library authors themselves. Not every entry is equal.

It also loses a little in setup. Three assistants, three paths, and on each path a different header name or file. It is easy to put the key in the wrong place and have nothing work, without a clear error message.

Test

We did not set it up from scratch in Claude Code, Codex, or Cursor for this article. I say that first, because that is the honest part.

We do have it set up in our own pipeline, and there it ran a real call. The resolve-library-id tool returned real results. For Serena, a code analysis tool, it returned the identifier /oraios/serena, with 714 code samples, High reputation, and a score of 79,86. In other words, the chain up to the library identification point works, and it works without an API key.

The gaps in the test, named plainly. We did not run the second tool, query-docs. We did not connect Context7 to any of the three assistants for this article. What I write about the per-client steps comes from the documentation, not from hands-on testing here.

Verdict

Context7 hits one of the most annoying problems in assistant-driven coding: hallucinations in library code. It does it with a tool that takes minutes to set up and works without a key.

It is also mature. So many stars do not come from a trick, and the npm package is at version 4.3.0, pointing to the same repository (package).

Its weak point is its own nature: it is a service. If the network or the service goes down, the assistant falls back to memory. And the quality of each entry depends on the community.

If you write code on top of libraries, you will feel the difference on day one. Try it.

Rating: 8.4/10.

See also

Three more from the same category:

Sources:

https://github.com/upstash/context7

https://context7.com/docs

https://context7.com/docs/clients/claude-code

https://context7.com/docs/clients/codex

https://context7.com/docs/clients/cursor

https://www.npmjs.com/package/@upstash/context7-mcp

https://github.com/upstash/context7/releases