zed-mcp-server-context7

MCP.Pizza Chef: akbxr

Installed from Zed's extension list, it fetches current documentation and code examples for whichever library you name, so the assistant stops suggesting functions that were removed two versions ago. The extension itself contains no tools of its own: it downloads and launches Upstash's official Context7 package, and the two tools you get come from there. A Context7 key is genuinely optional, and without one you simply get lower rate limits. Any key you do set is passed on the command line, where other programs on your machine can read it.

Coding
Web/Research

Use This MCP server To

Get code examples that match the library version I actually use Check how a function works without leaving my editor Stop the assistant suggesting functions that no longer exist Look up the current way to do something in a framework

README

Context7 MCP Server for Zed

This extension integrates Context7 as a Model Context Protocol (MCP) server for Zed's Assistant, providing up-to-date documentation for any prompt.

What is Context7?

Context7 pulls up-to-date, version-specific documentation and code examples straight from the source and places them directly into your prompt context.

❌ 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 fetches up-to-date, version-specific documentation and code examples straight from the source — and places them directly into your prompt.

Add use context7 to your question in Zed Assistant:

How do I use the new Next.js `after` function? use context7
How do I invalidate a query in React Query? use context7
How do I protect a route with NextAuth? use context7

How It Works

  • 1️⃣ Ask your question naturally
  • 2️⃣ Tell the LLM to use context7
  • 3️⃣ Get working code answers

No tab-switching, no hallucinated APIs that don't exist, no outdated code generations.

Installation

This extension can be installed from the Zed extension.

Agent Mode Configuration

If you're using Zed's agent mode, you need to enable this context server for your assistant:

  1. Open Zed's assistant settings
  2. Enable the Context7 MCP server. If you see that the status of the tool is a red dot, make sure you toggle it so that becomes green.
  3. Enable the Context7 MCP Server in the active assistant profile. In the chat section, click on the Write | Ask button, then click on tools, then enable the Context7 MCP Server.

Environment Variables (Optional)

  • context7_api_key: Set the Context7 API key.

Examples:

{
  "context_server": {
    "mcp-server-context7": {
      "source": "extension",
      "enabled": true,
      "settings": {
        "context7_api_key": "YOUR_CONTEXT7_API_KEY",
      }
    }
  }
}

Available Tools

The Context7 MCP Server provides these tools to the LLM:

  • resolve-library-id: Resolves a general library name into a Context7-compatible library ID.

    • libraryName (optional): Search and rerank results
  • get-library-docs: Fetches documentation for a library using a Context7-compatible library ID.

    • context7CompatibleLibraryID (required)
    • topic (optional): Focus the docs on a specific topic (e.g., "routing", "hooks")
    • tokens (optional, default 5000): Max number of tokens to return

Development

Clone the project and install dependencies:

cargo build

License

MIT

zed-mcp-server-context7 FAQ

Do I need a Context7 key?
No. It works without one, but you get low rate limits. A free key from the Context7 dashboard raises them, and paid plans raise them further.
Which apps does it work in?
Zed only, since it is a Zed extension. For other editors, install Upstash's Context7 package directly instead.
How hard is setup?
Easy. Install it from Zed's extension list, then switch it on in the assistant's tool settings. There are no files to edit unless you want to add a key.
Can I use this to get current docs for a library?
Yes — add the words "use context7" to your question and it pulls current documentation and examples for the library you name.
Is my key stored safely?
Not really. It sits in your Zed settings in plain text and is handed to the server as a command-line argument, which other programs on the same machine can read from the process list.
Does this project do the documentation lookup itself?
No. It is a thin wrapper of about a hundred lines that installs and starts Upstash's Context7 package. All the actual lookup happens there.
Is it kept up to date?
The wrapper has not changed since October 2025, but it pulls the newest Context7 package each time it runs, so the underlying tool stays current.
Why is it slow to start?
A version check in the code can never match, so it re-downloads and re-installs the Context7 package from the internet every single time the server starts.