upstash/context7
A hosted documentation index with MCP and CLI access for coding agents
Automated SPDX check for reference only — not legal advice. Disclaimer
GitHub Star History
Full-history star trajectory from GitHub official history. Switch ranges or hover any point for exact counts.
Evidence-Backed Technical Brief
AI Deep ReviewArchitecture & Core Mechanics
Context7 is a TypeScript monorepo that exposes a hosted documentation index to coding agents. The MCP request path separates library discovery from retrieval: resolve-library-id uses the library name and the task to rank candidates; query-docs takes the selected ID and task and returns relevant documentation and examples. A known ID lets the agent skip discovery. Running the MCP server locally changes where the adapter runs, not where indexing and retrieval are backed.
The repository uses a pnpm workspace and defines separate build scripts for the SDK, MCP server, and AI SDK tools. The root manifest lists @inquirer/core and @inquirer/type; that list does not describe every package’s runtime dependencies. The integration surface includes a CLI with agent skills, an MCP server, a TypeScript SDK, Vercel AI SDK tools, and a pi.dev extension. The API backend, parser, and crawler are outside the public source tree.
Key Capabilities & Differentiators
The main capability is task-specific retrieval of library documentation and code examples. An agent can name a library version in the prompt or supply an exact ID such as /supabase/supabase to avoid selecting a similarly named library. The optional language field in query-docs prioritizes examples in the requested language; it is a ranking hint, not a strict filter or a guarantee that an example exists.
The CLI exposes the same two-step lookup through ctx7 library and ctx7 docs, useful for agents that can run commands but do not support MCP. Teams building their own agent can integrate through the TypeScript SDK, Vercel AI SDK tools, or REST API. Version lookup depends on index coverage; for version-sensitive changes, check that the excerpts match the installed dependency before applying them.
Trade-offs & Limitations
Compared with opening upstream docs directly, Context7 gives agents one interface for finding task-relevant excerpts across libraries. The trade is less control over corpus coverage and refresh timing than with a team-managed index or a pinned documentation snapshot. Coverage and content quality can vary across community-contributed entries, and retrieved text should be treated as reference material, not as instructions or a substitute for checking release notes, source, and tests.
Both remote and local MCP setups still depend on the hosted API, its availability, and its rate limits. The task query helps rank results, so keep secrets, unnecessary source code, and customer data out of it. MIT covers the published repository code; it does not provide the private backend or settle the terms for hosted access or redistribution of third-party documentation.
Hardware & Deployment Guide
For agent workstations, npx ctx7 setup requires Node.js 22.13 or newer, authenticates through OAuth, generates an API key, and offers CLI + Skills or MCP setup. The --cursor, --claude, and --opencode flags target specific agents. For manual remote MCP setup, use https://mcp.context7.com/mcp and send the key in Authorization: Bearer YOUR_API_KEY. An API key is recommended for higher rate limits. This integration does not run model inference locally; load depends on request volume and client-side context handling, not model VRAM.
Local deployment is an MCP adapter option, not an offline deployment of the full service. The v4.9.2 release includes an MCP Bundle and adds task-based waiting while a library’s source is being indexed: code tools can return an MCP task to clients declaring io.modelcontextprotocol/tasks, and the API retains the task. Test that path with the client you intend to deploy; clients that do not declare the extension should not be assumed to support the same wait flow.
resolve-library-id matches a name in the context of the task; query-docs retrieves by exact library ID.language argument to prioritize code examples.ctx7 CLI, TypeScript SDK, Vercel AI SDK tools, and pi.dev extension.io.modelcontextprotocol/tasks; the API retains the task.Teams using coding agents that frequently need version-specific library examples and can rely on a hosted documentation index.
Your workflow must run offline, keep task queries inside your network, or use only a pinned and auditable documentation corpus.
Quick Start & Installation
npx ctx7 setupComparison vs. Top Coding, Skills & MCP Alternatives
Full comparison →| Repository | Stars | 7d Trend | Stack | License | Core Positioning |
|---|---|---|---|---|---|
| context7 ★ | 65.8k | +333 | TypeScript | MIT | A hosted documentation index with MCP and CLI access for coding agents |
| chrome-devtools-mcp | 60.4k | +760 | TypeScript | Apache-2.0 | Chrome DevTools via MCP and CLI for live browser debugging and performance analy |
| rea | 488.8k | +7.6k | TypeScript | MIT | A local CLI and MCP server for evidence-backed app and binary analysis |
| mcp-for-blender | 37.1k | +1.1k | Python | GPL-3.0 | A local MCP bridge for inspecting and editing live Blender scenes with AI |
AI Context Briefing (for Claude / Cursor / Windsurf)
Standardized architecture summary & quickstart commands ready to paste into coding agents.
curl -sL https://repoforai.com/repo/upstash/context7.md
Active README embeds unlock Hot-Tier 6h Telemetry Refresh automatically (zero pay-to-rank).
Frequently Asked Questions about context7
How does a coding agent retrieve documentation?
resolve-library-id with the library name and task, then passes the selected ID and task to query-docs. If the exact ID is already known, it can skip resolution. With CLI + Skills, the agent uses ctx7 library and ctx7 docs without an MCP client.What runtime and hardware does Context7 require?
ctx7 CLI requires Node.js 22.13 or newer. Size the integration for concurrent requests and the client’s context budget rather than GPU VRAM. Running MCP locally does not remove API calls or service rate limits.Can we use Context7 commercially and self-host the full stack?
When is Context7 a better fit than direct docs or an internal index?
Upstream README & Documentation
This profile focuses on independent engineering analysis and live telemetry. Read the full upstream README, changelog, and examples directly on GitHub.
Top 10 Breakout Open-Source AI Repos, Every Thursday
Signal-only digest of fast-growing AI repos, SPDX license alerts, and architecture picks. Zero spam.
Zero spam · 1-click unsubscribe · Privacy Policy