upstash/context7
66.4
Adequate · 28 September 2026
11.6k
lines of production code
TypeScript
primary language
4
measurements over time
What this system is
Context7 is a documentation retrieval system that provides up-to-date library documentation to AI coding agents and applications. It exposes this capability through a command-line interface for local agent configuration, a Model Context Protocol (MCP) server for IDE integration, and TypeScript SDKs for programmatic access. The system enables AI tools to resolve library names and fetch accurate, versioned code examples, ensuring developers have access to current information beyond static training data.
How it got here
2025 — Monorepo restructuring and SDK launch
11 changes.
The project was restructured into a pnpm monorepo to standardize development and manage dependencies across the CLI, MCP server, and SDK packages. This period focused on launching the initial Context7 TypeScript SDK and integrating it with the Vercel AI SDK to provide AI agents with automated documentation search capabilities. Concurrently, the MCP server was upgraded to v2 with native OpenTelemetry observability and enhanced enterprise authentication support.
2026 — Context7 CLI and plugin expansion
10 changes.
This period focused on the initial release of the Context7 CLI package and the expansion of its integration across multiple AI coding agents, including Cursor, Claude, OpenCode, and pi. The work involved establishing a robust command-line interface with OAuth authentication, skill management, and documentation lookup capabilities, alongside comprehensive testing and utility refactoring to support these new features.
Features
Add Context7 plugin for live documentation lookups in OpenCode
The new @upstash/context7-opencode plugin integrates the Context7 MCP server and the context7-mcp skill into OpenCode. It automatically registers the hosted Context7 server and adds a skill that triggers documentation lookups when you ask about libraries or frameworks. Authentication defaults to OAuth (opening a browser for login) but falls back to the CONTEXT7\_API\_KEY environment variable or an apiKey plugin option for headless setups. The plugin is additive and respects existing MCP server or skill configurations if you have already defined them.
packages/opencode · high confidence
Add Context7 plugin for up-to-date documentation lookups
The Context7 plugin is now available in Cursor, providing an MCP server that fetches current documentation and code examples directly from source repositories to avoid outdated training data. It includes a \resolve-library-id\ tool to find libraries and versions, a \query-docs\ tool to retrieve relevant snippets, an always-on rule to encourage using Context7 when unsure about APIs, a dedicated \docs-researcher\ agent for focused lookups, and a \context7-mcp\ skill with detailed instructions for resolving libraries and fetching documentation.
plugins/claude, plugins/cursor · high confidence
Context7 CLI initial release with skill management and documentation queries
The Context7 CLI is now available, providing a unified interface for AI coding agents to manage skills and fetch documentation context. Users can configure the CLI for various IDEs (Claude Code, Cursor, Antigravity, and Universal agents via .agents/skills) using the setup command, and remove configurations with the remove command. The tool supports installing, listing, searching, and generating skills, with output options including JSON for scripting. It also includes commands to query library documentation (library, docs) and check for CLI updates. Authentication is handled via OAuth 2.0 (login, whoami, logout), and the CLI supports custom backend URLs for on-premise deployments.
packages/cli/src · high confidence
Context7 MCP server now exposes OpenTelemetry metrics for Prometheus
The MCP server now includes native OpenTelemetry observability, exposing bounded metrics for requests, tools, authentication, and upstream API calls on an internal telemetry port (9464) for Prometheus scraping. This allows users to monitor server performance and usage patterns directly from their deployment infrastructure.
packages/mcp · high confidence
Context7 MCP v4.0.3 release with new configuration and documentation files
This release introduces the Context7 MCP server configuration (server.json) for version 4.0.3, defining the server metadata, npm package identifier, and remote streamable-HTTP transport endpoint. It adds a .env.example file detailing required environment variables for API keys, OAuth, and MCP subscription limits, alongside a new context7.json file for Vercel Marketplace OIDC support. The update also includes a comprehensive README.md with installation instructions for CLI and MCP modes, a LICENSE file, a SECURITY.md policy, and configuration files for ESLint, Prettier, TypeScript, and pnpm workspaces to standardize the development environment.
(repo-wide) · high confidence
Initial release of the Context7 CLI package
The \packages/cli\ directory is now a standalone, buildable package containing the Context7 command-line interface. This release introduces the core CLI structure, including TypeScript configuration, ESLint rules, and Vitest test setup, alongside comprehensive documentation in the README. The package exposes commands for library documentation lookup (\ctx7 docs\, \ctx7 library\), agent configuration (\ctx7 setup\, \ctx7 remove\), and authentication (\ctx7 login\), supporting various AI coding agents like Claude, Cursor, and VS Code. It also includes a changelog detailing version history from 0.3.7 to 0.5.12, covering features such as OAuth device flow, on-premise support, and skill management.
packages/cli · high confidence
Initial release of the Context7 TypeScript SDK
The \@upstash/context7-sdk\ package is now available, providing a TypeScript client for the Context7 API. It introduces a \search\ method to find relevant documentation without separate library resolution, and supports Vercel Marketplace OIDC authentication via per-request token providers. The SDK includes production-grade HTTP controls such as configurable timeouts (defaulting to 30 seconds), retry logic for transient errors, abort signal support, and native fetch caching. It also features a typed \Context7Error\ for structured error handling and defaults to JSON response formats, with explicit support for plain text via the \type\ option.
packages/sdk · high confidence
Introduce Context7 AI SDK tools and agent for Vercel AI SDK
The \@upstash/context7-tools-ai-sdk\ package is now available, providing Vercel AI SDK-compatible tools (\resolveLibrary\, \getLibraryDocs\) and a pre-configured \Context7Agent\. This enables AI applications to access up-to-date library documentation directly within \generateText\ or \streamText\ workflows, or via the agent for automated multi-step documentation retrieval. The package includes configuration for TypeScript, ESLint, and Vitest, and relies on \@upstash/context7-sdk\ and \zod\.
packages/tools-ai-sdk · high confidence
Introduce Context7 AI SDK tools for library documentation lookup
This change adds the \@upstash/context7-tools-ai-sdk\ package, exposing two new AI SDK tools: \resolveLibraryId\, which maps a library name to a Context7-compatible ID, and \queryDocs\, which fetches specific documentation for that library. These tools allow AI agents to search for and retrieve accurate, versioned documentation for external libraries, supporting configuration via an optional API key or the \CONTEXT7\_API\_KEY\ environment variable.
packages/tools-ai-sdk/src/tools · high confidence
Introduce Context7 documentation search agent and tools
This change adds a new Context7 integration to the AI SDK tools package, providing a \Context7Agent\ class and standalone tools (\resolveLibraryId\, \queryDocs\) that allow models to search for and retrieve documentation for software libraries. The agent automates a multi-step workflow: resolving library names to Context7 IDs, fetching relevant documentation, and providing answers with code examples. This is a new capability rather than a modification of existing behavior.
packages/tools-ai-sdk/src · high confidence
Introduce TypeScript SDK with Search API and structured documentation retrieval
The Context7 TypeScript SDK now exposes three primary client methods: \searchLibrary\ to find libraries by query and name, \getContext\ to retrieve structured documentation snippets for a specific library, and \search\ to perform broad documentation searches with library, version, and language hints. All methods support a \type\ option to return results as structured JSON objects (the default) or formatted plain text strings. The SDK handles authentication via API keys or OIDC token providers, manages HTTP transport with configurable retries, timeouts, and cache settings, and provides detailed error handling through the \Context7Error\ class.
packages/sdk/src · high confidence
MCP server v2 with native OpenTelemetry observability and enterprise authentication
The MCP server has been upgraded to v2, introducing native OpenTelemetry support for metrics and distributed tracing, including an embedded Prometheus exporter for local monitoring. Authentication now supports multi-tenant Entra ID validation, Enterprise-Managed Auth (EMA), and Vercel Marketplace OIDC, while advertising Clerk as the OAuth issuer. The server also enforces a 60-second timeout on API calls, supports custom CA certificates via NODE\_EXTRA\_CA\_CERTS for enterprise proxy environments, and returns a source field in search results.
packages/mcp/src/lib · high confidence
New Context7 CLI setup command with multi-agent support
The CLI now includes a \ctx7 setup\ command that configures Context7 integration for multiple AI coding agents, including Claude Code, Cursor, VS Code, Devin, Gemini CLI, and GitHub Copilot CLI. The setup process handles authentication (API keys or OAuth), installs documentation-lookup skills, and writes agent-specific rules and MCP configurations to the appropriate project or global directories. It also supports on-premise deployments via a custom base URL and includes specific handling for Codex CLI sandbox DNS failures.
packages/cli/src/setup · high confidence
New Context7 documentation extension for the pi coding agent
The \@upstash/context7-pi\ package introduces an official extension for the pi coding agent that provides up-to-date library documentation. It registers two tools, \resolve-library-id\ and \query-docs\, which allow the agent to search for and retrieve documentation from Context7. The extension includes a \context7-docs\ skill that instructs the agent to use these tools for library-related questions, and a \/c7-docs\ slash command for manual lookups. The implementation is self-contained, using the \CONTEXT7\_API\_KEY\ environment variable for authentication, and aligns its wire format and error messages with the \@upstash/context7-mcp\ package.
packages/pi · high confidence
New system prompts for Context7 documentation assistant
The Context7 AI SDK now includes a dedicated module for system prompts that define the behavior of the documentation search assistant. This update introduces a structured workflow where agents must first resolve a library name to a specific Context7 library ID before querying documentation, ensuring accurate source selection. The prompts enforce a multi-step process: resolving the library ID, analyzing results for official sources and reputation, and then querying the documentation, with safeguards to limit tool calls to three per question. This provides a consistent, reliable interface for agents to retrieve up-to-date code examples and documentation.
packages/tools-ai-sdk/src/prompts · high confidence
Behavioural changes
CLI commands restructured with new authentication, documentation, and upgrade capabilities
The CLI command structure has been reorganized into dedicated modules, introducing a new \auth\ command that implements an OAuth 2.0 device authorization flow for login, logout, and whoami operations. A new \docs\ command has been added to resolve and query library documentation, featuring JSON output support and improved error handling for library ID recovery on Windows. The \generate\ command now includes an interactive wizard for creating AI skills, complete with quota enforcement and source selection. Additionally, a new \remove\ command allows users to uninstall Context7 setup from supported agents, and an \upgrade\ command has been introduced to check for and apply CLI updates. The existing \setup\ and \skill\ commands have been updated to support these new workflows, including on-premise deployment options and deprecation warnings for legacy skill hub commands.
packages/cli/src/commands · high confidence
CLI utility layer refactored with new authentication, API, and skill management helpers
The CLI's internal utility layer has been restructured into a set of dedicated modules in \packages/cli/src/utils\. Authentication is now handled by \auth.ts\, which implements OAuth 2.0 device authorization flows, token refresh logic, and secure credential storage using XDG Base Directory paths. API interactions are centralized in \api.ts\, providing typed wrappers for skill listing, searching, downloading, and library documentation. Skill installation and management are supported by \installer.ts\ (with directory traversal protection), \github.ts\ (for GitHub API and raw file fetching), and \library-id.ts\ (which fixes Windows Git Bash path mangling). The update system is now managed by \update-check.ts\, which detects the local package manager and generates upgrade commands, while \tracking.ts\ handles telemetry events. Additional helpers include \deps.ts\ for parsing project dependencies, \prompts.ts\ for enhanced interactive UIs, and \storage-paths.ts\ for migrating legacy configuration files.
packages/cli/src/utils · high confidence
MCP server introduces auth elicitation for anonymous users and fixes argument aliasing
The MCP server now proactively prompts anonymous users to sign in via an elicitation dialog (offering a setup command) when the backend signals it, replacing previous silent anonymous behavior. Additionally, the server now automatically rewrites common LLM-hallucinated argument names (such as 'userQuery' or 'libraryID') to their canonical schema keys before validation, preventing tool call failures. The entry also includes the new stdio/HTTP transport configuration via CLI flags and the basic server scaffolding for the Context7 MCP implementation.
packages/mcp/src · high confidence
Test coverage
Added comprehensive test coverage for MCP package; Expanded test coverage for CLI authentication, setup, and removal workflows.
Dependencies
Initial pnpm monorepo structure and dependency configuration
The project has been restructured into a pnpm monorepo, introducing a root package.json and individual package manifests for the CLI, MCP server, SDK, AI SDK tools, OpenCode plugin, and Pi extension. This setup establishes the core dependency graph, including the adoption of Zod v4, Vercel AI SDK v6, and the Model Context Protocol SDK v2, while setting specific Node.js engine requirements (Node 18+ for the CLI, Node 20.18.1+ for the MCP server).
(dependencies) · high confidence
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
How this codebase got here
Score
- CAI 45 → 66 (+21.6)
- Rubric changed (rubric-2026.08.15 → rubric-2026.09.16) — scores are not directly comparable.
Lenses
- Code Health 80 → 74 (-5.9)
- Architecture 95 (new)
- Maturity 51 → 72 (+20.8)
- Readiness 33 → 61 (+28.3)
- Security 52 → 62 (+9.6)
- Performance 100 (new)
Resolved (86)
- Boundary-crossing change coupling: templates.ts ↔ index.ts (packages/cli/src/setup/templates.ts)
- Change coupling: docs.ts ↔ api.ts (packages/cli/src/commands/docs.ts)
- Change coupling: index.ts ↔ api.ts (packages/mcp/src/index.ts)
- Change coupling: setup.ts ↔ templates.ts (packages/cli/src/commands/setup.ts)
- Change coupling: skill.ts ↔ api.ts (packages/cli/src/commands/skill.ts)
- Dimension evaluation failed
- High CVE: [GHSA redacted] (pnpm-lock.yaml)
- High CVE: [GHSA redacted] (pnpm-lock.yaml)
- High CVE: [GHSA redacted] (pnpm-lock.yaml)
- High CVE: [GHSA redacted] (pnpm-lock.yaml)
- High CVE: [GHSA redacted] (pnpm-lock.yaml)
- High CVE: [GHSA redacted] (pnpm-lock.yaml)
- High CVE: [GHSA redacted] (pnpm-lock.yaml)
- High CVE: [GHSA redacted] (pnpm-lock.yaml)
- High CVE: [GHSA redacted] (pnpm-lock.yaml)
- High CVE: [GHSA redacted] (pnpm-lock.yaml)
- High CVE: [GHSA redacted] (pnpm-lock.yaml)
- High CVE: [GHSA redacted] (pnpm-lock.yaml)
- High CVE: [GHSA redacted] (pnpm-lock.yaml)
- High CVE: [GHSA redacted] (pnpm-lock.yaml)
- …and 66 more
New (169)
- Coverage not measured — JavaScript/TypeScript suite
- Documentation: no project overview (README.md)
- FileTooLong: commands/skill.ts (packages/cli/src/commands/skill.ts)
- FileTooLong: lib/mcp-telemetry.ts (packages/mcp/src/lib/mcp-telemetry.ts)
- FunctionTooLong: generate.generateCommand (packages/cli/src/commands/generate.ts)
- FunctionTooLong: index.createMcpServer (packages/mcp/src/index.ts)
- FunctionTooLong: index.main (packages/mcp/src/index.ts)
- FunctionTooLong: skill.installCommand (packages/cli/src/commands/skill.ts)
- FunctionTooLong: skill.searchCommand (packages/cli/src/commands/skill.ts)
- FunctionTooLong: skill.suggestCommand (packages/cli/src/commands/skill.ts)
- Further sole-owners (lower concentration)
- High CVE: [GHSA redacted] (pnpm-lock.yaml)
- High CVE: [GHSA redacted] (pnpm-lock.yaml)
- High CVE: [GHSA redacted] (pnpm-lock.yaml)
- High CVE: [GHSA redacted] (pnpm-lock.yaml)
- High CVE: [GHSA redacted] (pnpm-lock.yaml)
- High CVE: [GHSA redacted] (pnpm-lock.yaml)
- High CVE: [GHSA redacted] (pnpm-lock.yaml)
- High CVE: [GHSA redacted] (pnpm-lock.yaml)
- High CVE: [GHSA redacted] (pnpm-lock.yaml)
- …and 149 more
Changes since last survey
- 75 commits — 63 feature/other, 12 fixes
By area
- packages/mcp — 17 commits
- packages/cli — 14 commits
- docs/docs7 — 7 commits
- docs/docs.json — 6 commits
- docs/enterprise — 5 commits
- packages/sdk — 4 commits
- (root) — 3 commits
- .github/workflows — 3 commits
- docs/images — 3 commits
- docs/api-guide.mdx — 2 commits
- .changeset/mcp-api-fetch-timeout.md — 1 commit
- .changeset/mcp-clerk-oauth-issuer.md — 1 commit
- .changeset/mcp-drop-self-cancellations.md — 1 commit
- .changeset/mcp-response-mode-auto.md — 1 commit
- .changeset/opencode-plugin.md — 1 commit
- docs/agentic-tools.mdx — 1 commit
- docs/clients — 1 commit
- docs/resources — 1 commit
- docs/search-api.mdx — 1 commit
- packages/opencode — 1 commit
Notable commits
- fix: fix(cli): recover Scoop Git Bash library IDs (#3085)
- fix: fix(cli): refresh expired tokens for documentation commands (#3003)
- fix: fix(cli): reuse device login API key during setup (#3109)
- fix: fix(cli): safely patch Codex TOML stdio args (#3075)
- fix: fix(mcp): advertise Clerk as OAuth issuer (#3050)
- fix: fix(mcp): allow empty Claude plugin API key (#3168)
- fix: fix(mcp): authenticate forwarded client IP assertions (#3088)
- fix: fix(mcp): honor advertised X-Context7-API-Key header (#3091)
- fix: fix(mcp): increase HTTP subscription capacity (#3101)
- fix: fix(mcp): remove legacy client IP encryption (#3112)
- fix: fix(pnpm): classify ignored dependency builds (#3170)
- fix: fix: repair MCP Registry publishing and automate it on release (#3097)
- change: Add Docs7 documentation and component guides (#3024)
- change: Add automatic repository update documentation (#3077)
- change: Add context7.json with URL and public key (#3057)
- change: Add the required fields to the Docs7 quickstart docs.json (#3220)
- change: Bound Context7 API calls with an abort signal (#3018)
- change: CTX7-1984: Update private parsing pricing docs (#3034)
- change: CTX7-2006: Support on-premise setup in ctx7 CLI (#3044)
- change: CTX7-2681: Clarify CLI login recovery and share the API URL (#3200)
- …and 55 more
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
Survey your own repository
upstash/context7 was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.
About this page
- The score is its most recent published measurement, taken on 28 September 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
- Measured at commit e275a848a420e0d11c2822f61201ee005bfd1133 — the exact code this score is about.
- Scored under rubric-2026.09.16 — the same rubric and the same method as every other entry in this index.
- Measured by watchdog.canine.dev using codehealth-analyzer preprod-eb9197011364.