MCP、CLI、Skill 三者如何选择

决定一个 AI feature 该用 MCP server / CLI / Skills / LLM function calling, 不是技术品味问题, 是 token economics + audience + governance 三轴决策。

§0. 核心结论 (30 秒版本)

四种"让 LLM 调用工具"的方式, 不是替代关系, 是不同场景的最优解:

方式一句话定义Token 成本适合场景
CLI (gh, aws)binary 工具, 在 shell 跑~200 / task内部 dev workflow, LLM 已知工具
Anthropic Skills800-token markdown 教 LLM 怎么用 CLI~800-2K / load公司内部 CLI 的特殊用法教学
LLM Function Calling你 backend 直接告诉 LLM 可用 function几 K / call客户在你 SaaS 内部用 AI
MCP serverJSON-RPC server, LLM 通过 protocol 调用~55K / connection外部 AI agent (ChatGPT/Claude Desktop) 连你 SaaS

Token 排序: CLI < Skills < Function Calling < MCP。默认选小的, 只在场景必须时用大的


§1. 2026 业内对 MCP 的真实 backlash

2026 年 3 月业内对 MCP 出现 backlash 的真实数据:

信号数据
GitHub MCP server 接进 context 的 token 数~55,000 tokens (还啥都没干)
三个 MCP server (GitHub + Playwright + IDE) 占 context143K tokens / 200K context = 72%
800-token Skills file vs 28,000-token MCP schemaSkills file 实测 outperform
CLI vs MCP 单次 task token costCLI 便宜 4-32x
CLI vs MCP 单次 task reliabilityCLI 100% vs MCP 72%
公开 MCP servers (1,847 个 audited) abandoned ratio52%

Public 抛弃 MCP 的 case (2026/3 同期爆发):

  • Perplexity CTO (Denis Yarats): "We are moving away from MCP internally, going back to REST APIs and CLIs"
  • Y Combinator CEO (Garry Tan): "MCP sucks honestly" — 引用 (a) 吃 context window 太多 (b) 认证 broken (c) "我 30 分钟写个 CLI wrapper 就替代了"
  • Simon Willison (Python 社区核心 + Anthropic 顾问): "Skills might be a bigger deal than MCP"

MCP 不死, 但找到真 sweet spot: Tyk 原话 "MCP 不死, 只是退出 hype phase, 进入 enterprise actually ships with it 阶段"。真正用 MCP 赢的是 GitHub / Linear / Notion / Stripe — 把 MCP 作为 product 卖给企业客户的 SaaS


§2. MCP 协议本质

3 个 capability primitives:

  • Tools — LLM 可调用的 actions (add_order_item, lookup_table_status)
  • Resources — LLM 可读的 read-only 数据 (current_menu.json, tonight_reservations.json)
  • Prompts — 预设 task template (generate weekly insights for franchise X)

MCP server 最小实现需要:

  1. JSON-RPC 2.0 endpoint (HTTP/SSE for remote, stdio for local)
  2. Tools 定义 (JSON Schema describing inputs/outputs)
  3. 业务执行逻辑 (可以调你的 REST API、直接调 DB、发 message queue、whatever)
  4. Auth: OAuth 2.1 (remote) 或 API key (local)
  5. 错误处理 + 限流

MCP server 部署模式:

  • Local stdio: 用户机器跑 (Claude Desktop pattern), 适合 dev tools
  • Remote HTTP/SSE: 你的云跑 (AWS Lambda / Cloudflare Workers / ECS), SaaS 通常这个
  • MCP Gateway (2026 新类别): 多个 MCP server 前的反向代理, handle session 路由、auth、observability

Spec version: 当前 2025-11-25, 下一版 RC 2026-07-28。Production 必须用 remote HTTPS transport + OAuth 2.1/OIDC


§3. 务实决策树

Q1: 这个 AI feature 是给"内部团队 / dev workflow"用?
    → CLI / Skills (token 便宜 4-32x, reliability 100%)
    例: 工程师用 Claude Code 写代码, 让 Claude 帮忙跑 git/aws/dotnet CLI

