██████╗ ██╗ ██╗ ██████╗██╗ █████╗ ██████╗██╗ ██████╗ ██╗ ██╗██████╗
██╔══██╗██║ ██║██╔════╝██║ ██╔══██╗ ██╔════╝██║ ██╔═══██╗██║ ██║██╔══██╗
██║ ██║██║ ██║██║ ██║ ███████║ ██║ ██║ ██║ ██║██║ ██║██║ ██║
██║ ██║██║ ██║██║ ██║ ██╔══██║ ██║ ██║ ██║ ██║██║ ██║██║ ██║
██████╔╝╚██████╔╝╚██████╗███████╗██║ ██║ ╚██████╗███████╗╚██████╔╝╚██████╔╝██████╔╝
╚═════╝ ╚═════╝ ╚═════╝╚══════╝╚═╝ ╚═╝ ╚═════╝╚══════╝ ╚═════╝ ╚═════╝ ╚═════╝
Chào mừng bạn đến với bộ hướng dẫn toàn diện về Model Context Protocol (MCP) Servers! Đây là tài liệu tham khảo chi tiết để giúp bạn hiểu, cài đặt, phát triển và troubleshoot MCP servers.
Hướng dẫn tổng quan về MCP Servers
- Giới thiệu về MCP và lợi ích
- Cách thức hoạt động
- Các MCP servers phổ biến
- Ví dụ tạo server tùy chỉnh
- Best practices và troubleshooting cơ bản
Hướng dẫn cài đặt và cấu hình chi tiết
- Yêu cầu hệ thống
- Cài đặt từng bước
- Cấu hình nâng cao
- Performance tuning
- Security best practices
- Automation scripts
Hướng dẫn phát triển MCP server tùy chỉnh
- Kiến trúc MCP server
- Phát triển với Python và Node.js
- Testing và debugging
- Deployment và distribution
- Code examples chi tiết
Hướng dẫn troubleshooting và debug chuyên sâu
- Phân loại lỗi thường gặp
- Diagnostic tools
- Advanced debugging techniques
- Monitoring và alerting
- Performance profiling
Bắt đầu với MCP Servers Guide để hiểu cơ bản về MCP.
Theo hướng dẫn trong Installation & Setup để thiết lập môi trường.
Thử nghiệm với các servers có sẵn trước khi phát triển custom server.
Sử dụng Custom Server Development để tạo servers riêng.
Khi gặp vấn đề, tham khảo Troubleshooting & Debug.
# Test MCP servers
q chat --test-mcp
# List available tools
q chat --list-mcp-tools
# Debug mode
q chat --debug --mcp-config ~/.config/q/mcp-config.json
# Health check
q chat --test-mcp-server filesystem{
"mcpServers": {
"filesystem": {
"command": "npx",
"args": ["@modelcontextprotocol/server-filesystem", "/safe/directory"]
},
"sqlite": {
"command": "python3",
"args": ["-m", "mcp_server_sqlite", "/path/to/database.db"]
}
}
}- Node.js >= 18.0.0 installed
- Python >= 3.8 installed
- Amazon Q CLI latest version
- MCP SDK installed
- Configuration file created
- Servers tested successfully
| Server | Chức Năng | Cài Đặt |
|---|---|---|
| Filesystem | Quản lý files/directories | npm install -g @modelcontextprotocol/server-filesystem |
| SQLite | Database operations | pip install mcp-server-sqlite |
| Git | Git repository management | npm install -g @modelcontextprotocol/server-git |
| Web Scraping | Web data extraction | pip install mcp-server-puppeteer |
# Kiểm tra executable
which npx
npx @modelcontextprotocol/server-filesystem --help
# Kiểm tra config
python3 -m json.tool ~/.config/q/mcp-config.json# Fix permissions
chmod 755 ~/.config/q/
chmod +x ~/.config/q/mcp-config.json# Reinstall packages
npm install -g @modelcontextprotocol/server-filesystem
pip install --upgrade mcp-server-sqlite#!/bin/bash
q chat --test-mcp --quiet
if [ $? -eq 0 ]; then
echo "✅ All MCP servers healthy"
else
echo "❌ Some servers have issues"
fi# Monitor memory usage
ps aux | grep mcp
# Check logs
tail -f ~/.config/q/logs/mcp.logNếu bạn tìm thấy lỗi hoặc muốn bổ sung thông tin:
- Tạo issue mô tả vấn đề
- Đề xuất cải tiến
- Chia sẻ kinh nghiệm sử dụng
- Đóng góp code examples
- Tất cả examples đã được test trên Linux/macOS
- Windows users có thể cần điều chỉnh paths và commands
- Luôn backup configuration trước khi thay đổi
- Sử dụng virtual environments cho Python projects
MCP Model Context Protocol Amazon Q CLI Servers Development Troubleshooting Python Node.js Configuration
██████╗ ██╗ ██╗ ██████╗██╗ █████╗ ██████╗██╗ ██████╗ ██╗ ██╗██████╗
██╔══██╗██║ ██║██╔════╝██║ ██╔══██╗ ██╔════╝██║ ██╔═══██╗██║ ██║██╔══██╗
██║ ██║██║ ██║██║ ██║ ███████║ ██║ ██║ ██║ ██║██║ ██║██║ ██║
██║ ██║██║ ██║██║ ██║ ██╔══██║ ██║ ██║ ██║ ██║██║ ██║██║ ██║
██████╔╝╚██████╔╝╚██████╗███████╗██║ ██║ ╚██████╗███████╗╚██████╔╝╚██████╔╝██████╔╝
╚═════╝ ╚═════╝ ╚═════╝╚══════╝╚═╝ ╚═╝ ╚═════╝╚══════╝ ╚═════╝ ╚═════╝ ╚═════╝
Cập nhật lần cuối: August 2025
Phiên bản: 1.0.0
Tác giả: ducla-cloud