MCP Servers
What is MCP?
MCP (Model Context Protocol) is a standard protocol developed by Anthropic to connect AI models with external data sources and services.
Core Concepts:
- 📡 Unified Interface: Standardized data access
- 🔌 Extensible: Easily add new data sources
- 🔒 Secure: Fine-grained permission control
- ⚡ Efficient: Real-time data access
What can MCP do?
- Connect databases (PostgreSQL, MySQL, MongoDB, etc.)
- Access cloud services (AWS, Google Cloud, Azure)
- Integrate dev tools (GitHub, Jira, Slack)
- Read local filesystem
- Call external APIs
Configuring MCP Servers
How to Configure
The recommended way is the claude mcp command:
Project-level configuration lives in a .mcp.json file at the project root (can be committed to git and shared with the team).
Basic Configuration Structure
Example: Filesystem Server
Popular MCP Servers
1. Filesystem Server
Install:
Configure:
Usage:
2. GitHub Server
Configure:
Usage:
3. PostgreSQL Server
Configure:
Usage:
Custom MCP Servers
Create Simple MCP Server
Configure Custom Server
MCP Practical Examples
Case 1: Database Query Assistant
Case 2: GitHub Automation
Case 3: Documentation Generation
Summary
In this chapter, we learned:
- ✅ MCP protocol concept and purpose
- ✅ How to configure MCP servers
- ✅ Popular MCP servers (filesystem, GitHub, database)
- ✅ Create custom MCP servers
- ✅ MCP practical examples
Key Takeaways:
- MCP extends Claude Code's capabilities
- Supports various data sources and services
- Can develop custom MCP servers
- Security configuration is important
Next Step: Continue with Subagents to learn the subagent system.