Skip to main content
plugin official · Anthropic

context7 — Claude Code plugin: what it does, how to install

Connects Claude Code to Context7's hosted MCP server to fetch up-to-date library docs and code examples straight from source repositories.

Install into Claude Code · Plugin marketplace All methods and platforms ↓
/plugin install context7@claude-plugins-official
/plugin marketplace add anthropics/claude-plugins-official
Open on GitHub

What context7 does

The plugin helps Claude Code avoid stale training data and hallucinated APIs by pulling documentation straight from source repositories. It connects directly to Context7's hosted remote MCP server at https://mcp.context7.com/mcp, eliminating the need for local Node.js, npm, or npx.

Two tools handle documentation queries. First, resolve-library-id looks up package identifiers like /vercel/next.js and lists available releases. Next, query-docs fetches documentation passages ranked by relevance to your prompt. You can pin documentation to an exact release by adding the version to the library ID, such as /vercel/next.js/v15.1.8.

Without an API key, queries share the anonymous rate limits. To run on a dedicated plan, generate a key in the Context7 dashboard and export CONTEXT7_API_KEY in your environment before launching Claude Code.

What it helps with

  • pull up-to-date library documentation into Claude Code
  • retrieve code examples directly from repository sources
  • check library IDs and release versions via resolve-library-id
  • avoid API hallucinations without running local Node.js processes

Example prompts for the agent

  • How do I set up authentication in Next.js 15?
  • Show me React Server Components examples
  • What's the Prisma syntax for relations?

How to install context7

Plugin marketplace

/plugin install context7@claude-plugins-official
/plugin marketplace add anthropics/claude-plugins-official

Step by step, with commands for each platform: Claude Code plugins: marketplaces, installing, and building your own

Questions about context7

How to install context7 in Claude Code?

First, register the marketplace by running /plugin marketplace add anthropics/claude-plugins-official. Then install the plugin with /plugin install context7@claude-plugins-official.

What does context7 do?

It connects Claude Code to a remote MCP server that retrieves up-to-date documentation and code samples for specific library versions.

Do I need an API key to use context7?

No, it works anonymously right away under shared rate limits. For your own plan limits, set the CONTEXT7_API_KEY environment variable and restart Claude Code.

Source text

context7 · Apache-2.0
# Context7

[Context7](https://context7.com) solves a common problem with AI coding assistants: outdated training data and hallucinated APIs. Instead of relying on stale knowledge, Context7 fetches current documentation and code examples directly from source repositories.

This plugin connects Claude Code to Context7's hosted remote MCP server (`https://mcp.context7.com/mcp`) — no local Node.js, npm, or npx required.

## Available Tools

- **`resolve-library-id`** — searches for libraries and returns Context7-compatible identifiers (e.g. `/vercel/next.js`) plus available versions.
- **`query-docs`** — fetches documentation for a specific library, ranked by relevance to your question.

## API Key (optional)

Without an API key the plugin connects anonymously and shares the anonymous rate limits. To use your own plan, create an API key in the [Context7 dashboard](https://context7.com/dashboard) and export it as an environment variable before launching Claude Code:

```bash
# e.g. in ~/.zshrc or ~/.bashrc
export CONTEXT7_API_KEY="your-api-key"
```

The plugin's MCP server configuration picks up `CONTEXT7_API_KEY` automatically. Restart Claude Code after setting it, then verify usage in the [dashboard](https://context7.com/dashboard).

## Usage

The plugin works automatically when you ask about libraries:

- "How do I set up authentication in Next.js 15?"
- "Show me React Server Components examples"
- "What's the Prisma syntax for relations?"

To get documentation for a specific version, include the version in the library ID (e.g. `/vercel/next.js/v15.1.8`). The `resolve-library-id` tool returns available versions, so you can pick the one that matches your project.

---

Maintained by [Upstash](https://upstash.com). Source and full plugin (with skills, agents, and commands): [upstash/context7](https://github.com/upstash/context7).

© Upstash · Apache-2.0 · anthropics/claude-plugins-official

Similar plugins

All plugins for Agent setup: memory, context, orchestration →

From the same set123

The whole set →

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor