Context7 logo

Context7

by upstash

Retrieves version-aware library documentation and code examples for AI coding agents through Context7.

Install Context7

Run the project’s own setup commands, in order.

Setup steps from the project

upstash/context7 installs with its own commands rather than a config we can generate, so these are copied as-is. Run them in order in a terminal. Source: github.com

  1. 1. Add to your MCP client
    npx ctx7 setup
    
  2. 2. Install
    npm install -g ctx7
    

Overview

upstash/context7 MCP server connects coding agents to Context7's documentation service, which indexes library documentation and code examples. Its two MCP tools resolve a library name to a Context7-compatible ID and retrieve documentation for that ID. Reach for it when generated code needs current, version-specific API details rather than model training data. It can be configured through the Context7 MCP endpoint or installed with the Context7 CLI setup flow.

Use cases

  • Retrieve current framework documentation before generating code
  • Match a library name to its Context7 identifier
  • Query version-specific API examples
  • Configure an MCP client to fetch library docs
  • Add an automatic documentation lookup rule to a coding agent

Key features

  • Resolves library names to Context7 IDs
  • Queries library documentation and code examples
  • Supports version-aware documentation requests
  • Accepts direct library IDs
  • Provides a streamable MCP endpoint
  • Offers CLI-guided MCP setup

Tools2

What Context7 lets your agent do. Expand a tool for its parameters.

Self-reported~44 tokens of context

Security & health

What it can reach and how reliably it runs — from our own checks, not the maintainer’s claims.

ActiveLast checked Today

Recent health check succeeded.

52/53 checks healthy over the last 90d

Supply-chain signal

No high-severity advisories surfaced by our automated scan.

Critical 0High 0Medium 0Low 0

Scanned 8d ago via OSV.dev

Adoption & maintenance

Factual signals from GitHub, npm, and our automated checks — not a rating.

GitHub stars64kStargazers on the source repository.
Last commit2d agoMost recent push to the default branch.
Tools exposed2Callable tools this server registers over MCP.
Directory activity19 viewsConfig copies, upvotes, and views on AllMCPs.

How Context7 works

What upstash/context7 MCP server does

upstash/context7 MCP server gives AI coding agents access to current, version-aware documentation and code examples from the Context7 service. It is intended for library and framework questions where stale training data, obsolete APIs, or invented methods could lead to incorrect code.

The service covers workflows such as asking for a Next.js proxy, configuring a Cloudflare Worker cache, or checking the Supabase email/password authentication API. Prompts can mention a library version, allowing Context7 to select documentation for that version. A known Context7 library ID can also be included to bypass library matching.

How it works

The MCP interface exposes two documentation tools:

  • resolve-library-id finds a Context7-compatible library ID from a general library name.
  • query-docs retrieves documentation for a library using that Context7 ID.

An agent can first resolve a library and then query its documentation, or use a known ID directly. Context7 IDs use a slash-based format such as /supabase/supabase or /mongodb/docs.

The project supports two operating modes. MCP mode registers the Context7 server so the agent can invoke documentation tools natively. CLI + Skills mode installs a skill that directs the agent to use ctx7 commands instead of MCP. This listing concerns the MCP interface, which is available at https://mcp.context7.com/mcp.

Setup and configuration

The Context7 CLI requires Node.js 22.13 or newer. Running the following command starts the guided setup:

Terminal
npx ctx7 setup

The setup flow authenticates through OAuth, creates an API key, and lets you choose between CLI + Skills and MCP mode. It can target a particular agent with options such as --cursor, --claude, or --opencode.

For manual MCP configuration, add the server URL https://mcp.context7.com/mcp to the client and send the API key in an Authorization: Bearer YOUR_API_KEY header. An API key is recommended for higher rate limits and can be obtained from the Context7 dashboard.

To remove generated setup, run npx ctx7 remove. If the CLI was installed globally, remove that package separately with npm uninstall -g ctx7.

Tools and capabilities

  • Resolve ordinary library names into Context7-compatible identifiers.
  • Retrieve documentation and code examples for a selected library.
  • Match documentation to a requested library version when the version is included in the prompt.
  • Let agents use explicit Context7 library IDs to skip the matching step.
  • Support rules that automatically invoke Context7 for library documentation, setup, configuration, and code-generation questions.

Limitations and notes

Results depend on the documentation available through Context7's indexed library sources. A library ID and version in the prompt can improve targeting. The server is focused on documentation retrieval; the listed MCP tools do not describe general-purpose code execution, file editing, or package management.

Reviews

No reviews yet — be the first to share how it worked for you.

Frequently Asked Questions about Context7

upstash/context7 is an MCP server that connects AI coding agents to Context7's up-to-date library documentation service. Its main tools, resolve-library-id and query-docs, identify libraries and retrieve version-specific documentation and code examples for frameworks, packages, and APIs.

Run `npx ctx7 setup`, authenticate through OAuth, and choose MCP mode. The setup can target Cursor, Claude, or other supported agents. For manual configuration, register `https://mcp.context7.com/mcp` and send the Context7 API key in an Authorization Bearer header.

Yes, Cursor is supported. Use `npx ctx7 setup --cursor` for targeted setup, or configure the Context7 MCP endpoint manually in Cursor with the required authorization header.

Use `resolve-library-id` to find the library's Context7-compatible ID, then call `query-docs` with that ID and a documentation question. If you already know the ID, include it directly, such as `/supabase/supabase`.

Mention the required version in the prompt, such as asking for a Next.js 16 setup. Context7 uses the version request to match the retrieved documentation to that library release.

Related MCP servers

Add a badge to your READMEShow it’s listed — live SVG, Markdown or HTML.

AllMCPs Directory Badge

Full Badge Customizer

Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.

Badge Style:
Live Dynamic SVG PreviewContext7 AllMCPs Directory Badge
Markdown (GitHub README)
[![AllMCPs](https://allmcps.com/api/badge/upstash-context7?style=directory)](https://allmcps.com/mcp/upstash-context7)
HTML Embed
<a href="https://allmcps.com/mcp/upstash-context7"><img src="https://allmcps.com/api/badge/upstash-context7?style=directory" alt="Context7 on AllMCPs" /></a>