Context7 MCP Server

Official

Retrieve version-aware library documentation and code examples with Context7 MCP, using resolve-library-id and query-docs.

Local + remotestdiostreamable-httpTypeScriptMIT★ 32.0k

What is the Context7 MCP Server?

Context7 MCP retrieves library documentation and examples for a coding assistant. It helps when a question depends on a particular framework or package version, such as configuring an API that changed between releases.

Resolve the library before asking for examples

The documented workflow starts with resolve-library-id, then uses query-docs for a specific question. Include the installed version and the behavior you want to implement. Compare the returned example with your project’s dependencies before editing code; a retrieved document is useful evidence, but it does not show that an example has run in your application.

Connect to the documentation service

Upstash provides the @upstash/context7-mcp npm package and the hosted endpoint https://mcp.context7.com/mcp. The local package requires Node.js 18 or later. The current setup guide explains API keys and client-specific authentication, including the setup flow that creates a key. Some older guides mention different tool names, so use the current two-tool reference.

Setup and tool documentation. Explore related MCP servers.

Recorded tools

Check the linked publisher documentation and your connected client's tool list. Names and availability can vary with the server version and account permissions.

ToolWhat it does
resolve-library-idFind the Context7 identifier for a library.
query-docsRetrieve documentation for a library and question.

How to install the Context7 MCP Server

{
  "mcpServers": {
    "context7": {
      "command": "npx",
      "args": [
        "-y",
        "@upstash/context7-mcp"
      ],
      "env": {
        "CONTEXT7_API_KEY": "YOUR_CONTEXT7_API_KEY"
      }
    }
  }
}

Replace the placeholder with your Context7 API key. Hosted client instructions are linked in the README.

Configuration

Node.js 18 or later for the local npm server. Follow Context7’s current setup flow for an API key.

VariableDescriptionRequired
CONTEXT7_API_KEYContext7 API key from the provider’s setup flow.Yes

Example prompts to try

  • “Find the documentation for our installed library version and explain how its pagination API works.”

Frequently asked questions

The current README documents resolve-library-id and query-docs.