Labsco
MCP SERVER · OFFICIAL PROJECT

Context7

by upstash

Pull a library's current documentation and code examples into the conversation, so an answer about a framework matches the version you are on.

Framework & SDK Documentation LookupVerified
Summary
The model stops answering from whatever version it was trained on.

Two calls stand between a question and the current documentation: name to library ID, then ID plus question to docs and examples. The second call will not take a bare name, and that refusal is what keeps the answer pinned to a specific library rather than a plausible one.

What it is

A documentation lookup in two steps: `resolve-library-id` turns a package name into a Context7 library ID, and `query-docs` fetches documentation and code examples for that ID against your question. The same index is reachable two ways — as an MCP server, or as a `ctx7` CLI that a skill drives without MCP at all.

What you get
  • A package or product name resolved to the library it means, with the matching candidates returned when the name is ambiguous — `resolve-library-id`
  • Documentation and code examples for a resolved library, narrowed by the question you pass rather than returned whole — `query-docs`
  • The resolution step skipped when you already know the library: name it in the prompt as `/vercel/next.js` or `/mongodb/docs` and the docs load directly
  • A version matched from the prompt, so "Next.js 14 middleware" pulls that version's documentation rather than the newest
  • The same index from the command line — `ctx7 library <name> <query>` to find it, `ctx7 docs <libraryId> <query>` to read it
Requirements

Nothing installed on the fastest path: point your client at `https://mcp.context7.com/mcp` and pass a key as `Authorization: Bearer YOUR_API_KEY`. The key is free from the Context7 dashboard and optional, but it raises the rate limit. `npx ctx7 setup` does the whole thing — OAuth, key generation, and installing either the skill or the MCP server — and needs Node.js 18 or newer. The local package is `@upstash/context7-mcp` over stdio, reading `CONTEXT7_API_KEY`. Library documentation is community-contributed, so accuracy varies by project.

Setup effort

One command — npx -y @upstash/context7-mcp