Tôi viết một MCP server cho database internal, test trên Claude Desktop, ổn. Hôm sau một bạn trong team hỏi “tôi đang xài Cursor, dùng được không”. Tôi mở config Cursor lần đầu, thấy file .cursor/mcp.json với cùng format mcpServers, copy paste, restart, tools xuất hiện trong Cursor agent. Không sửa một dòng code server nào.

Đó là điểm hấp dẫn nhất của MCP. Build server một lần, các client khác nhau cùng connect được. Từ cuối 2025 sang 2026, MCP đã thành chuẩn ngành. Anthropic và OpenAI cùng Block donate spec cho Linux Foundation, thành lập Agentic AI Foundation (AAIF). OpenAI adopt MCP trong tất cả product: Codex, ChatGPT Developer Mode, Agents SDK, Responses API. AAIF báo cáo có hơn 10.000 public MCP server và hàng chục triệu SDK download mỗi tháng tính đến đầu 2026.

Bài này đi qua 5 client phổ biến nhất ngoài Claude. Quan điểm trước: nếu bạn build server theo spec chuẩn (stdio hoặc Streamable HTTP, tool/resource/prompt entities), server đó chạy được với hầu hết client lớn. Cá nhân tôi dùng Cursor và Claude Code mỗi ngày, gptme cho local LLM, ChatGPT Developer Mode khi cần một MCP cho team không phải dev. Windsurf và Continue tôi test có nhưng không stick với chúng.

Cursor

Cursor adopt MCP từ đầu 2025, là một trong những IDE đầu tiên ngoài Claude Desktop hỗ trợ protocol. Config có hai cấp giống Claude Code: global ở ~/.cursor/mcp.json (macOS/Linux) hoặc %USERPROFILE%\.cursor\mcp.json (Windows) áp dụng cho tất cả project; project ở .cursor/mcp.json root workspace chỉ áp dụng project đó, trùng tên server với global thì project thắng.

Format giống y hệt Claude Desktop:

{
  "mcpServers": {
    "filesystem": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-filesystem", "/Users/me/work"]
    },
    "github": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-github"],
      "env": {
        "GITHUB_PERSONAL_ACCESS_TOKEN": "ghp_xxx"
      }
    }
  }
}

Save file, mở Cursor agent panel (Cmd+L), tool list refresh. Nếu không thấy, restart Cursor một lần.

Cursor khác Claude Desktop đáng kể ở chỗ có ceiling 40 active tool trên toàn bộ MCP server gộp lại. Vượt ngưỡng, Cursor warning và silently bỏ tool dư. Agent không biết tool bị mất, gọi xong báo lỗi không liên quan. Tôi gặp pitfall này khi đang xài 6 server đồng thời (filesystem, github, postgres, slack, linear, custom), tổng ~55 tool, Cursor bỏ qua 15 tool cuối silently, debug 40 phút mới phát hiện. Workaround: chia nhỏ project-level config, mỗi project chỉ enable đúng server cần. Đừng bật toàn bộ 10 server global cho project nào cũng dùng cùng lúc.

Từ tháng 1 năm 2026, Cursor thêm dynamic context management, giảm token usage khoảng 47% khi chạy nhiều MCP server. Cơ chế chỉ inject tool description vào prompt khi LLM thật sự cần, không inject toàn bộ tool list mỗi turn. Đây là move tôi cho là đúng hướng, nhưng vẫn không xóa được trần 40 vì lý do UI.

Cursor support tools, resources, prompts. Sampling (server gọi ngược LLM) chưa hoàn thiện, dùng được nhưng ít người test. Một điểm Cursor làm tốt: tool execution có visualization riêng, hiển thị input/output rõ ràng trong agent panel. So với Claude Desktop trước đây thường ẩn detail, Cursor làm tốt hơn cho debug. Khi MCP server fail, bạn thấy ngay lỗi gì, payload gì sai. Đây là chi tiết nhỏ nhưng tiết kiệm thời gian rất nhiều.

Windsurf

Windsurf, IDE của Codeium, là client thứ hai adopt MCP đầu 2025. Config ở ~/.codeium/windsurf/mcp_config.json (macOS/Linux) hoặc %USERPROFILE%\.codeium\windsurf\mcp_config.json (Windows). File không tự sinh khi cài Windsurf, bạn tự tạo. Format y hệt Cursor:

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

Trước khi server load, vào Settings → Cascade bật toggle Model Context Protocol. Cascade là agent mode của Windsurf, chỉ nó dùng MCP, không phải auto-complete. Có ba cách thêm server: MCP Marketplace (icon MCPs góc panel Cascade, browse server official có blue check, install một click), manual edit mcp_config.json, hoặc Command Palette (Cmd+Shift+P → “Windsurf: Configure MCP Servers”).

Trần tool của Windsurf cao hơn Cursor: 100 tool active trong Cascade. Vẫn có giới hạn, nhưng đỡ thắt hơn. Windsurf support đủ ba transport (stdio, Streamable HTTP, SSE) và tools, resources, prompts.

Thực tế dùng: trong test benchmark cuối 2025 với Composio MCP server (Linear + Slack), Cursor execute đầy đủ tool chain (tạo issue, label, message Slack), Windsurf fail vài step (không gọi list_states để lấy state_id, tạo issue thiếu label). Cả hai đều work, Cursor ổn định hơn ở multi-tool chain. Cá nhân tôi không stick với Windsurf một phần vì lý do này.

gptme

gptme là agent terminal nhỏ gọn open source, được dùng nhiều trong homelab local LLM stack. Tôi đã đi sâu nó trong Local LLM 2026, bài 4. gptme hỗ trợ MCP từ phiên bản v0.20 trở đi, có thể discovery và dynamic load server, cho agent access database, API, filesystem, và bất kỳ tool MCP-compatible nào.

Config ở ~/.config/gptme/config.toml:

[mcp]
enabled = true

[[mcp.servers]]
name = "filesystem"
command = "npx"
args = ["-y", "@modelcontextprotocol/server-filesystem", "/home/me/projects"]

[[mcp.servers]]
name = "github"
command = "npx"
args = ["-y", "@modelcontextprotocol/server-github"]

[mcp.servers.env]
GITHUB_PERSONAL_ACCESS_TOKEN = "ghp_xxx"

Save, chạy gptme lại, tool xuất hiện trong tool list. gptme thường pair với local LLM (Ollama, llama.cpp) thay vì cloud model, và đây là chỗ tricky. One-shot tool call (bắn một tool, model trả response, gptme execute MCP, đưa output về) chạy ổn. Agent loop hay hang vì model nhỏ (7B-13B) không biết khi nào dừng, lặp tool call vô tận. Lessons từ homelab Xeon E5 + Quadro K620 của tôi: Gemma 7B chạy 2-4 tok/s, OpenClaw và OpenCode hang vì agent loop, gptme one-shot works. Cho local LLM, dùng gptme + MCP cho task discrete, không cho task agent dài. Cho cloud model (Claude, GPT-4), gptme + MCP đầy đủ.

Điểm tôi thích nhất ở gptme là hooks lifecycle (before_tool_call, after_tool_call, on_conversation_start). Bạn inject custom logic được, ví dụ log mọi MCP call ra file, hoặc rate-limit tool gọi từ một server cụ thể. Đây là feature Cursor và Windsurf không có (closed source), khá tiện cho debug và observability. Tôi đã dùng gptme + MCP cho workflow local ETL: gptme chạy trên homelab, kết nối tới một MCP server custom expose internal database. Câu lệnh shell và data query không qua cloud. Đối với dữ liệu nhạy cảm (compliance, healthcare, finance), đây là pattern đáng tham khảo.

OpenAI Codex và ChatGPT Developer Mode

Đây là phần thay đổi lớn nhất giữa 2025 và 2026. Cuối 2025, OpenAI dứt khoát adopt MCP. Tới tháng 4 năm 2026, Codex ship hơn 90 plugin mới, hầu hết là MCP server đóng gói. OpenAI weave MCP vào tất cả surface: Responses API (backend integration), Agents SDK (autonomous agent build), ChatGPT Developer Mode (interactive tool use), Apps SDK (build UI trong ChatGPT), Codex (AI-assisted coding với plugin).

Bật Developer Mode trong ChatGPT Settings, vào tab MCP servers, add server URL (Streamable HTTP) hoặc command (stdio). Format y chang Cursor:

{
  "name": "my-database",
  "url": "https://mcp.mycompany.com/sse",
  "headers": {
    "Authorization": "Bearer xxx"
  }
}

ChatGPT discovery tool từ server, hiện trong tool picker. Use case nội bộ company hay dùng: MCP server query internal database, MCP server đọc Slack archive, MCP server gọi Jira. Đây là chỗ ChatGPT Developer Mode tỏa sáng vì user không phải dev cũng dùng được, không phải edit JSON file.

Trong Python SDK OpenAI Agents có MCP client built-in, code wire một server:

from openai_agents import Agent, MCPServer

mcp = MCPServer(
    command="npx",
    args=["-y", "@modelcontextprotocol/server-filesystem", "/work"]
)

agent = Agent(
    model="gpt-4.1",
    mcp_servers=[mcp],
    instructions="You are a coding assistant."
)

response = agent.run("List files in /work and summarize")

SDK tự handle discovery, tool call routing, response handling. Bạn không thấy MCP protocol detail, chỉ thấy tool xuất hiện sẵn.

Codex plugin store là cách OpenAI distribute MCP cho user không tech. Mỗi plugin bundle: optional skill, app integration, và MCP server. Khi user enable plugin, Codex auto-spawn MCP server và expose tool. Một plugin Codex chuẩn gồm ba phần: skill (procedural knowledge cho model), MCP server (tools), app integration (UI wrapper). Ba layer phối hợp: skill biết khi nào gọi tool, MCP execute, app render output. Đây là pattern lớn dần sẽ trở thành chuẩn cho mọi AI assistant trên thị trường, OpenAI cũng adopt Skills từ Anthropic (donate cùng MCP cho AAIF).

Đối với developer build MCP server muốn distribute, một con đường là package thành Codex plugin (qua manifest YAML chuẩn), submit lên Codex marketplace. User Codex chỉ một click là dùng được. So với bắt user edit JSON config (Cursor, Windsurf), trải nghiệm này dễ tiếp cận hơn nhiều, gần như “App Store cho AI tool”.

Continue

Continue là extension open source cho VS Code và JetBrains, hỗ trợ MCP từ giữa 2025. Continue dùng folder .continue/mcpServers/ ở root workspace. Mỗi server một file YAML:

# .continue/mcpServers/filesystem.yaml
name: filesystem
version: 1.0.0
schema: v1
command: npx
args:
  - -y
  - "@modelcontextprotocol/server-filesystem"
  - /Users/me/work

Nếu đã có config JSON kiểu Cursor/Claude Desktop, copy nguyên file vào .continue/mcpServers/, Continue auto-pickup. Continue support stdio (local), SSE (legacy), Streamable HTTP (cho remote cloud), nhưng MCP server chỉ dùng được trong agent mode, không phải chat mode hay edit mode. Secrets store local hoặc qua Continue Mission Control (cloud secret store của Continue), reference bằng ${{ secrets.GITHUB_TOKEN }} syntax.

Lưu ý nhỏ trên Windows WSL: Continue trước đây có bug tìm cmd.exe thay vì bash khi spawn MCP server trong WSL workspace (issue 9151 trên GitHub). Đã fix trong version mới, nếu dùng WSL và thấy server không khởi động, check version Continue và update. Continue support đầy đủ tools, resources, prompts. Sampling thì chưa, đa số use case bạn không cần. Format YAML rõ ràng hơn JSON cho server complex (nhiều env var, nhiều args), đặc biệt với team nhiều người, đọc YAML diff trong PR review dễ hơn JSON.

Bảng so sánh nhanh

ClientConfig pathTrần toolTransportSampling
Claude Desktop~/Library/Application Support/Claude/claude_desktop_config.jsonNonestdio, SSEYes
Cursor~/.cursor/mcp.json hoặc .cursor/mcp.json40stdio, SSE, HTTPPartial
Windsurf~/.codeium/windsurf/mcp_config.json100stdio, SSE, HTTPPartial
gptme~/.config/gptme/config.tomlNonestdioNo
ChatGPT Dev ModeUI addNonestdio, HTTPNo
OpenAI Agents SDKCodeNonestdio, HTTPYes
Continue.continue/mcpServers/*.yamlNonestdio, SSE, HTTPNo

Bảng này có hai cột đáng chú ý. Trần tool: Cursor 40, Windsurf 100, các client còn lại không hardcap nhưng vẫn ăn context window. Sampling: chỉ Claude Desktop và OpenAI Agents SDK support đầy đủ, Cursor và Windsurf đang dần rollout. Đa số use case bạn không cần sampling, đừng lo. Hệ quả thiết kế: nếu muốn server max compatible, focus vào tools và resources, transport stdio và Streamable HTTP, auth OAuth 2.0. Tránh prompts làm phần chính, tránh sampling.

Khi nào nên ship MCP để dùng đa client

Câu hỏi business: bạn build MCP server cho team, có nên ship theo chuẩn protocol thay vì hardcode tool vào agent?

Ship MCP server khi có ít nhất 2 client khác nhau sẽ dùng (một bạn xài Cursor, một bạn xài Claude Code, một bạn xài ChatGPT Developer Mode); tool stateless hoặc state minimal (state thuộc về client, đã bàn ở bài MCP gốc); hoặc bạn muốn share với community hay public registry sau này. Hardcode tool trực tiếp khi chỉ một agent duy nhất dùng và không có khả năng share, hoặc tool cần state phức tạp hay real-time bidirectional (WebSocket), hoặc performance critical không chịu được overhead MCP RPC.

Trong thực tế tôi thấy số tool đáng wire qua MCP nhiều hơn số người nghĩ. Một MCP server cho database internal, deploy một lần, cả team Cursor + Claude Code + Continue + Codex dùng chung. ROI cao hơn nhiều so với mỗi agent tự wire riêng.

Pitfall thường gặp khi multi-client

Một số bài học sau khi tôi ship MCP server dùng đa client.

Tool name namespacing. Nếu nhiều server cùng expose query, client confused. Prefix tool name: pg_query, mysql_query, redis_query. Đa số client không namespace tự động. Trần tool limit. Cursor 40, Windsurf 100. Server expose 50 tool sẽ ăn hết slot Cursor, không còn chỗ cho server khác. Pruning tool list khi build server, đừng expose tool ít dùng. Path absolute trong stdio. Khi config command: npx, đường PATH client thấy có thể khác shell user. Cursor và Windsurf hay không tìm thấy npx nếu user dùng nvm. Workaround: dùng absolute path command: /Users/me/.nvm/versions/node/v22/bin/npx. Restart không refresh. Một số client cache tool list. Sau khi edit MCP config, restart hoàn toàn (kill process, không reload window).

Secret leak qua env. Khi share config file, đừng push token vào git. Dùng env var reference, lấy từ shell, hoặc dùng secret manager của client (Continue Mission Control, Cursor settings store). Version mismatch SDK. Client A có thể dùng MCP SDK v1.0, client B v1.2. Một số tool method được rename hoặc deprecated giữa version. Pin MCP SDK version cụ thể (đừng dùng * hoặc latest), test với MCP Inspector trước khi public release. Concurrent connection. Một số client (Cursor, Windsurf) connect lại server mỗi lần chat mới. Một số khác (Claude Desktop) duy trì connection. Nếu server có resource tốn kém để khởi động (database connection pool, large model), thiết kế init nhanh, hoặc lazy-init khi tool đầu tiên được gọi.

Lời kết

MCP là một protocol, không phải feature của Claude Desktop. Build server theo chuẩn, server đó chạy với Cursor, Windsurf, gptme, ChatGPT Developer Mode, Codex, Continue, và nhiều client khác sẽ adopt trong tương lai. Phần khó không phải code server, mà là design tool sao cho universal. Tránh state server, tránh tool quá nhiều (trần Cursor), namespace tool name, handle PATH absolute. Mấy điều này không có trong spec MCP, chỉ học qua thực hành.

Series MCP từ zero sắp khép lại. Bài 13 tổng kết roadmap 2026-2027 dưới AAIF Linux Foundation, các spec sắp ra (auth scoping per-tool, batch tool call, streaming response), và bạn nên đầu tư thêm vào đâu nếu serious về MCP.

Sources