Skip to Content
✨ AI Engineering🔌 MCP ProtocolGuidesUsing Existing Servers

Sử dụng Servers có sẵn

Khái niệm cơ bản

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.


Cài đặt cơ bản (Claude Desktop)

Bước 1: Mở file config

OSPath
macOS~/Library/Application Support/Claude/claude_desktop_config.json
Windows%APPDATA%\Claude\claude_desktop_config.json
Linux~/.config/claude/claude_desktop_config.json

Bước 2: Thêm server config

{ "mcpServers": { "server-name": { "command": "npx", "args": ["-y", "@modelcontextprotocol/server-xxx", ...args], "env": { "API_KEY": "your-key" } } } }

Bước 3: Restart Claude Desktop

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


Catalog: 15 Servers phổ biến nhất

File & Storage

ServerNPM PackageChức năng
Filesystem@modelcontextprotocol/server-filesystemĐọc/ghi local files
Google Drive@anthropic/mcp-server-google-driveAccess Google Drive
S3@anthropic/mcp-server-aws-s3AWS S3 buckets

Config Filesystem:

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

Database

ServerNPM PackageChức năng
PostgreSQL@modelcontextprotocol/server-postgresQuery Postgres
SQLite@modelcontextprotocol/server-sqliteQuery SQLite
MongoDB@anthropic/mcp-server-mongodbQuery MongoDB

Config PostgreSQL:

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

Developer Tools

ServerNPM PackageChức năng
GitHub@modelcontextprotocol/server-githubRepos, Issues, PRs
GitLab@anthropic/mcp-server-gitlabGitLab projects
Linear@anthropic/mcp-server-linearIssue tracking
Sentry@anthropic/mcp-server-sentryError monitoring

Config GitHub:

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

Communication

ServerNPM PackageChức năng
Slack@modelcontextprotocol/server-slackMessages, channels
Gmail@anthropic/mcp-server-gmailRead/send emails
Notion@anthropic/mcp-server-notionPages, databases

Config Slack:

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

Utilities

ServerNPM PackageChức năng
Memory@modelcontextprotocol/server-memoryPersistent memory
Fetch@modelcontextprotocol/server-fetchHTTP requests
Puppeteer@modelcontextprotocol/server-puppeteerBrowser automation

Config Memory (quan trọng!):

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

Cấu hình nhiều servers cùng lúc

{ "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"] } } }

Troubleshooting

Server không xuất hiện

  1. Kiểm tra JSON syntax: Dùng JSONLint 
  2. Kiểm tra path: Đảm bảo npx có trong PATH
  3. Xem logs:
# macOS tail -f ~/Library/Logs/Claude/mcp*.log

Permission errors

  1. Đảm bảo folder có quyền read
  2. Với filesystem, thêm đúng path vào args

Server crash

  1. Test server riêng:
npx -y @modelcontextprotocol/server-filesystem /tmp
  1. Nếu chạy được, vấn đề ở config

Bài tập thực hành

Mục tiêu

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

Bước 1: Tạo config

{ "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"] } } }

Bước 2: Test từng server

  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”

Bước 3: Kết hợp servers

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


Tóm tắt

ServerUse case
FilesystemĐọc local files
MemoryClaude nhớ thông tin
GitHubQuản lý code
PostgreSQLQuery database
FetchGọi APIs

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

Last updated on