Q2: 这个 AI feature 是给"外部 AI agent 在 ChatGPT/Claude Desktop 接你 SaaS"用?
    → MCP server (OAuth + multi-tenant + standard protocol)
    例: 餐厅老板用 Claude Desktop 连你 SaaS,
        说 "把所有 6 家店 happy hour 设到 5-7pm"

Q3: 这个 AI feature 是给"客户在你 SaaS 内部用"(dashboard 里的 AI assistant)?
    → 既不用 CLI 也不用 MCP, 直接 LLM function calling
       (OpenAI tools / Anthropic tool use)
    → 你自己 backend 直接调 internal API, 不需要 protocol 层
    例: 老板在 SaaS dashboard 点 "AI 生成本周报表", LLM 直接调你 internal API

核心 framing: 个人 / 小团队 default CLI, enterprise multi-tenant default MCP, 中间地带 Skills。


§4. MCP server 真 sweet spot — 什么场景 CLI cover 不了

场景为什么 CLI cover 不了
客户的 ChatGPT/Claude 直接调用你 SaaS dataChatGPT/Claude 进不去客户 server 跑 CLI, 但能调你 MCP server (HTTPS + OAuth)
N 个 SMB 客户, 每家独立 OAuth scopeCLI 没有 OAuth, 只有 env var token, 无法 multi-tenant
Audit trail "谁让 AI 调了什么 tool"CLI 调用记录散在 shell history, MCP 强制 per-call audit log
企业 governance "限制 AI 只能调 read-only tool"CLI 完全 open, MCP 有 RBAC + tool capability scoping
跨公司 standardized integration每家 CLI 不同, MCP 是 protocol standard

判断要点: 你的 AI feature 客户是不是"在他自己电脑上跑 LLM client"? 是 → MCP。否 → 多半不需要。


§5. 自建 MCP server 经济账

维度数据
MVP 自建成本$25K-50K
生产级 multi-tenant MCP server$60K-150K (Bacancy 报价 $25K-400K+)
Hidden operational cost (12 month)+30-50% on initial dev budget
Token spend (LLM API)$500-25K/月 (随 traffic + tool catalog)
Vector DB 月费$70-500/月 (SMB workload)
Monitoring + logging + alerting$300-2,500/月
自建划算的 threshold3+ AI integrations 同时跑

结论: 你 SaaS 当前 0-2 个 AI integration → 不该自建 MCP server, 用 partner 提供的 MCP server。


§6. MCP 自建 vs Hosted Platform 4-Layer 生态 (2026)

┌─────────────────────────────────────────────────────┐
│  Layer 4: 你的 Application / Use case               │
│  (e.g. internal AI ops assistant / 客户 AI 集成)    │
└─────────────────────┬───────────────────────────────┘

┌─────────────────────────────────────────────────────┐
│  Layer 3: MCP Gateway (反向代理 + multi-MCP 管理)    │
│  TrueFoundry MCP Gateway / MintMCP / 自托管 OSS    │
└─────────────────────┬───────────────────────────────┘

┌─────────────────────────────────────────────────────┐
│  Layer 2: Hosted MCP Platforms (帮你跑 MCP server)  │
│  Composio (500+ integrations) / TrueFoundry /       │
│  Smithery / Glama (discovery + hosting)             │
└─────────────────────┬───────────────────────────────┘

┌─────────────────────────────────────────────────────┐
│  Layer 1: Pre-built MCP Servers (现成的, 免费/付费)  │
│  Glama Registry: 26,226 个 open-source MCP server   │
│  GitHub / Linear / Notion / Stripe 官方出的         │
│  Anthropic 官方 reference servers                    │
└─────────────────────────────────────────────────────┘

三种拿到 MCP 能力的路径

路径 A — 用现成 MCP server (zero build cost)

适合: 工程团队想让 Claude 接 GitHub / Linear / Notion / Stripe / Slack 等 SaaS 数据。

