MCP server · an Upstash project · MIT licensed
Stop shipping
hallucinated APIs.
Context7 pulls up-to-date, version-specific documentation straight from the source and injects it into your AI's prompt — so Claude, Cursor and Codex answer with the API that exists today, not the one from a training crawl.
// waiting for a query…
resolve-library-id → query-docs → inject
01 · the problem
Your AI's training data expired.
Models answer from a months-old snapshot of the internet. Libraries don't wait — they ship breaking changes weekly. The result: confident answers about APIs that no longer exist.
express-rate-limit-redis exists on npm;
the model blended express-rate-limit with a store API it invented, and the
RedisStore constructor shown has never existed in any published version.
@upstash/ratelimit docs, fetched by Context7 at prompt time.
02 · how it works
One phrase. Fresh docs in the prompt.
Say use context7 (or set a rule once). Before your agent writes a line,
Context7 resolves the exact library, pulls the current version's docs, and injects them into the context window.
- 1Resolve. Your question is matched against 126,000+ indexed projects — fuzzy names, aliases and versions all land on an exact Context7 ID.
- 2Fetch.
query-docspulls the current, version-matched snippets — parsed, scored and ranked for your specific question. - 3Inject. The docs enter the prompt before generation starts. The model reads the real API, then writes code that compiles.
03 · coverage
A constellation of everything you build with.
Every star below is a real project in the Context7 index — brightness is trust, size is community, drift is the index re-crawling. Search it, tap a star, steal its Context7 ID.
04 · freshness proof
Recency is a score, not a promise.
Every indexed project carries a trust score, a benchmark grade and a last-crawl timestamp. Here are the numbers the index reports right now — from the same snapshot powering the constellation above.
Benchmark = answer quality on real queries · Trust = source authority + crawl health · “updated” = last successful re-index.
05 · clients
Already wired into your editor.
Any MCP-capable client can reach the hosted server at https://mcp.context7.com/mcp.
One CLI command configures the popular ones for you.
06 · install
Thirty seconds to current docs.
# requires Node.js 18+ — authenticates, generates an API key, # and installs the right skill or MCP entry for your agent $ npx ctx7 setup # target a specific agent $ npx ctx7 setup --claude $ npx ctx7 setup --cursor
{ "mcpServers": { "context7": { "type": "http", "url": "https://mcp.context7.com/mcp", "headers": { "Authorization": "Bearer YOUR_API_KEY" } } } }
# no install at all — end any prompt with two words Create a Next.js middleware that checks for a valid JWT in cookies and redirects to /login. use context7 # or pin an exact library and skip resolution Implement auth with Supabase. use library /supabase/supabase
07 · open source
Built in the open, crawled for everyone.
MIT-licensed MCP server and CLI. File an issue, ship a PR, or run the open-source server locally.
github.com ↗ + add docs Your library, in every promptMaintainers submit a repo or docs site; Context7 parses, versions and re-crawls it on every release.
context7.com/add-library ↗ rankings The index, rankedSee which libraries developers query most, and how each scores on benchmark and trust.
context7.com/rankings ↗