Overview
MCP (Model Context Protocol) servers extend Claude Code with external integrations like live documentation, browser automation, database access, and more. Configure servers at user, project, or agent scope.Configuration Scopes
User Scope
~/.claude.json - Personal MCP servers available in all projectsProject Scope
.mcp.json - Team-shared servers for the project (requires approval)Agent Scope
Agent frontmatter - Servers available only to specific agents
Basic Configuration
Server Definition Structure
Executable to run (e.g.,
npx, node, python, absolute path)Command-line arguments passed to the executable
Environment variables for the MCP server processSupports variable substitution:
${VAR_NAME} reads from shell environmentHuman-readable description (ignored by parser)
Approval Settings
Control how project MCP servers are authorized:Auto-approve all servers from
.mcp.jsonAllowlist of approved project MCP server names
Blocklist of denied project MCP server names
Permission Rules for MCP
Control MCP tool invocation using permission rules:MCP(server-name:tool-name)
MCP(github:*)- All tools from github serverMCP(*:*)- All MCP tools from any serverMCP(playwright:navigate)- Only the navigate tool
Recommended MCP Servers
Daily Use
Servers recommended for everyday development:context7 - Live Documentation
context7 - Live Documentation
Package: Use cases:
@upstash/context7-mcp@latestQuery live documentation from 100+ sources (React, Next.js, TypeScript, etc.) to eliminate API guessing.- Check latest API signatures
- Verify deprecations
- Find correct import paths
playwright - Browser Automation
playwright - Browser Automation
Package: Use cases:
@anthropic/mcp-playwrightE2E testing and browser automation. Token-efficient compared to other browser MCPs (~13.7k tokens avg).- Write E2E tests
- Debug UI issues
- Automate browser tasks
github - Repository Operations
github - Repository Operations
Package: Use cases:
@modelcontextprotocol/server-githubPRs, issues, code search, and repository management.- Create and manage PRs
- Search across repositories
- Update issues and comments
repo scope and set GITHUB_TOKEN environment variable.Add When Needed
Specialized servers for specific use cases:| Server | Package | Use Case |
|---|---|---|
| supabase | @upstash/supabase-mcp | Database operations (when using Supabase) |
| linear | @linear/mcp-server | Issue tracking (when using Linear) |
| slack | @modelcontextprotocol/server-slack | Team notifications (when using Slack) |
| filesystem | @modelcontextprotocol/server-filesystem | Advanced file operations |
| postgres | @modelcontextprotocol/server-postgres | Direct PostgreSQL access |
| sqlite | @modelcontextprotocol/server-sqlite | SQLite database operations |
Wisdom: Start with 3 MCPs (context7, playwright, github). Add only when you hit a concrete need. Most developers who start with 10+ end up using 3-4 daily.
Agent-Specific MCP Servers
Configure MCP servers that only specific agents can access:Why agent-specific servers?
Why agent-specific servers?
- Performance: Only load heavy MCPs when needed
- Security: Restrict sensitive operations to specific agents
- Context efficiency: Avoid polluting general agent context with specialized tools
Environment Variables
MCP servers often require credentials and configuration:${VAR_NAME} reads from your shell environment.
Custom MCP Servers
Run your own MCP server implementation:Debugging MCP Servers
If an MCP server isn’t working:Performance Considerations
Token Usage
MCP tools contribute to context usage:| Server | Avg Token Impact | Notes |
|---|---|---|
| context7 | Low (~2-5k) | Fetches targeted docs |
| playwright | Medium (~14k) | Includes browser state |
| github | Medium (~10-15k) | Large API responses |
| filesystem | Low (~1-3k) | Depends on file size |
| postgres | High (~20k+) | Query results can be large |
Minimize token usage
Minimize token usage
- Request only needed data (use filters, limits)
- Use context7 instead of loading entire docs
- Clear context with
/compactafter heavy MCP operations - Consider agent-specific MCPs to isolate heavy tools
Startup Time
MCP servers add initialization overhead:- npx servers: ~2-5 seconds (download + start)
- local binaries: ~100-500ms (start only)
- Agent-specific: Only pay cost when agent spawns
Example Configurations
Next Steps
Settings
Configure core Claude Code behavior
Permissions
Fine-tune MCP tool access control
Agent Configuration
Set up agent-specific MCP servers