# Context7 — MCP Server

> Give your AI agent up-to-date, version-specific library docs.

**Source:** https://mcpplaygroundonline.com/mcp-servers/context7  
**Transport:** http  
**Requires auth:** No

---

## What it does

Context7 indexes documentation for thousands of open-source libraries and serves it to a model on demand, pinned to the version you name. The flow is two steps: the agent resolves a plain library name to a Context7 ID, then fetches focused documentation for that ID, optionally narrowed to a topic like "routing" or "migrations". Because the docs are fetched at request time rather than recalled from training data, the model sees the API as it exists today. That is the difference between a working code suggestion and a plausible-looking call to a function that was removed two releases ago.

## Tools exposed

- resolve-library-id — turn a plain library name into a Context7 library ID
- get-library-docs — fetch current documentation for a resolved library ID
- topic filtering — narrow the returned docs to a specific subject area
- token budgeting — cap how much documentation is pulled into context
- version pinning — request docs for a specific release rather than latest

## Example queries you can run

- "Using the latest Next.js docs, show me how to set up a route handler with streaming."
- "What is the current API for Drizzle ORM migrations? Use Context7."
- "Pull the Supabase auth docs and write a sign-in flow that matches the current SDK."
- "Has the Zod API changed for schema refinement? Check the current docs."

## Details

- **Recommended model:** anthropic/claude-sonnet-4.5 — Sonnet 4.5 handles the resolve-then-fetch two-step reliably and uses long documentation payloads well without losing the original coding task.
- **Transport:** http
- **Authentication:** Not required — Works with no key for basic use. A free API key from context7.com/dashboard raises rate limits and is sent as a CONTEXT7_API_KEY header.
- **Hosted endpoint:** https://mcp.context7.com/mcp
- **Official source:** [Context7 — official repository](https://github.com/upstash/context7)

## Frequently asked questions

### What problem does the Context7 MCP server actually solve?

Model training cutoffs. An agent asked to use a fast-moving library will confidently write code against the API it learned during training, which may be several releases out of date. Context7 fetches the current documentation at request time so the model writes against what actually ships today.

### Do I need an API key for Context7 MCP?

No. The hosted server works without one for basic use. A free key from context7.com/dashboard raises your rate limits and is passed as a CONTEXT7_API_KEY header on each request. The remote server also supports OAuth 2.0 for automated token management.

### Why does Context7 need two tool calls to answer one question?

Library names are ambiguous — several projects share a name, and versions matter. resolve-library-id maps a plain name to a specific Context7 ID first, then get-library-docs fetches the documentation for exactly that ID. Splitting the steps is what makes version pinning possible.

### Does Context7 cover private or internal libraries?

The public index covers open-source libraries. Internal packages are not in it, so Context7 complements rather than replaces a docs server pointed at your own repositories.

### How do I test Context7 MCP before adding it to my editor?

Paste https://mcp.context7.com/mcp into the MCP Server Tester to see the tools it exposes, or into MCP Agent Studio to watch a real model resolve a library and pull its docs live — every tool call and response visible, with no install.

---

_Test this server across 40+ models on MCP Playground: https://mcpplaygroundonline.com/mcp-servers/context7 — free, no install._
