一个开发者说了六个字,引发了一场关于 AI 应该怎么跟外部工具打交道的讨论。这件事听起来很技术,但它决定了你以后用 AI 的体验好不好。
CLI vs MCP — 一个 19 万 Star 开发者引发的路线之争
你让 AI 帮你查日历、发邮件、操作 Git 的时候,AI 需要「调用工具」。就像你让一个助理帮你做事,助理得知道怎么用你办公室里的电话、打印机、门禁卡。现在有两种方式让 AI 认识这些工具,开发者圈子里在争哪种更好。
CLI 是命令行工具,已经存在几十年了。你电脑上的 Git、Docker、各种开发工具都有命令行版本。AI 直接在终端跑命令就能用,不需要额外的东西。
MCP 是 Anthropic 推的一套新协议(Model Context Protocol),让 AI 通过标准化的接口去连接外部服务——你的 Google Drive、Slack、日历、邮箱。它多了一层,但这一层带来了权限管理和安全控制。
今年 1 月,一个叫 Peter Steinberger 的开发者(后来被 OpenAI 招走了)在网上说了六个字:
他的意思是:AI 要用什么工具,直接在终端跑命令就行了,干嘛非要走一套复杂的协议?跑命令更快、更省钱(省 token),而且这些命令行工具已经存在了,不需要等谁给你开发一个新的接口。
反对的人说:你是开发者,你看到一条危险命令会自己停下来。但普通用户不会。如果 AI 要代表你去操作你的邮箱和日历,没有权限管理,万一它删错了东西呢?MCP 虽然多了一步,但这一步是保护你的。
你可能没有在终端跑过命令,但你一定用过 Claude 或 ChatGPT 连接你的 Google Drive、日历、邮箱。那个连接背后走的就是类似 MCP 的协议。
目前看,两条路并存的可能性最大:
Steinberger 不是随口说说。他给自己的项目 OpenClaw 写了大约 10 个自定义 CLI 工具,让 AI agent 通过 bash 调用,完全绕过 MCP。OpenAI 显然觉得这个思路有价值,后来把他招了进去。
核心论点是 token 成本。Anthropic 自己的工程博客提到过,工具定义和工具返回结果有时候会在 agent 开始读你的请求之前就消耗掉 5 万甚至 13.4 万 token。GitHub 在整合工具集之后,光是减少工具列表就省了 2.3 万 token,大约 50%。这些 token 不是用来思考你的问题的,是用来「认识」它手头有哪些工具的。
CLI 不需要预加载这些说明书。agent 需要用 git 的时候直接跑 git log --oneline -10,需要的时候再查 --help。Steinberger 把这个叫 progressive disclosure:按需加载,不预付成本。
也是一条核心论点:CLI 需要你会判断命令安不安全。开发者在终端里看到 rm -rf / 会本能地停下来,但大多数人不是开发者。如果你的 agent 要代表用户去操作 Gmail、日历、Slack,你不能让它在用户机器上跑任意 bash 命令。
MCP 的价值在于标准化的接口描述、权限标注(哪些操作安全、哪些需要确认)、OAuth 认证流程。多租户场景下——如果你做的产品需要 agent 代表不同用户操作他们各自的 Google Drive、Jira——MCP 的治理模型值得它的开销。CLI 做不到这一点,除非你自己重新发明一套权限系统。
Matthew Hall 写了一篇回应文章,承认当前的 MCP 实现确实粗糙——他自己花了一小时排查为什么 Mac 变卡,最后发现 Claude Code 启动的 MCP server 留下了 100 多个僵尸 Node 进程。但他认为批评的是协议的早期实现,不是协议的上限。
| CLI | MCP | |
|---|---|---|
| Token 开销 | 低,按需调用 | 高,工具定义预加载 |
| 上手门槛 | 工具已存在,直接用 | 需要有人写 server |
| 安全模型 | 依赖用户判断 | 协议内置权限标注 |
| 多租户 | 不支持 | 原生支持 OAuth |
| 可组合性 | 管道(pipe)天然可组合 | 每个 server 独立 |
| 稳定性 | 成熟,几十年历史 | 早期,实现粗糙 |
| 适用者 | 开发者,终端用户 | 产品,面向终端用户的 agent |
Steinberger 后来做了一个工具叫 mcporter,一行命令把任意 MCP server 编译成一个独立的 CLI:
编译出来的东西存在本地,agent 需要时调用,不需要时不占 context。这不是「CLI 赢了」或「MCP 赢了」,而是把 MCP 的工具定义当作一种可编译的中间格式来用。
DEV Community 上有篇分析的判断可能最准:对 80% 到 90% 的开发者场景——写功能、跑测试、管 git、自动化自己的工作流——CLI 更快、更便宜、更稳定。对需要 agent 代表用户操作第三方服务的产品场景,MCP 的治理模型值得它的开销。2026 年聪明的做法不是选边站,而是两个都用。
未来可能是这样的:MCP 变成「工具说明书的标准格式」,CLI 变成「AI 实际干活的方式」。两层各管各的,MCP 定义能力,CLI 执行能力。
AI 连接工具的方式正在被重新定义。现在还没有赢家,两条路各有各的道理。但不管哪条路赢,对你来说结果是一样的:AI 能操作的东西会越来越多,操作的速度会越来越快,成本会越来越低。这场争论的终点是你用得更爽。
A developer's six-word take sparked a broader debate about how AI agents should connect to outside tools. It sounds technical, but it will shape how reliable and safe AI feels in daily use.
CLI vs MCP - a route debate started by a developer with 190K GitHub stars
When you ask AI to check a calendar, send an email, or operate Git, the AI needs a way to call tools. Imagine asking an assistant to work in your office: they need to know how to use the phone, printer, and access card. Developers are now debating which path AI should use to discover and operate those tools.
CLI tools have existed for decades. Git, Docker, and many development tools already have command-line versions. An AI agent can run those commands directly in the terminal without extra integration work.
MCP, or Model Context Protocol, is a protocol pushed by Anthropic for connecting AI to external services such as Google Drive, Slack, calendars, and email. It adds a layer, but that layer can carry permission management and security controls.
In January, developer Peter Steinberger, the creator of OpenClaw and later an OpenAI hire, made a blunt argument online:
His point: if an AI needs a tool, let it run the existing terminal command. It is faster, cheaper in tokens, and the tools already exist. Why build a new protocol for every tool?
The counterargument is safety. Developers can look at a dangerous command and stop. Most users cannot. If an AI is acting on your Gmail or calendar, you need permission boundaries and confirmations. MCP is heavier, but that heaviness is partly the guardrail.
You may never run commands in a terminal, but you have probably connected Claude or ChatGPT to Google Drive, calendar, or email. A protocol layer like MCP is what makes that feel manageable.
Steinberger was not just making a joke. In OpenClaw, he wrote around ten custom CLI tools and let the agent call them through bash, bypassing MCP entirely. OpenAI clearly found the pattern interesting enough to hire him later.
The core argument is token cost. Anthropic's own engineering writing has noted that tool definitions and tool results can consume tens of thousands of tokens before the agent even starts working on your request. GitHub reduced tool-list overhead by about 50% after consolidating tools. Those tokens are not spent thinking about your task; they are spent reading tool manuals.
CLI does not require preloading all those manuals. If the agent needs git, it can run git log --oneline -10 or check --help when needed. Steinberger calls this progressive disclosure: load information only when it is needed.
CLI assumes the user can judge whether a command is safe. A developer will stop at rm -rf /, but most users are not developers. If an agent operates Gmail, Calendar, Slack, or Jira on behalf of many users, arbitrary bash is not acceptable.
MCP's value is standardized tool descriptions, permission labels, OAuth flows, and a multi-tenant governance model. CLI can imitate this only by rebuilding a permission system from scratch.
Matthew Hall's response is useful here: current MCP implementations can be rough, but that is a criticism of early implementations, not necessarily of the protocol's ceiling.
| CLI | MCP | |
|---|---|---|
| Token cost | Low, called on demand | High, definitions preload |
| Setup | Tools already exist | Server must be built |
| Safety model | Depends on user judgment | Permission labels built in |
| Multi-tenant | Not native | OAuth-native |
| Composability | Pipes compose naturally | Each server is separate |
| Maturity | Decades old | Early and rough |
| Best for | Developers and local work | Products and user-facing agents |
Steinberger later built mcporter, which compiles any MCP server into a standalone CLI:
The compiled tool lives locally and is called only when needed. This is not "CLI wins" or "MCP wins." It treats MCP as a standard format for describing tools, and CLI as the execution path.
The practical judgment: for most developer workflows - building features, running tests, managing Git, automating local work - CLI is faster, cheaper, and more stable. For products where agents operate third-party accounts on behalf of users, MCP's governance model is worth the overhead.
The future may look like this: MCP becomes the standard format for tool descriptions, while CLI becomes one way agents actually execute work. MCP defines capability; CLI performs capability.
The way AI connects to tools is being redesigned. There is no final winner yet, and both routes have real logic. But the user-facing result is the same: AI will be able to operate more things, faster, at lower cost. The debate ends in a better tool experience for you.