MCP Servers
MCP (Model Context Protocol) lets Claude connect to external tools. Think of MCPs as plugins that give Claude new abilities.
What Are MCP Servers?
Section titled “What Are MCP Servers?”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
Recommended MCPs
Section titled “Recommended MCPs”For Python development:
| MCP Server | Purpose | Priority |
|---|---|---|
| Context7 | Latest library documentation | High |
| Playwright | Browser testing & automation | High |
| Chrome DevTools | Browser debugging | Medium |
| GitHub | Repos, PRs, issues | Medium |
Installing MCP Servers
Section titled “Installing MCP Servers”-
Add an MCP server
Terminal window claude mcp add context7 -- npx -y @upstash/context7-mcp -
Verify installation
Terminal window claude mcp list -
Use in conversation
> use context7 to look up the latest FastAPI documentation for dependency injection
Detailed Setup
Section titled “Detailed Setup”Context7 - Documentation Access
Section titled “Context7 - Documentation Access”Context7 injects up-to-date, version-specific documentation into Claude’s context.
claude mcp add context7 -- npx -y @upstash/context7-mcpUsage:
> use context7 to find the latest Vue 3 composition API docs
> use context7: how do I use Pydantic v2 model validators?Playwright - Browser Automation
Section titled “Playwright - Browser Automation”Playwright lets Claude interact with web pages for testing and automation.
claude mcp add playwright -- npx -y @playwright/mcp@latestUsage:
> use playwright to test the login flow on localhost:3000
> write an E2E test that adds an item to cart and checks outWhat Claude can do:
- Navigate to URLs
- Click buttons, fill forms
- Take screenshots
- Extract page content
- Run tests
Chrome DevTools - Browser Debugging
Section titled “Chrome DevTools - Browser Debugging”Inspect and debug live browser sessions.
claude mcp add chrome-devtools -- npx -y chrome-devtools-mcp@latestUsage:
> 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?Managing MCP Servers
Section titled “Managing MCP Servers”List Active Servers
Section titled “List Active Servers”claude mcp listRemove a Server
Section titled “Remove a Server”claude mcp remove context7Disable Temporarily
Section titled “Disable Temporarily”> /mcp disable postgresCheck Status
Section titled “Check Status”> /mcp statusMCP Tool Search
Section titled “MCP Tool Search”When MCP tool descriptions exceed 10% of your context window, Claude Code automatically defers them and loads tools on-demand via tool search. Since deferred tools only enter context when actually used, this keeps idle tool definitions from consuming space.
Tune the threshold:
# Trigger tool search at 5% instead of default 10%ENABLE_TOOL_SEARCH=auto:5 claudeA lower threshold means fewer idle tool definitions consuming context, which can reduce costs.
Check status with /mcp list — tools using deferred loading show their status.
Environment Variables
Section titled “Environment Variables”MCP_TIMEOUT - Server startup timeout in ms (default: 5000). Increase for slow-starting servers:
MCP_TIMEOUT=10000 claudeMAX_MCP_OUTPUT_TOKENS - MCP response limit (default: 25,000). Increase if responses get truncated:
MAX_MCP_OUTPUT_TOKENS=50000 claudeWindows Configuration
Section titled “Windows Configuration”On native Windows (not WSL), prefix npx commands with cmd /c:
claude mcp add --transport stdio my-server -- cmd /c npx -y @some/packageMCP Configuration File
Section titled “MCP Configuration File”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"] } }}Project-Level MCP Configuration
Section titled “Project-Level MCP Configuration”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!
Remote MCP Servers (HTTP/SSE)
Section titled “Remote MCP Servers (HTTP/SSE)”Connect to remote MCP servers over HTTP using Server-Sent Events:
# CLIclaude 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.
When Not to Use MCP
Section titled “When Not to Use MCP”If a CLI tool exists for your use case, prefer it over MCP:
| Instead of MCP for… | Use CLI |
|---|---|
| GitHub operations | gh (GitHub CLI) |
| AWS operations | aws CLI |
| Google Cloud | gcloud CLI |
| Error tracking | sentry-cli |
| Database queries | psql, mysql, etc. |
Claude can run CLI commands directly without the overhead. Reserve MCP for capabilities that don’t have good CLI equivalents (browser automation, live documentation, etc.).
Best Practices
Section titled “Best Practices”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 syntaxDisable When Not Needed - MCPs consume context even when idle:
> /mcp disable postgresVerify Critical Information - Context7 provides latest docs, but double-check for important decisions.
Troubleshooting
Section titled “Troubleshooting”MCP Not Responding
claude mcp status context7 # Check statusclaude mcp restart context7 # Restart serverConnection Errors - Verify network connectivity or connection strings.
Slow Responses - Reduce active MCPs, disable unused servers, or check for excessive data output.