# 例: 装 GitHub 官方 MCP server
npm install -g @modelcontextprotocol/server-github
# 然后在 Claude Desktop 配置文件加几行 JSON

Cost: $0 (open source) 或 $10-50/月 (Composio Pro hosted) Time: 半天 风险: 跟前面讲的 token 成本 / 52% abandoned 问题。只在 Q1/Q2 场景用

路径 B — Hosted MCP Platform 帮你建

适合: 你想给客户提供 "他能用 ChatGPT/Claude 接你 SaaS" 能力, 但不想自己运维 MCP infra。

Platform强项弱项月费
Composio500+ pre-built integrations, breadth 最广enterprise governance 弱$50-500
TrueFoundryfull lifecycle, sub-3ms latency, OAuth 2.0 identity injectionlearning curve 高$500-5K
MintMCP简洁, 跟 LangChain 生态 align新公司, prod 案例少$100-1K
Glama26K+ MCP server discovery + hosting更多 marketplace 不是 platform免费 (discovery) / $50+ (hosting)
Smithery早期 MCP marketplace商业化不明mostly free

Cost: $500-$5,000/月 (取决 tenant 数 + traffic) Time: 2-4 周 默认推荐: TrueFoundry (full lifecycle, 给 multi-tenant SMB 客户最稳)

路径 C — 完全自建 MCP server

适合: 极特殊场景 (例如需要跟 internal 支付链路深度集成, hosted platform 拿不到 access)。

Cost: $25K-150K MVP + $500-25K/月 operational Time: 1-3 月 Team: 1 senior backend + 1 security + 1 SRE 适合何时: 几乎从来不应该选。Year 2+ 再说。


§7. 如果你真要建自己的 MCP server

v1 应该只暴露 read-heavy tools

✅ 允许 (read-only):
  get_location_profile
  get_menu
  get_order_status
  get_daily_sales_summary
  get_review_insights
  create_ad_campaign_draft  ← draft only, not auto-publish

❌ 禁止 (destructive — 至少 human approval + step-up auth + immutable audit log):
  refund_payment
  delete_menu_item
  change_store_hours
  modify_customer_data
  cancel_order

Transport + Auth (production 必需)

  • HTTPS (不能 stdio for production)
  • OAuth 2.1 + PKCE + iss parameter validation per RFC 9207
  • Streamable HTTP transport with Mcp-Method + Mcp-Name headers (load balancers/gateways 用)
  • Session ID format: <tenant_id>:<user_id>:<session_id>
  • W3C Trace Context propagation in _meta (cross-SDK distributed tracing)

Production 必须 stateless

为 scalability, default stateless MCP server — 每个 request carry all necessary context。stateful 只用于真的需要 session resource 的场景。


§8. 给特定公司怎么用

Internal dev workflow (case Q1)

工程团队用 Claude Code + 现成 CLI (gh / aws / dotnet / mongosh / docker)。写几个 Anthropic Skill 教 Claude 怎么用这些 CLI 在公司 specific scenario 下。0 backend 改动, PM 1 周写完几个 skill。

→ 详细 tutorial 见 build-cli-with-skills-2026.md

客户在 dashboard 内用 AI (case Q3)

LLM function calling 直接调 internal REST API。不需要 MCP, 不需要 CLI

客户想用 ChatGPT 接你 SaaS (case Q2)

4 个 signal 出现任一才考虑:

  1. 客户主动问 "我能不能在 ChatGPT 里连你 SaaS?"
  2. 客户的 AI agent 想接入 (e.g. 老板自己买了 Cursor)
  3. 大 enterprise 客户要求 "用我们公司 AI assistant 集成"
  4. 你自己要做 MCP marketplace (像 Linear / Stripe)

→ 详细 hosted vs build 决策见 mcp-platforms-vs-build-yourself.md


§9. Sources

MCP 官方

2026 业内 debate

MCP vs REST API

Hosted MCP platforms