Context7 logo

Context7

OrganizationPopular
upstash

Context7 Platform -- Up-to-date code documentation for LLMs and AI code editors

Publisherupstash
Repositorycontext7
LanguageTypeScript
Forks
2.6K
Stars
55.3K
Available tools
2
Transport typestreamable-http
Categories
LicenseMIT
Links
  • Connect tools to AI workflows

    Context7 exposes MCP capabilities that can be used by compatible AI clients and agents.

  • 2 available tools

    Browse the callable actions below, including names and descriptions when provided by the server.

  • Ready-to-copy setup

    Use the installation snippets to configure this server in your preferred MCP client.

  • Open source signals

    55.3K stars and 2.6K forks from the linked repository.

Cover

Install MCP Server

Context7 Platform - Up-to-date Code Docs For Any Prompt

Website smithery badge NPM Version MIT licensed

繁體中文 简体中文 日本語 한국어 문서 Documentación en Español Documentation en Français Documentação em Português (Brasil) Documentazione in italiano Dokumentasi Bahasa Indonesia Dokumentation auf Deutsch Документация на русском языке Українська документація Türkçe Doküman Arabic Documentation Tiếng Việt

❌ 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 places them directly into your prompt.

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

Context7 fetches up-to-date code examples and documentation right into your LLM'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:

bash
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 CONTEXT7_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.

txt
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:

txt
How do I set up Next.js 14 middleware? 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:

txt
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

More Documentation

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

⭐ Star History

Star History Chart

📄 License

MIT

Installation

TypingMind
{
  "mcpServers": {
    "context7": {
      "url": "https://mcp.context7.com/mcp"
    }
  }
}

Available Tools

  • resolve-library-id

    $2d

  • query-docs

    Retrieves and queries up-to-date documentation and code examples from Context7 for any programming library or framework.

    You must call 'resolve-library-id' first to obtain the exact Context7-compatible library ID required to use this tool, UNLESS the user explicitly provides a library ID in the format '/org/project' or '/org/project/version' in their query.

    IMPORTANT: Do not call this tool more than 3 times per question. If you cannot find what you need after 3 calls, use the best information you have.

Use Context7 MCP with multiple AI models

TypingMind connects MCP tools at the workspace level, so once Context7 is connected, you can use it with different AI models in TypingMind instead of setting it up separately for each model. This MCP connects through a hosted MCP server URL in TypingMind.

Add an MCP server URL

Use this when Context7 is already hosted remotely or your team wants one shared connector that multiple users can access.

1

Open MCP connectors

In TypingMind, go to Plugins, open MCP connectors, then choose Add URL.

  1. Open TypingMind in your browser.
  2. Go to Plugins.
  3. Open MCP connectors.
  4. Click Add URL.
TypingMind Add Custom MCP Server URL form
2

Paste the server URL

Enter https://mcp.context7.com/mcp in the Server URL field. Add a connection name, description, icon, custom HTTP headers, or OAuth client settings if the server requires them.

  1. Paste https://mcp.context7.com/mcp into the Server URL field.
  2. Enter a connection name for Context7.
  3. Add a description and icon if you want it to be easier to identify.
  4. Add custom HTTP headers or OAuth client details if the server requires authentication.
3

Create the connection

Click Create connection, then return to the Plugins list and confirm the new MCP connection is active.

  1. Click Create connection.
  2. Return to the MCP connectors list.
  3. Confirm the Context7 connection appears as active.
  4. Refresh the plugin list if the connection does not appear immediately.
4

Switch models without reconnecting

Start a chat with your preferred model, enable the Context7 tools from Plugins, and switch to another model whenever needed. The MCP connection stays available to the TypingMind workspace.

  1. Start a new chat in TypingMind.
  2. Select the AI model you want to use.
  3. Enable the Context7 tools from Plugins.
  4. Ask the model to use the tool when needed.
  5. Switch to another AI model and reuse the same MCP connection.
TypingMind chat using enabled MCP tools with a selected AI model
Can you use Context7 to help me with this task?
Context7
Sure. I read it.
Here is what I found using Context7.

Frequently asked questions

What is the Context7 MCP server used for?

Context7 is an MCP server that lets compatible AI clients connect to external tools and context. In TypingMind, you can add this MCP server once and make its tools available in your AI workspace.

Can I use Context7 MCP with multiple AI models in TypingMind?

Yes. TypingMind connects MCP tools at the workspace level, so you can use Context7 with different AI models such as Claude, ChatGPT, Gemini, or other models you have configured in TypingMind without setting up the MCP server separately for each model.

Why use Context7 MCP with TypingMind?

TypingMind is one of the best frontends for LLM chat because it brings multiple AI models, prompts, plugins, AI agents, API keys, and MCP tools into one workspace. With Context7 connected, you can use its MCP tools across your preferred models while keeping your chat workflow organized in TypingMind.

How do I connect Context7 MCP to TypingMind?

Context7 can be connected in TypingMind by adding its hosted MCP server URL. This is useful when you want a remote MCP connection that is available from your TypingMind workspace.

What tools does Context7 MCP provide in TypingMind?

Context7 exposes 2 MCP tools that can be enabled from the TypingMind Plugins page and used in chat or assigned to AI agents.

Do I need to share my API keys with TypingMind to use Context7 MCP?

No. TypingMind is local-first and lets you keep your model providers, API keys, prompts, and MCP configuration under your control. If Context7 requires authentication, add the required headers, OAuth settings, or local configuration for that MCP server when you create the connection.

Related MCP Servers

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