# Context7

> Context7 pulls up-to-date, version-specific documentation and code examples directly from source repositories and injects them into LLMs and AI code editors like Cursor and Claude.

Context7 is an Upstash project that solves a core problem with AI-assisted coding: LLMs are trained on outdated data and frequently hallucinate APIs or generate code for old library versions. By fetching live documentation directly from source repositories, Context7 injects accurate, version-specific context into tools like Cursor, Claude, and any MCP-compatible coding agent. The MCP server component is open source under the MIT license, while the API backend, parsing engine, and crawling engine are private.

## What It Is

Context7 is a documentation-fetching platform and MCP server that bridges the gap between static LLM training data and the constantly evolving state of open-source libraries. When a developer asks their AI coding assistant how to use a specific library, Context7 intercepts that need, resolves the correct library ID, retrieves current documentation snippets, and places them directly into the LLM's context window. The result is that the model answers with real, working code examples rather than hallucinated or outdated ones. The platform indexes over 100,000 libraries sourced from GitHub repositories and official documentation sites.

## How It Works

Context7 operates in two modes:

- **CLI + Skills** — installs a `ctx7` CLI skill that guides the agent to fetch docs using `ctx7 library` and `ctx7 docs` commands, with no MCP server required
- **MCP** — registers a Context7 MCP server so the agent can call `resolve-library-id` and `query-docs` tools natively

Setup for either mode is handled by a single command: `npx ctx7 setup`. The tool authenticates via OAuth, generates an API key, and installs the appropriate skill or MCP configuration. Manual configuration is also supported by pointing any MCP client at `https://mcp.context7.com/mcp` with an API key header.

## Integration and Compatibility

Context7 is designed to work with any MCP-compatible coding agent. The GitHub README documents support for Cursor, Claude Code, and OpenCode via dedicated flags (`--cursor`, `--claude`, `--opencode`). The documentation site lists manual installation instructions for 30+ MCP clients. Developers can also use the REST API directly, and the platform provides a web-based chat interface for browsing and querying documentation without any local setup.

## Update: ctx7@0.4.2

The latest release of the CLI package is `ctx7@0.4.2`, published on May 11, 2026. The GitHub repository was created in March 2025 and has seen continuous activity, with the last push recorded in May 2026. The project has accumulated over 55,000 GitHub stars and 2,600 forks, reflecting rapid community adoption since launch. The repository's topics include `mcp`, `mcp-server`, `llm`, and `vibe-coding`.

## Security and Trust Model

Context7 assigns a trust score to repository organizations to help MCP clients choose safer projects. Before storing documentation chunks, the platform runs an LLM-based model to detect prompt injection attempts. Users can filter libraries by organization and repository. The platform is operated by Upstash Inc., a Silicon Valley company, and applies the same security practices used across Upstash's other products. Enterprise deployments include SOC-2 certified infrastructure, encrypted data in transit, role-based access control, and SSO via SAML or OIDC. A self-hosted deployment option is available for enterprise customers.

## Features
- Up-to-date, version-specific documentation fetching
- MCP server integration
- CLI + Skills mode (no MCP required)
- Resolves library IDs from natural language queries
- Injects documentation directly into LLM context
- Supports 100,000+ libraries
- Web-based chat interface for doc browsing
- Private repository parsing
- Team collaboration and access control
- OAuth 2.0 authentication
- Trust scoring for repositories
- Prompt injection detection
- Self-hosted deployment (Enterprise)
- SOC-2 compliance (Enterprise)
- SSO via SAML/OIDC (Enterprise)

## Integrations
Cursor, Claude Code, OpenCode, Any MCP-compatible client, Smithery, NPM (ctx7 package)

## Platforms
WEB, API, VSC_EXTENSION, CLI

## Pricing
Freemium — Free tier available with paid upgrades

## Links
- Website: https://context7.com
- Documentation: https://context7.com/docs
- Repository: https://github.com/upstash/context7
- EveryDev.ai: https://www.everydev.ai/tools/context7
