Skip to main content

All MCP Clients

Context7 MCP Server is compatible with 30+ MCP clients. Below are installation instructions for popular clients.
For the most up-to-date list of supported clients and installation instructions, visit context7.com/docs/resources/all-clients

Cursor

Install in Cursor IDE

Claude Code

Install in Claude Code

Opencode

Install in Opencode

Cursor

Cursor is one of the most popular AI-powered code editors. Remote Server:
{
  "mcpServers": {
    "context7": {
      "url": "https://mcp.context7.com/mcp",
      "headers": {
        "CONTEXT7_API_KEY": "YOUR_API_KEY"
      }
    }
  }
}
Local Server:
{
  "mcpServers": {
    "context7": {
      "command": "npx",
      "args": ["-y", "@upstash/context7-mcp", "--api-key", "YOUR_API_KEY"]
    }
  }
}
Full Cursor Setup Guide →

Claude Code

Official AI coding assistant from Anthropic. Local Server:
claude mcp add --scope user context7 -- npx -y @upstash/context7-mcp --api-key YOUR_API_KEY
Remote Server:
claude mcp add --scope user --header "CONTEXT7_API_KEY: YOUR_API_KEY" --transport http context7 https://mcp.context7.com/mcp
Full Claude Code Setup Guide →

Opencode

Open-source AI coding assistant. Remote Server:
{
  "mcp": {
    "context7": {
      "type": "remote",
      "url": "https://mcp.context7.com/mcp",
      "headers": {
        "CONTEXT7_API_KEY": "YOUR_API_KEY"
      },
      "enabled": true
    }
  }
}
Local Server:
{
  "mcp": {
    "context7": {
      "type": "local",
      "command": ["npx", "-y", "@upstash/context7-mcp", "--api-key", "YOUR_API_KEY"],
      "enabled": true
    }
  }
}
Full Opencode Setup Guide →

Cline (VSCode Extension)

AI coding assistant for Visual Studio Code. Configuration Location: VSCode Settings → MCP Settings
{
  "mcpServers": {
    "context7": {
      "command": "npx",
      "args": ["-y", "@upstash/context7-mcp", "--api-key", "YOUR_API_KEY"]
    }
  }
}

Roo Code (VSCode Extension)

Another popular VSCode AI assistant. Configuration Location: VSCode Settings → MCP Settings
{
  "mcpServers": {
    "context7": {
      "command": "npx",
      "args": ["-y", "@upstash/context7-mcp", "--api-key", "YOUR_API_KEY"]
    }
  }
}

Continue.dev

Open-source AI code assistant. Configuration Location: ~/.continue/config.json
{
  "mcpServers": {
    "context7": {
      "command": "npx",
      "args": ["-y", "@upstash/context7-mcp", "--api-key", "YOUR_API_KEY"]
    }
  }
}

Zed Editor

High-performance collaborative code editor. Configuration Location: Zed Settings → MCP
{
  "context_servers": {
    "context7": {
      "command": "npx",
      "args": ["-y", "@upstash/context7-mcp", "--api-key", "YOUR_API_KEY"]
    }
  }
}

Windsurf

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

Claude Desktop

Standalone Claude application with MCP support. Configuration Location:
  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%/Claude/claude_desktop_config.json
{
  "mcpServers": {
    "context7": {
      "command": "npx",
      "args": ["-y", "@upstash/context7-mcp", "--api-key", "YOUR_API_KEY"]
    }
  }
}

Sourcegraph Cody

AI coding assistant with deep codebase understanding.
{
  "mcpServers": {
    "context7": {
      "command": "npx",
      "args": ["-y", "@upstash/context7-mcp", "--api-key", "YOUR_API_KEY"]
    }
  }
}

Installation Patterns

Most MCP clients follow one of these patterns:

Pattern 1: stdio (Local)

Local execution using npx and standard input/output:
{
  "mcpServers": {
    "context7": {
      "command": "npx",
      "args": ["-y", "@upstash/context7-mcp", "--api-key", "YOUR_API_KEY"]
    }
  }
}

Pattern 2: HTTP (Remote)

Remote connection via HTTPS:
{
  "mcpServers": {
    "context7": {
      "url": "https://mcp.context7.com/mcp",
      "headers": {
        "CONTEXT7_API_KEY": "YOUR_API_KEY"
      }
    }
  }
}

Pattern 3: Environment Variables

Using environment variables for API keys:
{
  "mcpServers": {
    "context7": {
      "command": "npx",
      "args": ["-y", "@upstash/context7-mcp"],
      "env": {
        "CONTEXT7_API_KEY": "YOUR_API_KEY"
      }
    }
  }
}

Automated Setup

The Context7 CLI can automatically configure many popular clients:
# Auto-detect and configure
npx ctx7 setup

# Target specific client
npx ctx7 setup --cursor
npx ctx7 setup --claude
npx ctx7 setup --opencode

Authentication Options

All clients support both authentication methods:
Get a free API key at context7.com/dashboardPass via command line:
--api-key YOUR_API_KEY
Pass via environment variable:
export CONTEXT7_API_KEY="YOUR_API_KEY"
Pass via header (remote only):
"headers": {
  "CONTEXT7_API_KEY": "YOUR_API_KEY"
}

Testing Installation

After installation, test Context7 with this prompt:
Create a Next.js middleware that checks for a valid JWT in cookies. use context7
You should see:
  1. Context7 tools being invoked
  2. Library resolution (e.g., finding Next.js)
  3. Documentation retrieval
  4. Generated code with up-to-date APIs

Troubleshooting

  1. Check JSON syntax in configuration file
  2. Verify configuration file location is correct
  3. Restart the client application
  4. Check client logs for error messages
  1. Verify API key format (should start with ctx7sk)
  2. Regenerate API key at context7.com/dashboard
  3. Check header/environment variable names match
For local (stdio):
  • Ensure Node.js is installed
  • Clear npx cache: npx clear-npx-cache
  • Test manually: npx -y @upstash/context7-mcp
For remote (HTTP):
  • Check internet connectivity
  • Test endpoint: curl https://mcp.context7.com/ping
  • Verify firewall settings

Additional Resources

Configuration Guide

Advanced configuration options

Troubleshooting

Common issues and solutions

MCP Specification

Learn about the MCP protocol

Discord Community

Get help from the community

Can’t Find Your Client?

If your MCP client isn’t listed here:
  1. Check the client’s MCP documentation
  2. Try the standard stdio or HTTP configuration patterns
  3. Visit context7.com/docs/resources/all-clients for the complete list
  4. Ask in our Discord community
Most MCP clients follow similar configuration patterns, so you can usually adapt one of the examples above.

Build docs developers (and LLMs) love