Context7

Active
GitHub TypeScript MIT

Description

Context7 is Upstash's context-engineering toolkit for agents, helping applications manage long context windows, retrieval injection, and history compression.

Key Features

  • Real-time documentation retrieval — pulls latest version-specific library docs and code examples via MCP or CLI, injected directly into LLM context
  • Dual-mode integration — supports CLI + Skills (ctx7 commands) and MCP Server, compatible with Cursor/Claude Code/OpenCode and other major agents
  • Library version matching — automatically resolves library names and versions to fetch precise, version-appropriate docs
  • Context injection — embeds retrieved documentation directly into prompts without tab-switching, reducing hallucination
  • CLI toolchain — ctx7 library search and ctx7 docs query commands, scriptable for pipeline integration
  • TypeScript SDK — provides @upstash/context7-sdk and Vercel AI SDK tool extensions

Use Cases

💡 When developing in Claude Code or Cursor, automatically fetch latest API docs to avoid generating non-existent interfaces
💡 Getting precise version-specific documentation when working with libraries like Next.js 14 or Supabase
💡 Integrating context retrieval into prompt engineering workflows for AI Agent development
💡 Quickly verifying latest library usage patterns without manually browsing official documentation
💡 Batch-querying documentation for multiple libraries via CLI in automation scripts

Quick Start

npx ctx7 setup

Related Projects

Related Articles