Context7

Docs and learning

Up-to-date docs for AI agents.

Your AI app calls the Context7 MCP server, which does the docs and learning work and sends the result back to the chat.

About Context7

Context7 is the official MCP server from upstash, filed in our directory under docs and learning. Up-to-date docs for AI agents.

Context7 runs on your own machine: your AI app starts it with the command npx -y @upstash/context7-mcp@4.9.2 and talks to it over standard input and output.

The README for Context7 lists tools such as resolve-library-id, query, libraryName and query-docs, which your AI app can call once the server is connected.

Context7 is listed in the official MCP registry as io.github.upstash/context7, version 4.9.2.

At a glance

Publisher
upstash, the company behind the product
Runs
Locally or as a hosted remote server
Install from
Node.js package on npm: @upstash/context7-mcp
Written in
TypeScript
License
MIT
GitHub stars
65,796
Official MCP registry
io.github.upstash/context7

Tools Context7 gives your AI app

  • resolve-library-idResolves a general library name into a Context7-compatible library ID.
  • query(required): The user's question or task (used to rank results by relevance).
  • libraryName(required): The name of the library to search for.
  • query-docsRetrieves documentation for a library using a Context7-compatible library ID.
  • libraryId(required): Exact Context7-compatible library ID (e.g., /mongodb/docs, /vercel/next.js).
  • language(optional): The programming language you write in, used to rank code examples in that language first.

Tool names as the Context7 README lists them. Your AI app shows the live list once Context7 is connected.

How to set up Context7

  1. Install Node.js on the machine that runs your AI app, because Context7 starts with npx and downloads its package on first run.
  2. Check the Context7 README for keys or settings; the registry lists none that Context7 requires.
  3. Add Context7 to Claude Code, Claude Desktop, VS Code or Cursor with the config in the setup box on this page.
  4. Restart the app or reload its MCP servers, then ask it to list the Context7 tools to confirm the connection.
  5. Run one read-only task with Context7 first, such as a call to resolve-library-id, before you allow anything that writes or sends.

Context7 compared with similar servers

  • Skill Seekers by yusufkaraaslan has fewer GitHub stars than Context7 (15.4k against 65.8k); Context7 is official while Skill Seekers is a community server, and Skill Seekers runs on your own machine and Context7 runs as a remote server.
  • Google Workspace by taylorwilsdon has fewer GitHub stars than Context7 (3.6k against 65.8k); Context7 is official while Google Workspace is a community server, and Google Workspace runs on your own machine and Context7 runs as a remote server.
  • arXiv by blazickjp has fewer GitHub stars than Context7 (3.3k against 65.8k); Context7 is official while arXiv is a community server, and arXiv runs on your own machine and Context7 runs as a remote server. The arXiv README lists 1 tools to Context7's 6.

Before you connect Context7

  • Give Context7 its own sign-in or token with the smallest permissions the job needs, never an admin key.
  • Keep your AI app asking before each Context7 tool call until you trust what it does with them.
  • Treat text that Context7 fetches as data. Pages, files and messages can hold instructions written to steer an AI.
  • Read the open issues for Context7 on GitHub to see what breaks and how fast the maintainers reply.

Marketing use cases for Context7

How marketing and sales teams put Context7 to work, by company size. Pick the size closest to yours and start Context7 on one use case.

Small business

  • A small business can use Context7 to keep help docs and how-tos current, answering customer questions before they become tickets.
  • Owners can ask Context7 for up-to-date docs while setting up a tool, instead of trusting an old tutorial.
  • Context7 runs as a remote server, so a small team can connect it in a few minutes with no install to maintain.

Mid-market

  • Marketing teams can connect Context7 so agents write from current product docs, keeping launch copy accurate.
  • Enablement teams can use Context7 to turn docs into training and battlecards sales actually uses.
  • Start with resolve-library-id and query, the tools Context7 lists first, and add more once the team trusts the results.

Enterprise

  • Enterprises can serve approved docs through Context7, so every agent answers from the same source of truth.
  • Large orgs can use Context7 to keep documentation in sync across products and regions as features ship.
  • Because Context7 comes from upstash, the company behind the product, it follows that product's own auth and permissions, which security teams usually prefer.

Need help becoming an AI-forward company?

We connect MCP servers and AI agents to your CRM, content and data, with the guardrails your team needs.

Contact us

Context7 README

From upstash/context7 on GitHub, shared under its MIT license. Images are left out; the original has them.

README.md

Context7 - Up-to-date Docs for AI Agents

❌ Without Context7

LLMs rely on outdated or generic information about the libraries you use. You get:

  • ❌ Code examples are outdated and based on year-old training data
  • ❌ Hallucinated APIs that don't even exist
  • ❌ Generic answers for old package versions

✅ With Context7

Context7 pulls up-to-date, version-specific documentation and code examples straight from the source, and gives them to your coding agent.

