Context7 MCP server for AI agents

Live

API KEY

LIBRARY DOCS

AI

Context7 MCP gives your agent up-to-date library docs: resolve a package name to a Context7 library ID, then query its documentation and code examples.

  • Per-user credentials: each call uses the actual user's API key, never a shared bot.
  • Encrypted per-tenant vault: AES-256, resolved at request time, never in LLM context.
  • Scoped before every call: pre-call scope check, 90-day SIEM-exportable audit chain.
Context7 MCP
agent · Acme Q3
Run
Show me how to clean up a subscription in a React useEffect.
S
context7mcp_query_docs
212ms
Coding agent
Return a cleanup function from the effect that unsubscribes. The React docs include 3 matching examples, including a chat connection that disconnects on cleanup.
Sources: React docs, 3 code examples
context7mcp
3 examples
18:29
Message Claude...

Tools your coding agent reaches for on Context7, scoped per user.

CALL ANY TOOL
2 read-only tools for library docs: resolve a library name to its Context7 ID, then query current documentation and code examples for that library.
context7mcp_query_docs
Query docs
Retrieves and queries up-to-date documentation and code examples from Context7 for any programming library or framework. You must call 'Resolve Context7 Library ID' tool first to obtain the exact Context7-compatible library ID required to use this tool, UNLESS the user explicitly provides a library ID in the format '/org/project' or '/org/project/version' in their query. Do not call this tool more than 3 times per question.
Parameters
Name
Type
Required
Description
libraryId
string
Required
Exact Context7-compatible library ID (e.g., '/mongodb/docs', '/vercel/next.js', '/supabase/supabase', '/vercel/next.js/v14.3.0-canary.87') retrieved from 'resolve-library-id' or directly from user query in the format '/org/project' or '/org/project/version'.
query
string
Required
What to look up in the library's documentation, scoped to a single concept. Be specific and include relevant details, but keep each query to one topic, if the user's question spans multiple distinct concepts, make a separate call per concept instead of combining them, unless the question is about how the concepts interact. Good: 'How to set up authentication with JWT in Express.js' or 'React useEffect cleanup function examples'. Bad (too vague): 'auth' or 'hooks'. Bad (too broad): 'routing and auth and caching in Next.js'. The query is sent to the Context7 API for processing. Do not include any sensitive or confidential information such as API keys, passwords, credentials, personal data, or proprietary code in your query. Also accepts `schema_version` and `tool_version` to pin a version.
context7mcp_resolve_library_id
Resolve library id
Build your Agent
Same auth pattern across LangChain, OpenAI, Anthropic, and Google ADK.
Python · LlamaIndex
import { ScalekitClient } from "@scalekit-sdk/node";
import { createReactAgent } from "@langchain/langgraph/prebuilt";

const sk = new ScalekitClient(env.SCALEKIT_ENV_URL, env.SCALEKIT_CLIENT_ID, env.SCALEKIT_CLIENT_SECRET);

// Context7 MCP tools scoped to this user
const { tools } = await sk.tools.listScopedTools("user_123", {
  filter: { connectionNames: ["context7mcp"], toolNames: [
    "context7mcp_resolve_library_id",
    "context7mcp_query_docs"] },
  pageSize: 100,
});

const agent = createReactAgent({ llm, tools });
await agent.invoke({ messages: [{ role: "user", content: "Show me how to clean up a subscription in a React useEffect" }] });
import OpenAI from "openai";
import { ScalekitClient } from "@scalekit-sdk/node";

const sk = new ScalekitClient(env.SCALEKIT_ENV_URL, env.SCALEKIT_CLIENT_ID, env.SCALEKIT_CLIENT_SECRET);
const openai = new OpenAI();

const { tools } = await sk.tools.listScopedTools("user_123", {
  filter: { connectionNames: ["context7mcp"] }, pageSize: 100,
});

const res = await openai.chat.completions.create({
  model: "gpt-5",
  messages: [{ role: "user", content: "Show me how to clean up a subscription in a React useEffect" }],
  tools,
});

