Context7

by @upstash

Context7 MCP Server

Context7 retrieves current library documentation and code examples for AI coding assistants. It supports MCP tools or a CLI-and-skills workflow, with library IDs and version-aware requests helping narrow the documentation context.

Developer Tools63,226nodeMIT

Server facts

Context7 MCP Server

GitHub stars

63,226

Last commit

Oct 17, 2026

Runtime

node

License

MIT

Project

Author
upstash
License
MIT

Tech

Runtime
node
Transports
stdio
Remote access
No

Activity

GitHub stars
63,226
Last commit
Data as of

Tags

  • Code Examples
  • Coding Agents
  • Documentation
  • Library Lookup
  • Version Specific

Overview

Context7 supplies coding assistants with library documentation and examples retrieved for the task at hand. It is intended to address the mismatch between a model's training knowledge and a project's current APIs or package versions. Users can request documentation through an ordinary prompt, identify a library directly with its Context7 ID, or mention a desired version. The MCP interface separates library resolution from documentation retrieval: one tool finds the correct identifier, and another queries relevant material for that library. This gives assistants a documented retrieval route instead of relying exclusively on recalled API usage.

The platform also offers a CLI and skills mode that does not require MCP. Its setup command runs through npx, requires Node.js 18 or later, authenticates with OAuth, creates an API key, and installs the selected integration. Manual MCP configuration uses a hosted endpoint and an API-key header; a free key is recommended for higher limits. The README provides client guidance and instructions for automatically invoking documentation retrieval on library-related tasks. It also sets important boundaries: listed documentation is community-contributed and is not guaranteed complete, accurate, or secure. Only the MCP server source is in this repository; the API backend, parser, and crawler are private. Those distinctions matter for anyone expecting a fully self-contained documentation platform.

Install & configure

Requirements

  • Node.js 18 or later for the setup CLI
  • A compatible coding agent or MCP client
Documented launch / install command
npx ctx7 setup

This is a setup command, not a persistent server launch. Choose MCP mode during setup. Manual HTTP configuration passes a key in the CONTEXT7_API_KEY header, not an environment variable. A free API key is recommended for higher limits.

Config file · macOS: ~/Library/Application Support/Claude/claude_desktop_config.json

Windows: %APPDATA%\Claude\claude_desktop_config.json

Use Settings → Developer → Edit Config when available. Do not assume a Linux configuration path; check the client documentation for your platform. Remote servers use the app’s connector flow when supported, not the local stdio file shown here. Merge this example with existing settings; do not overwrite unrelated servers.

A supported configuration example is not available for this client and transport. Check the client documentation for its connection flow; do not substitute an undocumented JSON format.

Read the Claude Desktop setup guide

Config file · Project: .cursor/mcp.json

User: ~/.cursor/mcp.json

The project path is relative to the workspace root. The tilde denotes your user home directory. Use Cursor’s MCP settings to confirm which configuration and scope your installed version is reading. Merge this example with existing settings; do not overwrite unrelated servers.

Cursor configuration
{
  "mcpServers": {
    "context7-mcp": {
      "url": "https://mcp.context7.com/mcp"
    }
  }
}

Read the Cursor setup guide

Config file · Workspace: .vscode/mcp.json

For user scope, use the “MCP: Open User Configuration” command if available. Do not guess a user configuration path across operating systems, profiles, containers, or remote workspaces; check the client documentation. Merge this example with existing settings; do not overwrite unrelated servers.

VS Code configuration
{
  "servers": {
    "context7-mcp": {
      "type": "http",
      "url": "https://mcp.context7.com/mcp"
    }
  }
}

Read the VS Code setup guide

Config file · macOS/Linux: ~/.codeium/windsurf/mcp_config.json

Windows: %USERPROFILE%\.codeium\windsurf\mcp_config.json

Open the MCP configuration through Windsurf’s settings when possible to confirm the active file. Paths can differ in managed or future releases; check the client documentation if this location is not present. Merge this example with existing settings; do not overwrite unrelated servers.

Windsurf configuration
{
  "mcpServers": {
    "context7-mcp": {
      "serverUrl": "https://mcp.context7.com/mcp"
    }
  }
}

Read the Windsurf setup guide

Config file · Project scope: .mcp.json at the repository root

The project file uses mcpServers. For user scope, use claude mcp add --scope user rather than assuming .mcp.json in your home directory is the user configuration. Check the client documentation for managed settings and storage details. Merge this example with existing settings; do not overwrite unrelated servers.

Claude Code configuration
{
  "mcpServers": {
    "context7-mcp": {
      "type": "http",
      "url": "https://mcp.context7.com/mcp"
    }
  }
}

Read the Claude Code setup guide

Examples are translated from the published configuration. Supply your own credentials and verify requirements in the upstream README. Remote connectors are shown only where a supported configuration format is known.

Tools

Source: repository README. Tool descriptions are a documented snapshot, not a live capability check.

ToolWhat it does
resolve-library-idMatch a library name and task to a Context7 library identifier.
query-docsRetrieve task-relevant documentation for an exact Context7 library ID.

Use cases

  • Retrieve library-specific API documentation while generating code.
  • Find examples for a particular framework or package version.
  • Resolve an ambiguous library name to a Context7 identifier.
  • Configure an agent to fetch documentation automatically for library questions.

Strengths

  • Supports version-aware documentation and code examples.
  • Offers both MCP tools and a CLI-and-skills mode.
  • Allows direct library IDs to skip library matching.

Limitations

  • Community-contributed documentation is not guaranteed accurate, complete, or secure.
  • The backend, parsing engine, and crawler are not included in the repository.
  • Higher rate limits are tied to using an API key.

Context7 setup notes

  • Context7's example uses http, while its catalog transports are stdio; use the example's connection type.

Frequently asked questions

Yes. The README says to mention the library version in the prompt so Context7 can match it.

Related MCP servers