MCP 生態大爆發:Inspector/CI-CD 工具鍊助你管好幾十個 MCP Server
2025 年頭,你只要管好一個 MCP server 就算交到貨。到咗 2026 年中,MCP 生態由官方十幾個 reference server 膨脹到 GitHub 上過萬個 community server——檔案系統、數據庫、瀏覽器自動化、Slack、飛書、GitHub Actions,乜嘢都可以 plug 入 AI agent。問題唔再係「點樣寫一個 MCP server」,而係「點樣管好幾十個 MCP server,仲要確保每一條 tool call 唔會喺 production 先出事」。
第一個救命工具:MCP Inspector
Anthropic 官方出嘅 MCP Inspector 係你 debugging 嘅第一道防線。一句 npx @modelcontextprotocol/inspector node build/index.js 就起一個本地 web UI,可以逐個 tool 打、逐個 resource 睇、逐個 prompt 試。
佢嘅架構好簡潔:一個 React 前端(MCPI)加一個 proxy server(MCPP),前者俾你互動操作,後者做 protocol bridge 駁落你嘅 server。支援 stdio、SSE、streamable-HTTP 三種 transport。仲有 CLI mode 可以用 --cli 參數直接喺 terminal 串成自動化流程——呢個係 CI/CD pipeline 嘅關鍵。
有一點值得一提:2025 年中 Oligo Security 發現咗 CVE-2025-49596,一個 CVSS 9.4 嘅 RCE 漏洞,攻擊者可以透過瀏覽器 0.0.0.0-day 向本地 Inspector proxy 發送請求執行任意指令。Anthropic 喺 v0.14.1 加入咗 session token 同 origin 驗證。如果你仲用緊舊版,即刻 upgrade——npx @modelcontextprotocol/inspector 或者檢查 npm list -g @modelcontextprotocol/inspector。
MCPJam:唔止係 Inspector 嘅升級版
如果話 MCP Inspector 係「顯微鏡」,咁 MCPJam 就係「CT 掃描儀」。佢將測試提升到另一個層次:
- Chat with model-in-the-loop:唔係淨係直接 call tool,而係俾一個 agent 喺對話中自動揀 tool、傳參數、睇 response。你可以見到 AI agent 點樣理解你個 server 嘅 tool description,係咪真係傳得啱參數。
- 多模型 A/B 比較:同一句 prompt 同時行 GPT-5.5、Opus 4.7、Gemini 3.1,逐個 turn 比較 latency、token 用量、tool selection 準確度。
- OAuth flow debugging:逐個 redirect 同 token exchange step-through,支援晒 2024-2025 四個 spec 版本同所有 client registration 方法。
- Local-to-production tunnel:內置 ngrok integration,本地起嘅 server 可以俾 production ChatGPT 或 Claude 直接 call,你喺 MCPJam 睇到完整 logs。
對於做 SaaS 嘅香港團隊嚟講,MCPJam 最值錢嘅功能係「模擬多個 agent client 同時存取你個 server」——你唔使再靠人手逐個試。
CI/CD 工具鍊:將 MCP 測試自動化
管好幾十個 MCP server 嘅唯一出路係 automation。以下係我過去半年搭建嘅 toolchain:
1. Unit test 層:tools/list 同 resources/list 一致性檢查
用 MCP Inspector CLI mode 寫 script,每次 build 完自動 run --method tools/list,確認 schema 符合預期,無撞名、無 missing description。Python 嘅話可以用 mcp 套件直接寫 pytest。
2. Integration 層:E2E agent 測試 用 MCPJam 嘅 API 或者自己起一個 test agent,對每個 server 行一組 golden prompt,驗證 tool call 嘅 response 結構、error handling、timeout 行為。將呢啲測試塞入 GitHub Actions,每次 PR 自動行。
3. Production 層:健康檢查 + 版本鎖定
定義晒所有 MCP server 嘅 config(mcp.json 或 claude_desktop_config.json),用 Git 管理版本。deploy pipeline 自動對比每個 server 嘅 capability negotiation 結果同 baseline,唔一致就 rollback。
4. Config export 自動化
MCP Inspector 嘅 Servers File Export 功能可以直接生成 Cursor、Claude Code 嘅 config entry。將呢個 export 整合入 CI,每次 merge 自動 generate 一份最新 mcp.json commit 落 infra repo。
行動建議
如果你而家仲係人手 npm start 然後開 browser 逐個 tool 試,停一停。以下三件事今日就做:
- upgrade 所有 MCP Inspector 到最新版(確認 v0.14.1+),唔好做嗰個俾 browser exploit 嘅 developer
- 將一個 MCP server 嘅測試流程塞入 CI——先用 Inspector CLI mode 做 smoke test,再加 MCPJam 行一組 golden prompt
- 用 Git 管理 MCP 設定檔,唔好再喺 claude_desktop_config.json 手動改 path、改 env
MCP 生態只會愈來愈大。而家建立好工具鍊,第日管理一百個 server 嘅時候你會多謝今日嘅自己。