// Execute the tool call with the user's vaulted Context7 API key
await sk.tools.executeTool(res.choices[0].message.tool_calls[0], "user_123");
import Anthropic from "@anthropic-ai/sdk";
import { ScalekitClient } from "@scalekit-sdk/node";

const sk = new ScalekitClient(env.SCALEKIT_ENV_URL, env.SCALEKIT_CLIENT_ID, env.SCALEKIT_CLIENT_SECRET);
const anthropic = new Anthropic();

const { tools } = await sk.tools.listScopedTools("user_123", {
  filter: { connectionNames: ["context7mcp"] }, pageSize: 100,
});

const msg = await anthropic.messages.create({
  model: "claude-sonnet-5",
  max_tokens: 1024,
  messages: [{ role: "user", content: "Show me how to clean up a subscription in a React useEffect" }],
  tools,
});

// Tool call runs with the user's vaulted Context7 API key
await sk.tools.executeTool(msg.content, "user_123");
import { Agent } from "@google/adk/agents";
import { ScalekitClient } from "@scalekit-sdk/node";

const sk = new ScalekitClient(env.SCALEKIT_ENV_URL, env.SCALEKIT_CLIENT_ID, env.SCALEKIT_CLIENT_SECRET);

const { tools } = await sk.tools.listScopedTools("user_123", {
  filter: { connectionNames: ["context7mcp"] }, pageSize: 100,
});

const agent = new Agent({
  name: "coding_agent",
  model: "gemini-2.5-pro",
  instruction: "Context7 MCP tools scoped to this user",
  tools,
});

await agent.run("Show me how to clean up a subscription in a React useEffect");
Try these prompts
Copy any prompt into your agent. Each maps directly to a Context7 MCP tool. Click to copy, paste into your agent, done.
Find a library
Copy the prompt
Copied
Find the Context7 library ID for Next.js.
Copy the prompt
Copied
Which Context7 library matches Supabase, and which versions are listed?
Copy the prompt
Copied
Resolve Three.js to a Context7 library ID.
Query docs
Copy the prompt
Copied
How do I set up authentication with JWT in Express.js?
Copy the prompt
Copied
Show React useEffect cleanup function examples.
Copy the prompt
Copied
How do I create an index with the MongoDB docs?
Version-specific answers
Copy the prompt
Copied
Look up how middleware works in the Next.js 14 docs.
Copy the prompt
Copied
Show code examples for row level security in Supabase.
Copy the prompt
Copied
Query /vercel/next.js for how to configure image optimization.
SEE HOW AUTH WORKS
Each user connects their own Context7 API key once; Scalekit sends it with every call. Keys stay vaulted, every call is scope checked, and every action is logged.
1
Authorize
Your user connects
Context7 MCP
once. We tie it to their identity and the meetings they approved — no shared bot account, no org-wide access
Who:
user ‘A’
when:
Once per user
access:
Limited to user
2
Store
Their
Context7 MCP
token lives in a vault scoped to them. User A's meetings are never reachable by an agent acting for user B, even on the same connection
vault:
encrypted
scope:
per-user
tokens:
auto-refreshed
3
Resolve
When your agent calls a
Context7 MCP
tool, we fetch the right token server-side. It never touches your agent, never appears in the LLM context, never shows up in your logs
speed:
~40ms
check:
before every call
seen by:
nobody
4
Audit
Every
Context7 MCP
tool call is logged — who triggered it, which meeting was fetched, what came back. 90 days of history, tied to the user who authorized it
history:
90 days
export:
SIEM-ready
logged:
every call
Test other agents
See the same per-user auth pattern across other developer and docs connectors.
Engineering Teams
DevOps assistant agent
Polls GitHub for failing checks and stale PRs, opens Linear issues for the ones that need work, and posts a daily digest to Slack. It acts as the engineer, not a shared service account.
Engineering Teams
Engineering standup agent
Pulls commits from GitHub and GitLab, tracks issue movement in Jira, and posts a per-engineer standup brief to Slack. Each engineer's activity is read on their own delegated OAuth.
Engineering Teams
Auto release notes agent
Reads merged GitHub PRs, groups them into structured release notes, publishes the page to Notion, and announces the release in Slack. Every call runs on the engineer's own delegated OAuth.
Engineering Teams
Slack triage
Polls Slack for new messages, classifies bugs and support requests with a LangGraph router, files GitHub issues or Zendesk tickets, and confirms in the thread.
Test other agents
See the same per-user auth pattern across other developer and docs connectors.
ENGINEERING
DevOps assistant agent
Poll GitHub for failing checks and stale pull requests, open Linear issues for the ones that need work, and digest to Slack.
ENGINEERING
Engineering standup agent
Pull commits from GitHub and GitLab, track Jira issue movement, and post a per-engineer standup brief to Slack.
ENGINEERING
Auto-release notes agent
Group merged GitHub PRs into structured release notes, publish the page to Notion, and announce the release in Slack.
ENGINEERING
Slack triage agent
Classify new Slack messages as bugs or support requests, file the GitHub issue or Zendesk ticket, and reply in the thread.
Why Scalekit
Secure your agent's access. Connectors ship in minutes
01.
Shared tokens break per-user analytics
A shared Context7 API key looks fine in a demo. In production every docs query looks like one service account, and you cannot tell which user triggered it. Scalekit resolves the credential of the actual user who triggered the agent, never a shared bot.
// shared key
audit → bot_service_account

