Files
upstash__context7/plugins/claude/context7/README.md
T
Enes Gules 21c3dd464e feat(mcp): authenticate and track Claude Code plugin (#3028)
* feat(mcp): require auth on /mcp when client is a plugin

Plugin hosts such as Claude Code only start OAuth for servers that 401 at
connect time. Matching Exa MCP, ?client=claude-code-plugin (any client
value containing "plugin") now gates /mcp the same way /mcp/oauth does,
while anonymous access on the public URL is unchanged.

Co-authored-by: Enes Gules <enesgules@users.noreply.github.com>

* chore(mcp): drop the SDK OAuth-helpers TODO

The v2 helpers (bearerAuthChallengeResponse, oauthMetadataResponse) assume
Bearer-only OAuth on a fetch() handler. This server also accepts API keys,
mixes anonymous and required routes, returns JSON-RPC 401 bodies, and
proxies authorization-server metadata live, so they are not a drop-in.

Co-authored-by: Enes Gules <enesgules@users.noreply.github.com>

* docs: keep the plugin client auth gate out of user-facing docs

The ?client=claude-code-plugin gate stays in the server and Claude plugin
URL. OAuth docs continue to describe /mcp/oauth only.

Co-authored-by: Enes Gules <enesgules@users.noreply.github.com>

* simplify Claude plugin auth tracking

* separate plugin and client metrics

* extract plugin request detection

* simplify MCP request handling

* extract authentication policy

* use OAuth for Claude Code plugin

* support API key or OAuth in Claude plugin

* simplify Claude plugin authentication

---------

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: Enes Gules <enesgules@users.noreply.github.com>
Co-authored-by: Fahreddin Özcan <ozcanfahrettinn@gmail.com>
2026-09-04 11:44:54 +03:00

2.3 KiB

Context7 Plugin for Claude Code

Context7 solves a common problem with AI coding assistants: outdated training data and hallucinated APIs. Instead of relying on stale knowledge, Context7 fetches current documentation directly from source repositories.

What's Included

This plugin provides:

  • MCP Server - Connects Claude Code to Context7's documentation service
  • Skills - Auto-triggers documentation lookups when you ask about libraries
  • Agents - A dedicated docs-researcher agent for focused lookups
  • Commands - /context7:docs for manual documentation queries

Installation

Add the marketplace and install the plugin:

claude plugin marketplace add upstash/context7
claude plugin install context7@context7-marketplace

Authentication

After installing the plugin, restart Claude Code and run:

/mcp

Select Context7 and follow the browser sign-in flow. No API key is required.

To use an API key instead, set CONTEXT7_API_KEY before starting Claude Code. The plugin sends the key only when it is present; otherwise it uses OAuth.

Available Tools

resolve-library-id

Searches for libraries and returns Context7-compatible identifiers.

Input: "next.js"
Output: { id: "/vercel/next.js", name: "Next.js", versions: ["v15.1.8", "v14.2.0", ...] }

query-docs

Fetches documentation for a specific library, ranked by relevance to your question.

Input: { libraryId: "/vercel/next.js", query: "app router middleware" }
Output: Relevant documentation snippets with code examples

Usage Examples

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?"

For manual lookups, use the command:

/context7:docs next.js app router
/context7:docs /vercel/next.js/v15.1.8 middleware

Or spawn the docs-researcher agent when you want to keep your main context clean:

spawn docs-researcher to look up Supabase auth methods

Version Pinning

To get documentation for a specific version, include the version in the library ID:

/vercel/next.js/v15.1.8
/supabase/supabase/v2.45.0

The resolve-library-id tool returns available versions, so you can pick the one that matches your project.