Skip to content

Menu

Context7 MCP Server logo

Context7 MCP Server

Published · Updated

At a glance

Category
Code & Git
GitHub repository
upstash/context7
Watch out for
It depends on a hosted service. The server in the repo is a client for Context7's private backend, so it will not work offline.

Context7, from Upstash, fixes a specific and very common problem: models write code against the version of a library they saw in training, which is often a year or more out of date. Context7 keeps an index of current documentation and code examples for a large number of libraries and hands the relevant pieces to your agent when it asks.

In practice you add "use context7" to a prompt, or set up a rule so the agent does it on its own, and the agent pulls documentation for the library and version you are working with before it writes code. It is particularly useful for fast-moving frameworks where APIs get renamed between major versions, which is exactly where models tend to invent methods that no longer exist.

It is worth being clear about what is open source here. The repository holds the MCP server and CLI, but the API backend, parsing engine and crawler are private. The hosted service at mcp.context7.com does the real work, and the documentation in the index is contributed by library owners and the community. Upstash says plainly that it cannot guarantee the accuracy or security of everything listed.

How it connects

Your AI app

An assistant or agent that supports MCP

Context7 MCP Server

Runs as

  • npx (Node.js)
  • Remote (HTTP)

Gives the agent

  • resolve-library-id
  • query-docs
  • Version matching
  • CLI and skills mode

Context7

Signs in with

  • OAuth / browser sign-in
  • API key
Your AI app talks to Context7 MCP Server over the Model Context Protocol, and the server carries out the work. Built from the setup and capability sections on this page.

What it can do

resolve-library-id
Turns a plain name such as "next.js" or "supabase" into a Context7 library ID like /vercel/next.js. It takes your question as well, so it can rank matches by relevance.
query-docs
Fetches documentation and code examples for a library ID and a question. An optional language parameter puts examples in your language first.
Version matching
Mention a version in the prompt, for example Next.js 16, and Context7 tries to match docs for that version instead of the latest.
CLI and skills mode
The same lookups are available through the ctx7 CLI (ctx7 library and ctx7 docs) with a skill that tells the agent when to use it. That avoids loading MCP tool schemas at all.

Setting it up

The quickest route is npx ctx7 setup, which needs Node.js 22.13 or newer. It signs you in with OAuth, creates an API key and installs either the MCP server or the CLI-plus-skill setup for Cursor, Claude Code or opencode. To configure an MCP client by hand, point it at https://mcp.context7.com/mcp and send your key in an Authorization: Bearer header. A free key from the Context7 dashboard is recommended because anonymous use has lower rate limits. If you already know the library, put its ID in the prompt (for example "use library /supabase/supabase") so it can skip the lookup step.

Where each client keeps its MCP config file, and the JSON it expects (cheat sheet)

Where it helps

  • Writing code against a framework that changed its API recently, such as a new routing or middleware model
  • Checking the current signature of an SDK method instead of trusting the model's memory
  • Setting up a library you have never used, with examples from its own documentation
  • Adding a project rule so the agent looks up docs before writing configuration files

Limitations and things to watch

  • It depends on a hosted service. The server in the repo is a client for Context7's private backend, so it will not work offline.
  • Documentation quality varies by library because entries are contributed and crawled; obscure libraries may be missing or thin.
  • Each lookup adds documentation text to the context. On small context windows, several lookups in one session add up.
  • Anonymous use is rate limited, so teams will want a key per developer.

Sources

Written from the project's own documentation, checked November 2026.

How we research: where our facts come from, how often we re-check them, and why no one can pay for a review or a verdict.

Reviews and commentsShow

Reviews

Sign in to leave a review.

Loading reviews…

Comments

Sign in to leave a comment.

Loading comments…