Skip to content

MCP Servers

MCP (Model Context Protocol) lets Claude connect to external tools. Think of MCPs as plugins that give Claude new abilities.

MCP servers are bridges between Claude and external systems:

  • Context7 - Access up-to-date documentation
  • Playwright - Browser automation and testing
  • Chrome DevTools - Inspect live browsers
  • GitHub - Interact with repos and PRs

For Python development:

MCP ServerPurposePriority
Context7Latest library documentationHigh
PlaywrightBrowser testing & automationHigh
Chrome DevToolsBrowser debuggingMedium
GitHubRepos, PRs, issuesMedium
  1. Add an MCP server

    Terminal window
    claude mcp add context7 -- npx -y @upstash/context7-mcp
  2. Verify installation

    Terminal window
    claude mcp list
  3. Use in conversation

    > use context7 to look up the latest FastAPI documentation for dependency injection

Context7 injects up-to-date, version-specific documentation into Claude’s context.

Terminal window
claude mcp add context7 -- npx -y @upstash/context7-mcp

Usage:

> use context7 to find the latest Vue 3 composition API docs
> use context7: how do I use Pydantic v2 model validators?

Playwright lets Claude interact with web pages for testing and automation.

Terminal window
claude mcp add playwright -- npx -y @playwright/mcp@latest

Usage:

> use playwright to test the login flow on localhost:3000
> write an E2E test that adds an item to cart and checks out

What Claude can do:

  • Navigate to URLs
  • Click buttons, fill forms
  • Take screenshots
  • Extract page content
  • Run tests

Inspect and debug live browser sessions.

Terminal window
claude mcp add chrome-devtools -- npx -y chrome-devtools-mcp@latest

Usage:

> inspect the network requests when I click the submit button
> check for console errors on the current page
> what's causing the layout shift on mobile?
Terminal window
claude mcp list
Terminal window
claude mcp remove context7
> /mcp disable postgres
> /mcp status

For projects with many MCP tools, Claude Code uses lazy loading: loads only tool metadata upfront (~100 tokens/tool), fetches full definitions on-demand. Automatically activates when tools would consume >10% of context.

Check status with /mcp list - tools using lazy loading are marked [lazy].

MCP_TIMEOUT - Server startup timeout in ms (default: 5000). Increase for slow-starting servers:

Terminal window
MCP_TIMEOUT=10000 claude

MAX_MCP_OUTPUT_TOKENS - MCP response limit (default: 25,000). Increase if responses get truncated:

Terminal window
MAX_MCP_OUTPUT_TOKENS=50000 claude

On native Windows (not WSL), prefix npx commands with cmd /c:

Terminal window
claude mcp add --transport stdio my-server -- cmd /c npx -y @some/package

For persistent configuration, edit ~/.claude/mcp.json:

{
"mcpServers": {
"context7": {
"command": "npx",
"args": ["-y", "@upstash/context7-mcp"]
},
"playwright": {
"command": "npx",
"args": ["-y", "@playwright/mcp@latest"]
},
"chrome-devtools": {
"command": "npx",
"args": ["-y", "chrome-devtools-mcp@latest"]
}
}
}

Create .mcp.json in your project root for team-shared MCP servers. Use ${VAR_NAME} for environment variables:

{
"mcpServers": {
"database": {
"command": "npx",
"args": ["-y", "@company/db-mcp-server"],
"env": {
"DB_HOST": "localhost"
}
},
"github": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-github"],
"env": {
"GITHUB_TOKEN": "${GITHUB_TOKEN}"
}
}
}
}

Variables are read from your environment at runtime. Don’t commit secrets!

Connect to remote MCP servers over HTTP using Server-Sent Events:

Terminal window
# CLI
claude mcp add --transport sse remote-api https://api.example.com/mcp/sse
# JSON config
{
"mcpServers": {
"remote-api": {
"type": "sse",
"url": "https://api.example.com/mcp/sse",
"headers": { "Authorization": "Bearer ${API_TOKEN}" }
}
}
}

Useful for company-hosted servers or cloud-based tool providers.

Limit Active MCPs - Choose 2-3 that match your current work. Too many MCPs consume context unnecessarily.

Use MCPs Explicitly - Tell Claude when to use an MCP:

> use context7 to check the SQLAlchemy 2.0 async syntax

Disable When Not Needed - MCPs consume context even when idle:

> /mcp disable postgres

Verify Critical Information - Context7 provides latest docs, but double-check for important decisions.

MCP Not Responding

Terminal window
claude mcp status context7 # Check status
claude mcp restart context7 # Restart server

Connection Errors - Verify network connectivity or connection strings.

Slow Responses - Reduce active MCPs, disable unused servers, or check for excessive data output.