Bỏ qua để đến nội dung

Using Existing Servers

Bạn không cần code từ đầu! Cộng đồng MCP đã xây dựng sẵn hàng trăm servers cho các dịch vụ phổ biến.


OS Path
macOS ~/Library/Application Support/Claude/claude_desktop_config.json
Windows %APPDATA%\Claude\claude_desktop_config.json
Linux ~/.config/claude/claude_desktop_config.json
{
"mcpServers": {
"server-name": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-xxx", ...args],
"env": {
"API_KEY": "your-key"
}
}
}
}

Tắt hoàn toàn (Cmd+Q / Alt+F4) và mở lại. Biểu tượng 🔌 sẽ xuất hiện.


Server NPM Package Chức năng
Filesystem @modelcontextprotocol/server-filesystem Đọc/ghi local files
Google Drive @anthropic/mcp-server-google-drive Access Google Drive
S3 @anthropic/mcp-server-aws-s3 AWS S3 buckets

Config Filesystem:

{
"filesystem": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-filesystem",
"/Users/me/Documents",
"/Users/me/Projects"]
}
}

Server NPM Package Chức năng
PostgreSQL @modelcontextprotocol/server-postgres Query Postgres
SQLite @modelcontextprotocol/server-sqlite Query SQLite
MongoDB @anthropic/mcp-server-mongodb Query MongoDB

Config PostgreSQL:

{
"postgres": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-postgres"],
"env": {
"DATABASE_URL": "postgresql://user:pass@localhost:5432/mydb"
}
}
}

Server NPM Package Chức năng
GitHub @modelcontextprotocol/server-github Repos, Issues, PRs
GitLab @anthropic/mcp-server-gitlab GitLab projects
Linear @anthropic/mcp-server-linear Issue tracking
Sentry @anthropic/mcp-server-sentry Error monitoring

Config GitHub:

{
"github": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-github"],
"env": {
"GITHUB_TOKEN": "ghp_xxxxx"
}
}
}

Server NPM Package Chức năng
Slack @modelcontextprotocol/server-slack Messages, channels
Gmail @anthropic/mcp-server-gmail Read/send emails
Notion @anthropic/mcp-server-notion Pages, databases

Config Slack:

{
"slack": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-slack"],
"env": {
"SLACK_BOT_TOKEN": "xoxb-xxxxx"
}
}
}

Server NPM Package Chức năng
Memory @modelcontextprotocol/server-memory Persistent memory
Fetch @modelcontextprotocol/server-fetch HTTP requests
Puppeteer @modelcontextprotocol/server-puppeteer Browser automation

Config Memory (quan trọng!):

{
"memory": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-memory"]
}
}

{
"mcpServers": {
"filesystem": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-filesystem", "/Users/me/code"]
},
"github": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-github"],
"env": {"GITHUB_TOKEN": "ghp_xxx"}
},
"postgres": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-postgres"],
"env": {"DATABASE_URL": "postgresql://..."}
},
"memory": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-memory"]
}
}
}

  1. Kiểm tra JSON syntax: Dùng JSONLint
  2. Kiểm tra path: Đảm bảo npx có trong PATH
  3. Xem logs:
Terminal window
# macOS
tail -f ~/Library/Logs/Claude/mcp*.log
  1. Đảm bảo folder có quyền read
  2. Với filesystem, thêm đúng path vào args
  1. Test server riêng:
Terminal window
npx -y @modelcontextprotocol/server-filesystem /tmp
  1. Nếu chạy được, vấn đề ở config

Setup 3 servers và sử dụng chúng cùng lúc.

{
"mcpServers": {
"docs": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-filesystem", "/Users/me/Documents"]
},
"memory": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-memory"]
},
"fetch": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-fetch"]
}
}
}
  1. Filesystem: “Liệt kê files trong Documents”
  2. Memory: “Nhớ rằng tên tôi là Phúc” → “Tên tôi là gì?”
  3. Fetch: “Lấy weather data từ wttr.in/Hanoi?format=j1”

“Đọc file report.md trong Documents, tóm tắt, và nhớ lại summary đó cho lần sau.”


Server Use case
Filesystem Đọc local files
Memory Claude nhớ thông tin
GitHub Quản lý code
PostgreSQL Query database
Fetch Gọi APIs

Bài tiếp theo: Custom Server - Viết server riêng.