Context7 MCP

Up-to-date, version-specific library docs and code examples in your agent's context, via MCP or a CLI plus skill

  • 63,873 ★ on the repository
  • Last commit
  • MIT
MCP serverOfficialEditors’ pick

Extended access

Why this level

  • Sends library queries to an external service
  • Uses an API key
  • Documentation content is community-contributed and not fully vetted
All reasons and checks

upstash/context7

Install

In your terminal, with SkillFoxx CLI

npx skillfoxx add mcp/context7

Detects the agents on your machine, shows the access level and pins the version.

Other ways to install

Access and checks

How we review

Extended accessThe tool runs code or makes network calls and only reads external data.

  • Sends library queries to an external service
  • Uses an API key
  • Documentation content is community-contributed and not fully vetted

This is third-party code. Review the repository files before installing.

What it does

Context7 pulls current documentation and code examples for specific libraries into the prompt so the agent does not rely on stale training data or invent APIs. It runs in two modes: an MCP server with resolve-library-id and query-docs tools, or the ctx7 CLI with a skill that teaches the agent to call library and docs commands. You can name a library ID and version directly in the request.

Who it is for. Developers whose agents often get APIs wrong for fast-moving libraries.

Good fit when

  • You are coding against a new framework version such as Next.js
  • The agent suggests library methods that do not exist
  • You need setup examples for a specific SDK or cloud service

Not a fit when

  • Internal company libraries not in the Context7 index
  • You cannot send queries to an external service

Example request

Create a Next.js middleware that checks for a valid JWT in cookies and redirects unauthenticated users to /login. use context7

MCP

Transport
http
Authentication
API key

Limitations

Context7 documentation is community-contributed and Upstash does not guarantee its accuracy or safety. The API backend, parser and crawler are private; this repo holds only the MCP server. Without an API key rate limits are lower. The ctx7 CLI needs Node.js 18+.

How to disable. Run npx ctx7 remove. If you installed the CLI globally, also run npm uninstall -g ctx7.

FAQ

Do I need an API key?

It is recommended for higher rate limits; a free key is available in the context7.com dashboard. ctx7 setup authenticates via OAuth and generates one.

How do I configure it manually?

Point your MCP client at https://mcp.context7.com/mcp and pass the key in an Authorization: Bearer header.

Discussion

No questions or reviews yet.

An MCP server in one binary: AI reads and edits files across several projects and runs your commands

MCP serverBroad access341Repository stars

An MCP server that turns a large codebase into a semantic feature graph for precise navigation and meaning-based search

MCP serverExtended access2KRepository stars

Docs MCP Server

Grounded Docs MCP Server

A local MCP server that indexes docs from websites, GitHub, npm, PyPI and files and gives the agent version-aware search

MCP serverExtended access1.8KRepository stars

The chub CLI gives an agent curated, versioned API docs by language, keeps local notes and takes ratings; a skill and an MCP server are included

CLIExtended access14KRepository stars
Official

Ref's MCP server: documentation search for APIs and libraries that hands the agent only the relevant parts of pages

MCP serverExtended access1.2KRepository stars

Comparison with similar tools

Entries that share the main search query, and how they differ.

EntryOfficialAuthenticationRepository starsMain difference
Context7 (this entry)yesAPI key63,873
opensrcyes3,027CLI and skill from Vercel Labs
Better Context (btca)no1,155the btca-local skill makes an agent clone library repositories and
Context Hubno13,986the chub CLI gives an agent curated

README in short

Upstash's Context7 addresses outdated and hallucinated APIs in LLM output by injecting current documentation into context. Setup is one command, npx ctx7 setup, with a choice of mode and agent (Cursor, Claude Code, OpenCode). The README suggests naming the library ID and version in prompts and adding a rule to CLAUDE.md or Cursor settings. It documents CLI commands and MCP tools and lists npm packages: the MCP server, CLI, SDK and Vercel AI SDK tools. MIT licensed.

README badge

Original SKILL.md

---
name: find-docs
description: >-
  Retrieves up-to-date documentation, API references, and code examples for any
  developer technology. Use this skill whenever the user asks about a specific
  library, framework, SDK, CLI tool, or cloud service — even for well-known ones
  like React, Next.js, Prisma, Express, Tailwind, Django, or Spring Boot. Your
  training data may not reflect recent API changes or version updates.

  Always use for: API syntax questions, configuration options, version migration
  issues, "how do I" questions mentioning a library name, debugging that involves
  library-specific behavior, setup instructions, and CLI tool usage.

  Use even when you think you know the answer — do not rely on training data
  for API details, signatures, or configuration options as they are frequently
  outdated. Always verify against current docs. Prefer this over web search for
  library documentation and API details.
---

# Documentation Lookup

Retrieve current documentation and code examples for any library using the Context7 CLI.

Run commands with `npx ctx7@latest` so setup always uses the latest CLI without a global install:

```bash
npx ctx7@latest library <name> "<query>"
npx ctx7@latest docs <libraryId> "<query>"
```

Optionally install globally if you prefer a bare `ctx7` command:

```bash
npm install -g ctx7@latest
```

## Workflow

Two-step process: resolve the library name to an ID, then query docs with that ID.

```bash
# Step 1: Resolve library ID
npx ctx7@latest library <name> "<query>"

# Step 2: Query documentation
npx ctx7@latest docs <libraryId> "<query>"
```

You MUST call `library` first to obtain a valid library ID UNLESS the user explicitly provides a library ID in the format `/org/project` or `/org/project/version`.

IMPORTANT: Do not run these commands more than 3 times per question. If you cannot find what you need after 3 attempts, use the best result you have.

## Step 1: Resolve a Library

Resolves a package/product name to a Context7-compatible library ID and returns matching libraries.

```bash
npx ctx7@latest library React "How to clean up useEffect with async operations"
npx ctx7@latest library "Next.js" "How to set up app router with middleware"
npx ctx7@latest library Prisma "How to define one-to-many relations with cascade delete"

Report a problem

Foxx AIContext7
Foxx AI

I am Foxx AI and I have already vetted this tool. Ask about install, setup or anything else, and I will keep it simple.