What Are MCPs?
MCPs are JSON configuration files (.json) that define server connections:
- Server configuration - How to start and connect to MCP servers
- Command and arguments - What to execute (npm packages, binaries, scripts)
- Environment variables - Configuration and API keys
- Capabilities - What tools and resources the server provides
MCP servers run as separate processes and communicate with Claude Code via stdio (standard input/output).
MCP Architecture
MCP configuration lives in.mcp.json at your project root:
Configuration Structure
MCP Categories
- Web & APIs
- Databases
- Development Tools
- Browser Automation
- Filesystem
- Productivity
Access web content and external APIs:Capabilities:
- web-fetch - HTTP requests, web scraping, API calls
- github-integration - GitHub API access (repos, issues, PRs)
- slack-integration - Slack API for messages and channels
- Fetch web pages and parse HTML
- Make REST API requests
- Download files and images
- Parse JSON and XML responses
Real-World Examples
Example 1: Web Fetch MCP
File:.mcp.json
Example 2: PostgreSQL Database MCP
File:.mcp.json
Example 3: GitHub Integration MCP
File:.mcp.json
Installing MCPs
Single MCP
.mcp.json.
Multiple MCPs
With Category Prefix
MCP servers are downloaded on-demand when first used. No manual installation required beyond configuration.
Environment Variables
Many MCPs require API keys or connection strings:Secure Configuration
DON’T hardcode secrets:.env files (add to .gitignore):
MCP Server Types
NPM Packages
Most official MCPs are npm packages:-y flag auto-installs packages without prompting.
Python Scripts
pip install mcp-server-name
Custom Executables
Docker Containers
MCP Capabilities
MCP servers can provide:1. Tools
Functions that Claude can call:2. Resources
Data that Claude can read:3. Prompts
Pre-built prompt templates:Creating Custom MCP Servers
You can build custom MCP servers:1
Choose Implementation
Use the MCP SDK for TypeScript or Python:
2
Implement Server
Create server with tools and resources:
3
Configure in .mcp.json
Add your server configuration:
4
Test
Use your custom server in Claude Code:
For detailed MCP development guides, see MCP Documentation.
MCP Best Practices
1. Security First
- Never hardcode credentials
- Use environment variables for secrets
- Validate all inputs
- Limit server permissions
- Use read-only access when possible
2. Error Handling
Servers should handle errors gracefully:3. Resource Management
- Close connections properly
- Implement timeouts
- Clean up resources
- Handle server shutdown gracefully
4. Documentation
Document your MCP tools clearly:Troubleshooting MCPs
Server Won’t Start
Check the command and arguments:Environment Variables Not Working
Ensure variables are exported:Connection Errors
Verify network access:- Database servers are running
- Firewall allows connections
- Credentials are correct
- Connection strings are properly formatted
Permission Denied
Ensure executable permissions:MCP vs Claude Code Tools
MCPs extend Claude’s capabilities beyond the built-in tools. Use them to connect Claude with your specific services and data sources.
Official MCP Servers
Anthropics maintains official MCP servers:@modelcontextprotocol/server-fetch- HTTP requests@modelcontextprotocol/server-filesystem- File operations@modelcontextprotocol/server-github- GitHub API@modelcontextprotocol/server-postgres- PostgreSQL@modelcontextprotocol/server-sqlite- SQLite
Next Steps
Browse MCPs
Explore 65+ available MCPs
MCP Documentation
Official MCP specification
Create MCP Server
Build custom MCP servers
Settings
Configure Claude Code behavior