Skip to content

MCP server

Context7 MCP server

Upstash's Context7 MCP server gives coding assistants current, version-specific documentation for thousands of libraries.

At a glance

Maintained by
Upstash
Tools exposed
2 listed below
Reviewed
September 24, 2026

Why it matters

What it does and why it matters

Coding assistants learn from code that may be months or years old. When a library changes its API, they keep suggesting the old way. Context7 solves that by fetching current, version-specific documentation and examples for the library in question and handing them to the assistant.

It has two tools: one finds the right library, and one queries its documentation. The result is code that matches the version you actually use.

It is maintained by Upstash and reads only public library documentation, so the risk is low. The documentation tool was renamed from its earlier name to query-docs, so older guides may show a different name. An API key raises rate limits.

We use documentation servers like this in our own AI-accelerated development, because they cut the time spent fixing outdated suggestions.

Use cases

Best business use cases

Current APIs

Write code for the library version you use.

Upgrades

Check what changed before upgrading a library.

Quick answers

Answer "how do I do X in library Y" from real docs.

Onboarding

Help new developers learn a framework faster.

Fixing deprecated code

Replace deprecated calls with current ones.

Tools

Available tools

Tool names as published by the maintainer at review time. Versions change, so check the repository for the current list.

Read and write: Read only: fetches public library documentation.

  • resolve-library-id

    Turn a library name into a Context7 library ID.

  • query-docs

    Get current documentation for a library by its Context7 ID.

Workflows

Example workflows

Use a new library correctly

  1. 1

    Ask how to use a feature in a library.

  2. 2

    The assistant resolves the library ID.

  3. 3

    It queries the current docs.

  4. 4

    It writes code based on them.

  5. 5

    A developer tests and reviews.

Prepare an upgrade

  1. 1

    Name the library and target version.

  2. 2

    The assistant reads the docs for that version.

  3. 3

    It lists breaking changes that affect your code.

  4. 4

    It drafts the changes.

  5. 5

    The team tests the upgrade.

Prompts

Example prompts

  • “Using the current Next.js docs, show how to add a server action to this form.”

  • “What changed in this library between version 4 and 5?”

  • “Rewrite this code to avoid deprecated calls, based on the current docs.”

Setup

Installation and configuration

Examples for Claude Desktop and Claude Code. Replace the placeholder values with your own keys, and store secrets outside version control.

Claude Desktop: claude_desktop_config.json

{
    "mcpServers": {
        "context7": {
            "command": "npx",
            "args": [
                "-y",
                "@upstash/context7-mcp",
                "--api-key",
                "YOUR_API_KEY"
            ]
        }
    }
}

Claude Code: terminal

claude mcp add --scope user --header "Authorization: Bearer YOUR_API_KEY" --transport http context7 https://mcp.context7.com/mcp
  • Hosted server: streamable-http; https://mcp.context7.com/mcp; Header Authorization: Bearer YOUR_API_KEY (recommended for higher rate limits).
  • Local server: stdio; @upstash/context7-mcp.
  • Needs: Context7 API key (optional, recommended; free at context7.com/dashboard).

Security

Security considerations

  • Public docs only

    It reads public documentation, so data risk is low.

  • API key

    Keep the optional key out of shared files.

  • Review code

    Review generated code as usual.

  • Untrusted content

    Docs are external content. Do not let them trigger actions.

Related servers

Servers that pair well with it

GitHub

GitHub's official MCP server lets AI read repositories, search code, manage issues and pull requests and, when allowed, change files.

Fetch

The MCP project's reference Fetch server lets AI download a web page and read it as clean text or markdown.

Sequential Thinking

The MCP project's Sequential Thinking reference server gives AI a structured way to break a problem into steps and revise them.

Keep exploring

FAQ

Questions people ask us

Have a question that is not here? Ask us directly.

Start a project

Want this connected to your own systems? We build AI workflows with MCP.

Send a short brief. We reply with questions, a suggested plan and an estimate you can compare with other offers.

Your privacy choices

We use necessary storage to run this site. With your permission we also use Google Analytics to see which pages help people, and load maps from Google. You can change this at any time. Read the cookie policy.