Context7: stop AI from coding against outdated APIs
TL;DR
Context7 (Upstash, MIT) fetches up-to-date, version-specific docs and code examples into your agent's context. Install with npx ctx7 setup (choose CLI + Skill or MCP mode), or point an MCP client at https://mcp.context7.com/mcp with an API key. Especially useful for fast-moving frameworks.
What it fixes
- Examples using deprecated APIs.
- Hallucinated functions that don't exist.
- Generic answers for old versions.
Install
npx ctx7 setup # Node 22.13+, OAuth + API key
npx ctx7 setup --claude # target Claude Code onlyUsage
Create a Next.js middleware that checks a JWT cookie
and redirects unauthenticated users to /login. use context7| Mode | When to choose |
|---|---|
| CLI + Skill | No extra MCP server; the agent calls ctx7 when needed |
| MCP | Agent calls doc tools natively, shared across clients |
Repo: upstash/context7 · context7.com