MCP — Model Context Protocol
Xây dựng và quản lý MCP servers để kết nối Claude Code với external tools và services.
MCP (Model Context Protocol) cho phép Claude gọi tools bên ngoài: database, API, file system, browser, v.v.
Cú pháp
/mcp-builder "mô tả MCP server" # Tạo MCP server mới
/mcp-management # Quản lý MCP servers hiện có
/use-mcp # Sử dụng tools từ MCP servers
Bảng tham chiếu nhanh
| Lệnh | Mô tả | Use case |
|---|
/mcp-builder | Scaffold + build MCP server | Tạo integration mới (Slack, DB, API) |
/mcp-management | Discover, analyze, execute MCP tools | Quản lý servers đã cài |
/use-mcp | Intelligent tool discovery + execution | Dùng tools từ MCP servers |
/mcp-builder — Tạo MCP server
Bước 1: Chọn framework
FastMCP (Python) hoặc MCP SDK (Node/TypeScript).
Bước 2: Define tools
Khai báo tools, resources, prompts cho server.
Bước 3: Implement
Viết handler cho mỗi tool. Input validation + error handling.
Bước 4: Test + Register
Test locally, đăng ký trong .claude/settings.json.
/mcp-management — Quản lý servers
| Tính năng | Mô tả |
|---|
| List servers | Xem tất cả MCP servers đã cài |
| Analyze tools | Xem tools, resources, prompts của mỗi server |
| Execute tools | Chạy tool trực tiếp |
| Health check | Kiểm tra server status |
Ví dụ thực tế
Build Slack MCP
Use MCP tools
/mcp-builder "Tạo MCP server kết nối Slack —
gửi message, đọc channels, quản lý threads"
Output: Project FastMCP với 3 tools: send_message, read_channel, manage_thread./use-mcp "gửi message lên #dev-updates"
Auto-detect Slack MCP server → gọi send_message tool.
MCP Servers phổ biến
| Server | Mô tả | Tools |
|---|
| Lark MCP | Feishu/Lark integration | Message, docs, bitable, wiki |
| Chrome DevTools | Browser automation | Screenshot, navigate, evaluate |
| Figma | Design integration | Implement, generate, library |
| Stitch | AI design generation | Generate screens, export code |
| Pencil | Design editor | Batch design, get/set variables |
Khi nào dùng / không dùng
| Dùng | Không dùng |
|---|
| Kết nối Claude với external service | Viết API endpoint (dùng backend code) |
| Tạo custom tool cho workflow | Task không cần external tools |
| Quản lý MCP servers đã cài | Tìm hiểu MCP protocol (đọc docs) |