# upstash/context7 [Health: Active]

**Category:** 🧠 Knowledge & Memory  
**Repository:** https://github.com/upstash/context7  
**GitHub Stars:** 61896  
**npm Downloads (last month):** 159794  
**Views:** 7  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/upstash-context7

## Description
Up-to-date code documentation for LLMs and AI code editors.

## Tools
Capabilities this server exposes over MCP:

- **resolve-library-id** — Resolves a general library name into a Context7-compatible library ID.
- **query-docs** — Retrieves documentation for a library using a Context7-compatible library ID.

## Claude Desktop Quick Installation
Install path detected from listing signals. Uses `npx` (confidence: high):

```json
"mcpServers": {
  "context7": {
    "command": "npx",
    "args": ["-y","ctx7"]
  }
}
```

## Documentation

## What the upstash/context7 MCP server does

The upstash/context7 MCP server provides an MCP interface for retrieving library documentation and code examples for AI-assisted development. It is intended for prompts involving frameworks, packages, APIs, setup instructions, configuration, and code generation where current or version-specific reference material matters.

The server exposes two tools. `resolve-library-id` searches for a library and returns a Context7-compatible identifier. `query-docs` accepts that identifier and a development question, then returns documentation relevant to the request. A typical workflow is to identify a library such as Next.js or Supabase, obtain its Context7 ID, and query that ID with a concrete implementation task.

## How it works

The upstash/context7 MCP server connects an MCP client to Context7's hosted service. Configure the client with `https://mcp.context7.com/mcp`; manual setup passes an API key in an `Authorization: Bearer YOUR_API_KEY` header. The README also describes a CLI-based setup flow, but the MCP mode is the relevant option when the agent should call the tools natively.

Library selection can happen through the resolver tool or through a known Context7 library ID included in the prompt. Supplying an exact ID avoids the matching step. Prompts may also mention a desired library version, allowing Context7 to select documentation for that version when available.

The returned material is placed into the model's context for use in the response. The repository contains the MCP server source, while the API backend, parsing engine, and crawling engine are private components outside the repository.

## Setup and configuration

The documented hosted configuration uses the Context7 MCP URL and an authorization bearer header. An API key is available from the Context7 dashboard at no cost and is recommended for higher rate limits. The setup documentation does not specify a required environment-variable name for the MCP client configuration.

The repository also documents `npx ctx7 setup`, which configures either CLI-plus-skills mode or MCP mode and can target supported agents with flags such as `--cursor`, `--claude`, or `--opencode`. That CLI requires Node.js 18 or newer. Use `npx ctx7 remove` to remove generated setup; a globally installed CLI must be removed separately.

## Tools and capabilities

- Resolve a general library name into a Context7-compatible library ID.
- Rank library matches using both the library name and the user's task or question.
- Retrieve documentation using an exact library ID and a natural-language query.
- Support version-aware documentation requests when a version is specified in the prompt.
- Return code examples and reference material for use in an AI coding workflow.

## Limitations and notes

Context7's indexed documentation is community-contributed, and the project does not guarantee that every entry is accurate, complete, or secure. Library projects listed in the service are maintained by their respective owners. Treat retrieved examples as reference material and verify them against the library's authoritative sources when correctness or security is important.

The upstash/context7 MCP server itself is open source under the MIT license, but the supporting Context7 backend systems are not included in this repository. The README describes a free API key with rate limits, but it does not state a broader service pricing policy.

_Full upstream README: https://allmcps.com/mcp/upstash-context7/readme_

