Repolode
upstash

upstash/context7

An MCP server and CLI that feed up-to-date, version-specific library docs and code examples into AI coding agents.

Stars
63,345
Forks
3,118
Open issues
52
Last commit
8 hours ago

What is it?

Context7 is a documentation retrieval layer for AI coding agents. When an agent writes code against a library, it often relies on outdated training data and may invent APIs that do not exist. Context7 fetches current documentation and code examples for the specific library version in question and places them into the agent's context.

It can be used in two ways: a CLI with agent skills (the ctx7 command, which needs no MCP setup), or an MCP server that exposes resolve-library-id and query-docs tools to MCP-compatible clients. Users can trigger it by adding "use context7" to a prompt, or by referencing a library ID such as /supabase/supabase directly.

The repository holds the MCP server source code. The API backend, parsing and crawling engines are not included here. Setup is done with npx ctx7 setup, which supports Cursor, Claude Code and OpenCode.

Key features

  • 01Fetches version-specific documentation and code examples for libraries.
  • 02Offers a CLI (ctx7) with agent skills that requires no MCP setup.
  • 03Provides MCP tools resolve-library-id and query-docs for MCP-compatible clients.
  • 04Lets users pin a library by ID or mention a version in the prompt.
  • 05Supports manual setup for 30+ MCP clients via a remote server URL.

Use cases

  • Asking a coding agent to write code against a recent framework release.
  • Getting correct API signatures for libraries with frequent breaking changes.
  • Configuring cloud or infrastructure services with current setup steps.

Quick start

  1. 1

    Run the setup command to authenticate, generate an API key and install the skill

    npx ctx7 setup
  2. 2

    Add a prompt with "use context7" to your coding agent to fetch current docs

Things to know

  • The CLI requires Node.js 22.13 or newer.
  • Higher rate limits require a free API key from context7.com.
  • The backend services are private, so only the MCP server source is open.
  • Library documentation is community-contributed, so its accuracy and completeness are not guaranteed.

Topics

FAQ

What is context7?
An MCP server and CLI that feed up-to-date, version-specific library docs and code examples into AI coding agents. Context7 is a documentation retrieval layer for AI coding agents. When an agent writes code against a library, it often relies on outdated training data and may invent APIs that do not exist. Context7 fetches current documentation and code examples for the specific library version in question and places them into the agent's context.
Is context7 free to use? What license does it have?
context7 is open source under the MIT license. Check the license terms before using it in commercial products.
Is context7 still maintained?
Actively maintained. The last commit to context7 was on Oct 20, 2026.
What can I use context7 for?
Asking a coding agent to write code against a recent framework release. Getting correct API signatures for libraries with frequent breaking changes. Configuring cloud or infrastructure services with current setup steps.
How do I install context7?
Run the setup command to authenticate, generate an API key and install the skill: npx ctx7 setup Add a prompt with "use context7" to your coding agent to fetch current docs
Where can I get context7?
The source code and installation instructions are on GitHub: https://github.com/upstash/context7

Summary generated by AI from the project's README. GitHub stats refresh daily.

Related projects