Fire in da houseTop Tip:Paying $100+ per month for Perplexity, MidJourney, Runway, ChatGPT and other tools is crazy - get all your AI tools in one site starting at $15 per month with Galaxy AI Fire in da houseCheck it out free

zed-mcp-server-context7

MCP.Pizza Chef: akbxr

The Context7 MCP Server for Zed integrates Context7 as a Model Context Protocol server, delivering real-time, version-specific documentation and code examples directly into prompt contexts. It ensures that LLMs access accurate, current library information, avoiding outdated examples and hallucinated APIs. This server enhances Zed Assistant by embedding precise source-based knowledge, improving code assistance and developer workflows.

Use This MCP server To

Provide real-time, version-specific library documentation in prompts Embed up-to-date code examples from source into developer queries Prevent LLM hallucinations with accurate API references Enhance coding assistants with current package version info Support developers with precise, context-rich programming help Integrate live documentation into AI-powered code completion

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)

  • DEFAULT_MINIMUM_TOKENS: Set the minimum token count for documentation retrieval (default: 10000).

Examples:

{
  "context_server": {
    "mcp-server-context7": {
      "settings": {
        "default_minimum_tokens": "10000"
      }
    }
  }
}

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

How does Context7 MCP Server keep documentation up-to-date?
It fetches version-specific docs and code examples directly from the source repositories in real time.
Can I use Context7 MCP Server with any programming language?
Context7 primarily supports popular libraries and frameworks with available source documentation; coverage depends on the source availability.
How do I activate Context7 in Zed Assistant?
Simply add 'use context7' to your prompt to include up-to-date documentation in the response.
Does Context7 MCP Server reduce LLM hallucinations?
Yes, by providing accurate, source-based documentation, it minimizes hallucinated or outdated API information.
Is Context7 MCP Server compatible with multiple LLM providers?
Yes, it works with various LLMs like OpenAI, Anthropic Claude, and Google Gemini by supplying reliable context.
What happens if the source documentation changes?
Context7 dynamically updates the context it provides, ensuring the latest information is always used.
Can Context7 MCP Server be extended to custom libraries?
Extension depends on the availability of source documentation and integration capabilities with Context7.