← all repositories
upstash/context7

A cure for LLM documentation amnesia

Context7 injects live, version-specific library docs straight into your AI coding agent's context so it stops hallucinating APIs that don't exist.

56.9k stars TypeScript Coding AssistantsLLMOps · Eval
context7
Velocity · 7d
+130
★ / day
Trend
steady
star history

What it does Context7 is a documentation retrieval layer for LLMs and AI code editors. It indexes library docs and code examples, then serves them into your prompt context via an MCP server or a ctx7 CLI. You mention a library in your prompt—“use context7”—and it fetches current, version-matched docs instead of relying on stale training data.

The interesting bit The project treats documentation as a dynamic context window problem, not a static knowledge cutoff. It offers two integration paths: a CLI-plus-skills mode that works without MCP infrastructure, and a native MCP server for agents that speak the protocol. The “slash” library ID syntax (/supabase/supabase) lets you bypass fuzzy matching and pull docs directly.

Key highlights

  • Single-command setup via npx ctx7 setup with OAuth auth and API key generation
  • Version-aware retrieval: mention “Next.js 14” and it matches the right docs automatically
  • MCP server exposes resolve-library-id and query-docs tools for agent-native access
  • CLI commands ctx7 library and ctx7 docs for manual lookup and scripting
  • Free tier available; API key unlocks higher rate limits
  • Supporting backend, parser, and crawler are proprietary—this repo is the MCP server and client tooling only

Caveats

  • Documentation quality varies; the disclaimer notes community-contributed content with no accuracy guarantee
  • The actual indexing infrastructure is closed-source, so you can’t self-host the full pipeline

Verdict Worth a look if you’re tired of your agent inventing APIs or cargo-culting year-old patterns. Skip it if you need fully offline or self-hosted doc retrieval, or if your workflow doesn’t involve Cursor, Claude Code, or other MCP-capable agents.

heatdrop uses Google Analytics to see which pages get read — nothing else. Your call. How we handle data.