// scalekit
audit → user_abc ✓
02.
Authentication is not authorization
03.
Multi-tenancy is architectural
04.
Context7 today. Ten connectors tomorrow.
“Our agents act across Salesforce, Gong, Google Drive, and more, on behalf of every customer. Scalekit behind the scenes meant we can keep adding tools without ever rebuilding how credentials or tool calling work.”
Venu Madhav Kattagoni
Head of Engineering / Von
FAQs
Frequently Asked Questions
Does the agent access Context7 as the user or through a shared account?
As the user. Each user connects their own Context7 API key once, and Scalekit sends it with every call. Audit logs attribute every docs query to that user, not a shared service account.
Where is the Context7 API key stored?
In Scalekit's managed AES-256 token vault, namespaced per tenant. To rotate it, the user reconnects with a new API key. Revocation is a single dashboard action. Credentials never appear in prompts, logs, or LLM context.
Can I limit what the agent does in Context7?
Yes. Filter by tool name in listScopedTools to expose only what you want. Scalekit also enforces scope checks before every API call.
What happens when a user revokes Context7 access?
The connection is invalidated on the next tool call. Subsequent requests for that user fail closed with a clear error. Other users in the tenant remain unaffected. The event is logged for audit.
How does the agent find the right documentation?
It calls context7mcp_resolve_library_id with a library name to get a Context7 library ID such as /vercel/next.js, then context7mcp_query_docs with that ID and a question. If the user already gives an ID in /org/project or /org/project/version form, the agent can skip the resolve step.
Start in your coding agent
Up and running in one command
Install the Scalekit skill in your editor of choice. Connector, auth, tools, prompt, all wired up
Claude Code REPL
/plugin marketplace add scalekit-inc/claude-code-authstack
/plugin install agentkit@scalekit-auth-stack
Cursor Code REPL
# ~/.cursor/mcp.json
{
""mcpServers"": {
""context7mcp"": {
""url"": ""https://mcp.scalekit.com/context7mcp"",
""headers"": { ""Authorization"": ""Bearer $SCALEKIT_TOKEN"" }
}
}
}
Codex Code REPL
# ~/.codex/config.toml
[mcp_servers.context7mcp]
url = ""https://mcp.scalekit.com/context7mcp""
auth_env = ""SCALEKIT_TOKEN""
Copilot Code REPL
# .vscode/mcp.json
{
""servers"": {
""context7mcp"": {
""url"": ""https://mcp.scalekit.com/context7mcp"",
""type"": ""http""
}
}
}