Skip to main content

MCP là gì?

Model Context Protocol cho phép LLM gọi công cụ bên ngoài. Synapse lộ 79 công cụ qua MCP server chính thức.


MCP là gì?

Model Context Protocol (MCP) là tiêu chuẩn mở của Anthropic (2024) cho phép LLM gọi công cụ bên ngoài theo cách có cấu trúc. Thay vì dán tài liệu API vào prompt, bạn đăng ký công cụ với MCP server, và LLM gọi chúng khi cần — giống function calling, nhưng được chuẩn hóa và không phụ thuộc client.

Synapse MCP Server

Synapse đi kèm với MCP server chính thức (synapse-mcp-api trên npm) lộ 79 công cụ bao phủ tất cả tính năng Synapse:

Danh mục Công cụ Số lượng
Memory recall, list, store, search, semantic-search, update, delete, bulk-delete, stats, unverified, contradictions, audit, related, by-tag, diff, expiring, health, sync, embed-batch, verify, unverify, mind-export 22
Chat poll, reply, status, history, unread, send, upload 7
Scheduler cron_list, cron_create, cron_delete, cron_toggle, var_list, var_get, var_set, var_delete 8
Tasks task_list, task_get, task_create, task_update 4
Scripts script_list, script_get, script_info, script_store, script_delete 5
Computers computer_list, computer_get, install_code, screenshot, command_queue, command_status, commands_list, disable, delete 9
Push vapid_public_key, subscribe, unsubscribe, test 4
User/Mind register, login, minds_list, mind_create, mind_delete 5
Utility time, calc, random 3
Visualization graph, tags, compact 3
Sharing share, list, revoke 3
Webhooks register, list, get, update, delete 5
Browser new, navigate, click, type, screenshot, close 6
Tổng 79+

Cách hoạt động

┌──────────────────┐    MCP protocol    ┌──────────────────┐    HTTP    ┌──────────┐
│  LLM Client      │ ◀─────────────────▶│  Synapse MCP     │ ─────────▶ │ Synapse  │
│ (Claude/Cursor)  │   (stdio/SSE/WS)   │  Server          │            │ API      │
└──────────────────┘                    └──────────────────┘            └──────────┘
  1. Bạn cấu hình LLM client của mình (Claude Desktop, Cursor, v.v.) để sử dụng Synapse MCP server
  2. Client khởi động MCP server (qua npx -y synapse-mcp-api@latest)
  3. MCP server kết nối đến Synapse API sử dụng Mind Key của bạn
  4. LLM thấy tất cả 79 công cụ dưới dạng hàm native nó có thể gọi
  5. Khi LLM cần nhớ điều gì, nó gọi memory_store — MCP server dịch điều này thành POST /memory trên Synapse

Transport

Synapse MCP server hỗ trợ ba transport:

stdio (cục bộ, khuyến nghị cho desktop)

{
  "mcpServers": {
    "synapse": {
      "command": "npx",
      "args": ["-y", "synapse-mcp-api@latest"],
      "env": {
        "SYNAPSE_MIND_KEY": "mk_...",
        "SYNAPSE_URL": "https://synapse.schaefer.zone"
      }
    }
  }
}

HTTP/SSE (từ xa, multi-tenant)

Kết nối MCP client của bạn đến:

URL: https://synapse-mcp.schaefer.zone/sse
Headers: Authorization: Bearer YOUR_MIND_KEY

WebSocket (di động, khối lượng lớn)

URL: wss://synapse-mcp.schaefer.zone/ws?mind_key=YOUR_MIND_KEY

Tool Profile (v1.4.0)

Để giảm chi phí token cho LLM nhỏ hơn, MCP server hỗ trợ ba tool profile:

Profile Công cụ Token Tốt nhất cho
minimal 8 (composite dispatch) ~500 LLM tự lưu trữ với ngữ cảnh ≤8k
standard 25 (named) ~2,500 LLM kích thước trung bình (Claude Haiku, GPT-3.5)
full 119 (all) ~8,250 LLM lớn (Claude Sonnet/Opus, GPT-4) — mặc định

Kiểm soát qua:

  • Biến môi trường: MCP_PROFILE=minimal|standard|full
  • Header: Mcp-Tool-Profile: minimal|standard|full

Client được hỗ trợ

  • Claude Desktop — ứng dụng desktop của Anthropic
  • Claude Code — agent lập trình terminal
  • Cursor — IDE dựa trên AI
  • Continue.dev — trợ lý lập trình AI mã nguồn mở
  • Cline — tiện ích mở rộng VS Code
  • Bất kỳ client tương thích MCP nào

Tại sao sử dụng MCP thay vì API trực tiếp?

Cách tiếp cận Ưu điểm Nhược điểm
API trực tiếp Đơn giản, không có lớp thêm LLM cần biết URL, header, xác thực
MCP LLM thấy công cụ native, không cần ghi nhớ URL Tiến trình MCP server thêm

Cho hầu hết trường hợp sử dụng LLM agent, MCP là lựa chọn tốt hơn — LLM không cần ghi nhớ đường dẫn API hoặc mẫu xác thực.

Bước tiếp theo