Get the FREE Ultimate OpenClaw Setup Guide →

zed -context7

Context7 MCP Server for Zed

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio akbxr-zed-mcp-server-context7 cargo run --bin mcp-server-context7 \
  --env CONTEXT7_API_KEY="YOUR_CONTEXT7_API_KEY"

How to use

Context7 MCP Server for Zed exposes an MCP integration that lets Zed's assistant fetch up-to-date, version-specific documentation and code examples from Context7 directly into prompts. After enabling the Context7 MCP server in Zed, you can ask questions and append use context7 to pull live docs and examples into your response. The server provides two main tools: get-library-docs, which fetches documentation for a given library using a Context7-compatible library ID, and resolve-library-id, which converts a general library name into a Context7-ready identifier. Use these in tandem to first resolve a library and then retrieve focused docs on topics like routing, hooks, or authentication. This setup helps you avoid outdated APIs and code samples by surfacing current, source-backed guidance during prompt construction.

How to install

Prerequisites:

  • Rust toolchain with cargo installed (rustup + cargo)
  • Access to Context7 API key (optional, for full functionality)

Installation steps:

  1. Install Rust and Cargo

    • On macOS: brew install rustup-init; rustup-init
    • On Linux: curl https://sh.rustup.rs -sSf | sh
    • On Windows: install from rustup official installer
  2. Clone the MCP server repository for Context7 (or navigate to the project directory if already cloned)

  3. Build the MCP server binary

    • cd path/to/zed-mcp-server-context7
    • cargo build --release
  4. Run the MCP server (example)

    • cargo run --bin mcp-server-context7
  5. Configure the host to point to the running MCP server as per your environment (e.g., in Zed, enable the Context7 MCP Server and set the correct endpoint if required)

Note: If you already have a prebuilt binary, you can skip the build step and run the binary directly, adjusting the command as needed for your environment.

Additional notes

Environment variables and configuration tips:

  • Context7 API key can be provided via CONTEXT7_API_KEY. If omitted, some features may be limited.
  • Ensure the MCP server endpoint is accessible to Zed (consider network/firewall settings).
  • If you see outdated docs, verify that the Context7 API key is valid and that the library IDs resolved by resolve-library-id correspond to the libraries you intend to query.
  • In agent mode, ensure the Context7 MCP server is enabled in both the assistant settings and the active profile's tools configuration.
  • The get-library-docs tool supports topics like routing, hooks, and authentication; you can pass topic and tokens to control the scope and length of the docs returned.
  • For debugging, check cargo build/run logs for any missing dependencies or API errors and ensure your environment has network access to Context7 endpoints.

Related MCP Servers

Sponsor this space

Reach thousands of developers