MCP Directory

How to add Context7 MCP Server to Windsurf

Up-to-date, version-specific library documentation injected into your coding agent. Paste the config into ~/.codeium/windsurf/mcp_config.json and restart Windsurf.

Last updated June 15, 2026 · 28k · stdio · apikey · official

Windsurf config for Context7 MCP Server

npx -y @upstash/context7-mcp
{
  "mcpServers": {
    "context7-mcp-server": {
      "command": "npx",
      "args": [
        "-y",
        "@upstash/context7-mcp"
      ],
      "env": {
        "CONTEXT7_API_KEY": "<optional-your-context7-api-key>"
      }
    }
  }
}

Setup steps

  1. 1Open Windsurf → Cascade → the hammer/MCP icon → Configure (or edit ~/.codeium/windsurf/mcp_config.json).
  2. 2Paste the Context7 MCP Server config below.
  3. 3Fill in placeholder secrets, then save.
  4. 4Click Refresh in the MCP panel.
  5. 5Context7 MCP Server's tools become available to Cascade.

Before you start

  • Node.js 18 or newer (for the local stdio server via npx)
  • An MCP-capable client (Cursor, Claude Code, Claude Desktop, VS Code, Windsurf, OpenCode, and 30+ others)
  • A free Context7 API key from https://context7.com/dashboard for higher rate limits (optional but recommended; passed via the CONTEXT7_API_KEY header or --api-key)

What Context7 MCP Server can do in Windsurf

resolve-library-id

Resolves a plain library name into a Context7-compatible ID (e.g. next.js -> /vercel/next.js), ranking matches by trust score and doc coverage.

query-docs

Fetches up-to-date, version-specific documentation and code examples for a given Context7 library ID and topic/query (current upstream tool name; some clients/mirrors expose it as get-library-docs).

Security

Basic use needs no credentials; an optional CONTEXT7_API_KEY only raises rate limits and should be kept secret. The server fetches third-party documentation, so treat returned content as untrusted input.

Context7 MCP Server + Windsurf FAQ

Where is the Windsurf config file?

Windsurf reads MCP servers from ~/.codeium/windsurf/mcp_config.json. Paste the Context7 MCP Server config there under the "mcpServers" key and restart the client.

Is Context7 MCP Server safe to use with Windsurf?

Basic use needs no credentials; an optional CONTEXT7_API_KEY only raises rate limits and should be kept secret. The server fetches third-party documentation, so treat returned content as untrusted input.

Do I need an API key?

You can use Context7 without one, but a free key from context7.com/dashboard raises rate limits and is recommended; pass it via the CONTEXT7_API_KEY header or --api-key flag.

Can I run it remotely instead of installing it?

Yes. Point your client at the hosted endpoint https://mcp.context7.com/mcp and supply your API key in the header, no local Node required.

What's the resolve-library-id step for?

It maps a human library name to a precise Context7 ID. You must call it before fetching docs unless you already pass an ID in /org/project or /org/project/version form.

View repo Full Context7 MCP Server page