Learn MCP Server
A comprehensive guide to installing and configuring Model Context Protocol (MCP) servers for Claude Code, Zed, and Visual Studio Code. MCP servers provide AI assistants with access to external tools, APIs, and documentation.
What is MCP?
Section titled “What is MCP?”Model Context Protocol (MCP) is an open protocol that enables AI assistants to:
- Access external APIs and services
- Query documentation in real-time
- Interact with development tools
- Extend capabilities beyond basic code editing
Benefits of MCP Servers
Section titled “Benefits of MCP Servers”Prerequisites
Section titled “Prerequisites”Before installing MCP servers, ensure you have:
- Node.js 18+ or Bun installed
- Claude Code, Zed, or VS Code installed
- Basic command line knowledge
- API keys for services you want to use optional
Check Your Environment
Section titled “Check Your Environment”# Check Bun versionbun --version # Any recent version# Check Node.js versionnode --version # Should be v18.0.0 or higher
# Check npmnpm --versionInstallation Methods
Section titled “Installation Methods”MCP servers can be installed in two ways:
1. HTTP-based MCP Servers
Section titled “1. HTTP-based MCP Servers”- Hosted remotely
- No local installation required
- Just add URL to config
- Examples: Sentry, Astro Docs, Exa, Neon
2. Command-based MCP Servers
Section titled “2. Command-based MCP Servers”- Run locally via npm/npx
- More control and customization
- Examples: shadcn, custom servers
Installation by Editor
Section titled “Installation by Editor”Claude Code
Section titled “Claude Code”Configuration File Location
Section titled “Configuration File Location”Claude Code stores MCP configuration in:
~/.config/claude/claude_desktop_config.json%APPDATA%\Claude\claude_desktop_config.json-
Create Configuration File
If the file doesn’t exist, create it:
Terminal window mkdir -p ~/.config/claudetouch ~/.config/claude/claude_desktop_config.jsonTerminal window New-Item -Path "$env:APPDATA\Claude" -ItemType Directory -ForceNew-Item -Path "$env:APPDATA\Claude\claude_desktop_config.json" -ItemType File -
Add MCP Server Configuration
Open the configuration file and add:
claude_desktop_config.json {"mcpServers": {"sentry": {"type": "http","url": "https://mcp.sentry.dev/mcp"},"astro-docs": {"type": "http","url": "https://mcp.docs.astro.build/mcp"},"exa": {"type": "http","url": "https://mcp.exa.ai/mcp","headers": {}},"neon": {"type": "http","url": "https://mcp.neon.tech/mcp"},"shadcn": {"command": "npx","args": ["shadcn@latest","mcp"]}}} -
Add API Keys Optional
Some MCP servers require authentication. Add headers:
claude_desktop_config.json {"mcpServers": {"exa": {"type": "http","url": "https://mcp.exa.ai/mcp","headers": {"Authorization": "Bearer YOUR_EXA_API_KEY"}},"neon": {"type": "http","url": "https://mcp.neon.tech/mcp","headers": {"Authorization": "Bearer YOUR_NEON_API_KEY"}}}} -
Restart Claude Code
Terminal window # Quit Claude Code completely (Cmd+Q)# Then relaunch from ApplicationsTerminal window pkill claude-codeclaude-code# Close Claude Code completely# Then restart from Start Menu -
Verify Installation
- Open Claude Code
- Start a new conversation
- Type: “Can you access Astro documentation?”
- Claude should respond with access to Astro docs
Zed Editor
Section titled “Zed Editor”Configuration File Location
Section titled “Configuration File Location”Zed stores MCP configuration in:
~/.config/zed/settings.json%APPDATA%\Zed\settings.json-
Open Zed Settings
Cmd+Shift+P (macOS) or Ctrl+Shift+P (Windows/Linux)Type: "zed: open settings"Zed > Settings > Open Settings (JSON)Cmd+, (macOS) or Ctrl+, (Windows/Linux)Click "Open settings.json" at bottom -
Add MCP Configuration
Add or merge this into your
settings.json:settings.json {"assistant": {"version": "2","provider": {"name": "anthropic","default_model": {"model": "claude-3-5-sonnet-20241022"}}},"context_servers": {"sentry": {"type": "http","url": "https://mcp.sentry.dev/mcp"},"astro-docs": {"type": "http","url": "https://mcp.docs.astro.build/mcp"},"exa": {"type": "http","url": "https://mcp.exa.ai/mcp","headers": {}},"neon": {"type": "http","url": "https://mcp.neon.tech/mcp"},"shadcn": {"command": "npx","args": ["shadcn@latest","mcp"]}}} -
Add API Keys Optional
settings.json {"context_servers": {"exa": {"type": "http","url": "https://mcp.exa.ai/mcp","headers": {"Authorization": "Bearer YOUR_EXA_API_KEY"}}}} -
Reload Zed
Cmd+Shift+P (macOS) or Ctrl+Shift+P (Windows/Linux)Type: "zed: reload"Completely close and restart Zed
-
Verify Installation
- Open Zed Assistant (Cmd+Shift+A or Ctrl+Shift+A)
- Ask: “Can you search the Astro documentation?”
- Assistant should confirm access to MCP servers
Visual Studio Code
Section titled “Visual Studio Code”Configuration with Continue Extension
Section titled “Configuration with Continue Extension”VS Code uses MCP through the Continue extension.
-
Install Continue Extension
- Open VS Code
- Click Extensions icon (Cmd+Shift+X)
- Search “Continue”
- Click “Install” on “Continue - AI Code Assistant”
Terminal window code --install-extension continue.continue -
Configuration File Location
Continue stores config in:
Terminal window ~/.continue/config.jsonTerminal window %USERPROFILE%\.continue\config.json -
Create/Edit Configuration
Open the config file:
Cmd+Shift+P (macOS) or Ctrl+Shift+P (Windows/Linux)Type: "Continue: Open Config"Terminal window code ~/.continue/config.jsonTerminal window code %USERPROFILE%\.continue\config.json -
Add MCP Configuration
Add to your
config.json:config.json {"models": [{"title": "Claude 3.5 Sonnet","provider": "anthropic","model": "claude-3-5-sonnet-20241022","apiKey": "YOUR_ANTHROPIC_API_KEY"}],"contextProviders": [{"name": "mcp","params": {"servers": {"sentry": {"type": "http","url": "https://mcp.sentry.dev/mcp"},"astro-docs": {"type": "http","url": "https://mcp.docs.astro.build/mcp"},"exa": {"type": "http","url": "https://mcp.exa.ai/mcp","headers": {}},"neon": {"type": "http","url": "https://mcp.neon.tech/mcp"},"shadcn": {"command": "npx","args": ["shadcn@latest","mcp"]}}}}]} -
Reload VS Code Window
Cmd+Shift+P (macOS) or Ctrl+Shift+P (Windows/Linux)Type: "Developer: Reload Window" -
Verify Installation
- Open Continue chat (Cmd+Shift+L or Ctrl+Shift+L)
- Type: “@mcp Can you access Astro docs?”
- Continue should respond with MCP access
Recommended MCP Servers
Section titled “Recommended MCP Servers”1. Sentry MCP Server
Section titled “1. Sentry MCP Server”Purpose: Error tracking and monitoring integration
Features:
- Query error logs
- Check issue status
- Get performance metrics
- Access release information
{ "sentry": { "type": "http", "url": "https://mcp.sentry.dev/mcp" }}Use Cases:
- “Show me recent errors in production”
- “What’s the error rate for the last deployment?”
- “Get details about error ID 123456”
API Key Required No (for public data), Yes (for private projects)
2. Astro Docs MCP Server
Section titled “2. Astro Docs MCP Server”Purpose: Real-time access to Astro documentation
Features:
- Search Astro documentation
- Get latest API references
- Access guides and tutorials
- Query best practices
{ "astro-docs": { "type": "http", "url": "https://mcp.docs.astro.build/mcp" }}Use Cases:
- “How do I configure Astro for Cloudflare?”
- “What are the latest Astro 5 features?”
- “Show me Astro routing examples”
API Key Required No
3. Exa Search MCP Server
Section titled “3. Exa Search MCP Server”Purpose: AI-powered web search for developers
Features:
- Semantic code search
- Find technical documentation
- Discover libraries and tools
- Search GitHub repositories
{ "exa": { "type": "http", "url": "https://mcp.exa.ai/mcp", "headers": { "Authorization": "Bearer YOUR_EXA_API_KEY" } }}Use Cases:
- “Find React component libraries for dashboards”
- “Search for Tailwind CSS animation examples”
- “What are the best practices for Drizzle ORM?”
API Key Required Yes
Get API Key: https://exa.ai
4. Neon MCP Server
Section titled “4. Neon MCP Server”Purpose: PostgreSQL database management
Features:
- Query database schema
- Run SQL queries
- Manage database branches
- Monitor connection pools
{ "neon": { "type": "http", "url": "https://mcp.neon.tech/mcp", "headers": { "Authorization": "Bearer YOUR_NEON_API_KEY" } }}Use Cases:
- “Show me the schema for the users table”
- “Create a new database branch for testing”
- “What are the current connection pool stats?”
API Key Required Yes
Get API Key: https://neon.tech/dashboard > API Keys
5. shadcn MCP Server
Section titled “5. shadcn MCP Server”Purpose: shadcn/ui component CLI integration
Features:
- Browse available components
- Get component installation commands
- Access component documentation
- Check component dependencies
{ "shadcn": { "command": "npx", "args": [ "shadcn@latest", "mcp" ] }}Use Cases:
- “How do I add the dialog component?”
- “What shadcn components are available?”
- “Show me the button component documentation”
API Key Required No
Getting API Keys
Section titled “Getting API Keys”Exa API Key
Section titled “Exa API Key”- Visit https://exa.ai
- Click “Sign Up” or “Get API Key”
- Create account (GitHub sign-in available)
- Navigate to Dashboard > API Keys
- Click “Create New API Key”
- Copy the key (starts with
exa_)
Free Tier 1,000 requests/month
Neon API Key
Section titled “Neon API Key”- Visit https://neon.tech
- Sign in to your account
- Go to Account Settings > API Keys
- Click “Create API Key”
- Give it a name (e.g., “MCP Server”)
- Copy the key
Free Tier 10 GB storage, 100 hours compute/month
Sentry API Key Optional
Section titled “Sentry API Key ”- Visit https://sentry.io
- Sign in to your organization
- Go to Settings > Developer Settings > Auth Tokens
- Click “Create New Token”
- Select scopes:
project:read,event:read - Copy the token
Free Tier 5,000 events/month
Advanced Configuration
Section titled “Advanced Configuration”Environment Variables for API Keys
Section titled “Environment Variables for API Keys”Instead of hardcoding API keys, use environment variables:
Claude Code
Section titled “Claude Code”{ "mcpServers": { "exa": { "type": "http", "url": "https://mcp.exa.ai/mcp", "headers": { "Authorization": "Bearer ${EXA_API_KEY}" } } }}Set environment variables:
# Add to ~/.zshrc or ~/.bashrcexport EXA_API_KEY="your_key_here"# System Environment Variablessetx EXA_API_KEY "your_key_here"Zed Editor
Section titled “Zed Editor”Zed automatically reads from environment variables:
{ "context_servers": { "exa": { "type": "http", "url": "https://mcp.exa.ai/mcp", "headers": { "Authorization": "Bearer ${EXA_API_KEY}" } } }}VS Code (Continue)
Section titled “VS Code (Continue)”Use .env file in your project:
# .envEXA_API_KEY=your_key_hereNEON_API_KEY=your_key_hereReference in config.json:
{ "contextProviders": [ { "name": "mcp", "params": { "servers": { "exa": { "headers": { "Authorization": "Bearer ${EXA_API_KEY}" } } } } } ]}Troubleshooting
Section titled “Troubleshooting”Issue: MCP Server Not Working
Section titled “Issue: MCP Server Not Working”Issue: Command-based MCP Fails
Section titled “Issue: Command-based MCP Fails”Issue: Slow MCP Response
Section titled “Issue: Slow MCP Response”MCP Servers Comparison
Section titled “MCP Servers Comparison”| Server | Type | API Key | Free Tier | Best For |
|---|---|---|---|---|
| Sentry | HTTP | Optional | 5k events/mo | Error tracking |
| Astro Docs | HTTP | No | Unlimited | Astro development |
| Exa | HTTP | Yes | 1k searches/mo | Code search |
| Neon | HTTP | Yes | 10GB/100hrs | Database queries |
| shadcn | Command | No | Unlimited | UI components |
Best Practices
Section titled “Best Practices”Next Steps
Section titled “Next Steps”After installing MCP servers:
-
Test Each Server
- Ask AI to query each MCP server
- Verify responses are accurate
-
Explore Capabilities
- Try different queries
- Learn what each server can do
-
Integrate into Workflow
- Use MCP servers in daily coding
- Create custom workflows
-
Build Custom MCP Servers
- Learn MCP protocol
- Create server for your tools
Additional Resources
Section titled “Additional Resources”Official Documentation
Section titled “Official Documentation”MCP Server Directories
Section titled “MCP Server Directories”Tutorials
Section titled “Tutorials”Quick Reference
Section titled “Quick Reference”Claude Code Config Location
Section titled “Claude Code Config Location”~/.config/claude/claude_desktop_config.json%APPDATA%\Claude\claude_desktop_config.jsonZed Config Location
Section titled “Zed Config Location”~/.config/zed/settings.json%APPDATA%\Zed\settings.jsonVS Code (Continue) Config Location
Section titled “VS Code (Continue) Config Location”~/.continue/config.json%USERPROFILE%\.continue\config.jsonMinimal Working Configuration
Section titled “Minimal Working Configuration”{ "mcpServers": { "astro-docs": { "type": "http", "url": "https://mcp.docs.astro.build/mcp" } }}Conclusion
Section titled “Conclusion”You now have MCP servers configured for your AI coding assistant! This enables:
- Real-time documentation access
- External tool integration
- Enhanced AI capabilities
- More productive coding
Happy coding with MCP!