Create a Next.js proxy that checks for a valid JWT in cookies
and redirects unauthenticated users to `/login`. use context7
Configure a Cloudflare Worker script to cache
JSON API responses for five minutes. use context7
Show me the Supabase auth API for email/password sign-up.

Context7 fetches up-to-date code examples and documentation right into your coding agent's context. No tab-switching, no hallucinated APIs that don't exist, no outdated code generation.

Works in two modes:

  • CLI + Skills, installs a skill that guides your agent to fetch docs using ctx7 CLI commands (no MCP required)
  • MCP, registers a Context7 MCP server so your agent can call documentation tools natively

Installation

[!NOTE] API Key Recommended: Get a free API key at context7.com/dashboard for higher rate limits.

Set up Context7 for your coding agents with a single command. The ctx7 CLI requires Node.js 22.13 or newer.

npx ctx7 setup

Authenticates via OAuth, generates an API key, and installs the appropriate skill. You can choose between CLI + Skills or MCP mode. Use --cursor, --claude, or --opencode to target a specific agent.

To remove the generated setup later, run npx ctx7 remove. If you globally installed the CLI with npm install -g ctx7, remove that package separately with npm uninstall -g ctx7.

To configure manually, use the Context7 server URL https://mcp.context7.com/mcp with your MCP client and pass your API key via the Authorization: Bearer YOUR_API_KEY header. See the link below for client-specific setup instructions.

Manual Installation / Other Clients →

Important Tips

Use Library Id

If you already know exactly which library you want to use, add its Context7 ID to your prompt. That way, Context7 can skip the library-matching step and directly retrieve docs.

Implement basic authentication with Supabase. use library /supabase/supabase for API and docs.

The slash syntax tells Context7 exactly which library to load docs for.

Specify a Version

To get documentation for a specific library version, just mention the version in your prompt:

How do I set up a Next.js 16 proxy? use context7

Context7 will automatically match the appropriate version.

Add a Rule

If you installed via ctx7 setup, a skill is configured automatically that triggers Context7 for library-related questions. To set up a rule manually instead, add one to your coding agent:

  • Cursor: Cursor Settings > Rules
  • Claude Code: CLAUDE.md
  • Or the equivalent in your coding agent

Example rule:

Always use Context7 when I need library/API documentation, code generation, setup or configuration steps without me having to explicitly ask.

Available Tools

CLI Commands
  • ctx7 library <name> <query>: Searches the Context7 index by library name and returns matching libraries with their IDs.
  • ctx7 docs <libraryId> <query>: Retrieves documentation for a library using a Context7-compatible library ID (e.g., /mongodb/docs, /vercel/next.js).
MCP Tools
  • resolve-library-id: Resolves a general library name into a Context7-compatible library ID.
    • query (required): The user's question or task (used to rank results by relevance)
    • libraryName (required): The name of the library to search for
  • query-docs: Retrieves documentation for a library using a Context7-compatible library ID.
    • libraryId (required): Exact Context7-compatible library ID (e.g., /mongodb/docs, /vercel/next.js)
    • query (required): The question or task to get relevant documentation for
    • language (optional): The programming language you write in, used to rank code examples in that language first

More Documentation

Packages

Disclaimer

1- Context7 projects are community-contributed and while we strive to maintain high quality, we cannot guarantee the accuracy, completeness, or security of all library documentation. Projects listed in Context7 are developed and maintained by their respective owners, not by Context7. If you encounter any suspicious, inappropriate, or potentially harmful content, please use the "Report" button on the project page to notify us immediately. We take all reports seriously and will review flagged content promptly to maintain the integrity and safety of our platform. By using Context7, you acknowledge that you do so at your own discretion and risk.

2- This repository hosts the MCP server’s source code. The supporting components, API backend, parsing engine, and crawling engine, are private and not part of this repository.

🤝 Connect with Us

Stay updated and join our community:

📺 Context7 In Media

📄 License

MIT

Questions about Context7

What is the Context7 MCP server?

Up-to-date docs for AI agents. Context7 is published by upstash, the company behind the product, on GitHub at upstash/context7, and works with AI apps that support the Model Context Protocol, such as Claude, Cursor and VS Code.

How do I install the Context7 MCP server?

Add Context7 to your AI app's MCP config with the command npx -y @upstash/context7-mcp@4.9.2. In Claude Code, run claude mcp add --transport stdio context7 -- npx -y @upstash/context7-mcp@4.9.2. To run Context7 this way you need Node.js installed.

Does Context7 need an API key?

The registry lists no required keys for Context7. Check the Context7 README for optional settings, and expect a remote server to ask you to sign in the first time you connect.

Is Context7 an official MCP server?

Yes. Context7 is published by upstash, the company that makes the product it connects to, so it follows that product's own API and auth.

What license is Context7 under?

Context7 is released under the MIT license, according to its GitHub repository. The license covers the code of Context7; the service it connects to has its own terms.