Sổ Tay AI
🇻🇳 This page hasn't been translated yet — showing the Vietnamese version.
ky-thuat Intermediate

MCP (Model Context Protocol) là gì?

Chuẩn mở do Anthropic công bố giúp LLM kết nối với tool, database, ứng dụng theo một giao thức thống nhất.

Updated: May 2, 2026 · 2 min read

MCP (Model Context Protocol — Giao thức Ngữ cảnh Mô hình) là chuẩn mở do Anthropic công bố cuối 2024, giúp LLM kết nối với tool/database/ứng dụng theo một giao thức thống nhất, tránh phải custom integration cho từng cặp model × tool.

Vì sao cần MCP?

Trước MCP:

  • Mỗi LLM (Claude, GPT, Gemini) có cú pháp function calling riêng
  • Mỗi tool (Slack, GitHub, Notion) cần code tích hợp riêng
  • Số kết nối cần xây = N model × M tool (rất nhiều!)

Với MCP:

  • Tool implement 1 server MCP → tất cả LLM hỗ trợ MCP đều dùng được
  • Số kết nối: N + M thay vì N × M

Phân biệt vai trò

┌─────────────┐     MCP protocol     ┌─────────────┐
│ MCP Client  │ ←──────────────────→ │ MCP Server  │
│ (LLM apps)  │   (tool/data calls)  │ (tool side) │
└─────────────┘                      └─────────────┘
  • Client: app gọi LLM (Claude Desktop, Cursor, Claude Code, …)
  • Server: app cung cấp khả năng (Slack server, Postgres server, Filesystem server)

Ví dụ MCP server có sẵn (2026)

  • Filesystem: đọc/ghi file local
  • Postgres / SQLite: query database
  • GitHub: tạo issue, đọc PR, search code
  • Slack / Discord: gửi/đọc message
  • Brave Search: search web
  • Puppeteer: điều khiển browser

→ Cài 1 lệnh, Claude Code lập tức dùng được.

Khi nào cần dùng MCP?

✅ Build agent có nhiều tool — không phải code wrapper từng tool ✅ Muốn share tool integration giữa team ✅ Dùng nhiều LLM client khác nhau (Claude Desktop ở nhà, Cursor ở công ty)

❌ Chỉ cần 1 tool đơn giản → function calling thường đủ ❌ Tool nội bộ rất custom → có thể nhanh hơn nếu code thẳng

Cài đặt nhanh (Claude Desktop)

claude_desktop_config.json:

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

Restart Claude → Claude có thể đọc/ghi file trong /Users/me/Documents.

Adoption

Tới giữa 2026: Claude, OpenAI, một số IDE và app đã hỗ trợ. Đang dần trở thành chuẩn de facto cho tool use.

Liên quan

Tags
#mcp#agent#tool-use#anthropic