AI & MCP
MCP vs CLI: a framework for choosing the right tool interface for AI
Speakeasy Team
March 6, 2026 - 8 min read
They aren't mutually exclusive
This article was born out of a passionate internal Slack thread. Externalizing where we landed so that other teams can skip the debate and get back to shipping.
The internet has opinions about MCP vs CLI. Hacker News threads overflow with passionate arguments that CLIs are the only serious tool interface for AI agents, while others insist MCP is the future and CLIs are legacy thinking. A recent benchmark found both achieve similar success rates with MCP being slightly faster. Justin Poehnelt’s post on rewriting CLIs for agents sparked a long thread that essentially concluded with people reinventing MCP’s core features one suggestion at a time.
The debate is a false dichotomy. Both CLIs and MCP servers have a place in the AI transformation companies are undergoing. They serve different personas, different use cases, and different runtimes. The interesting question isn’t which one wins. It’s when to use each.
Two interfaces, two worldviews
CLIs and MCP servers emerge from fundamentally different assumptions about who is using them and where they run.
MCP assumes no local execution environment. No shell, no filesystem, no installed runtimes. The agent connects to a URL, authenticates through OAuth, and makes structured tool calls with well-defined input and output schemas. Distribution is a URL, and updates ship to every client at once.
CLIs assume a developer environment. A shell, a filesystem, environment variables, and a rich ecosystem of composable tools. The agent installs a binary, authenticates however the provider chose to implement auth, and runs commands whose text output can be piped, filtered, and transformed. Distribution goes through package managers like Homebrew, and users update on their own schedule.
Neither assumption is wrong. They’re just different, and the differences cascade into every design decision.
Where CLIs shine
CLIs have real, concrete advantages that aren’t going away.
Composability and token efficiency
The Unix philosophy of small, composable tools maps naturally to how coding agents work. An agent can chain gh pr list --json number,title | jq '.[] | select(.title | contains("fix"))' and get exactly the data it needs, nothing more. Every irrelevant field stripped away is tokens saved, and as one analysis found , this can mean up to 35x fewer tokens in real-world comparisons.
MCP tool calls are isolated by default. There’s no built-in convention for chaining calls or pruning results at the protocol level. Applications can solve this (code mode being the most common approach), but the Unix pipe is a solved problem that agents already know how to use.
Transparency and debuggability
When an agent runs a CLI command, you can copy that exact command, paste it into your terminal, and reproduce the result. The audit trail is a shell history. When something goes wrong with an MCP tool call, you’re spelunking through JSON-RPC transport logs trying to reconstruct what happened.
LLMs already know CLIs
Models were trained on billions of lines of shell scripts, Stack Overflow answers, and README files with CLI examples. When an agent encounters git, curl, kubectl, or gh, it draws on deep training data. For popular CLIs, the agent doesn’t even need to read help text, it already knows the flags.
Progressive disclosure through subcommands
CLIs have a natural hierarchy for progressive disclosure: top-level commands, subcommands, and --help at every level. An agent can explore aws s3 before diving into aws s3 cp, building understanding incrementally without loading hundreds of tool definitions upfront. This structure is proven over decades of developer tooling.
Where MCP wins
The advantages of MCP are equally concrete and become critical in different contexts.
Distribution without intermediaries
An MCP server is a URL. Share it in a Slack message, embed it in documentation, or post it on a landing page. Any MCP-compatible client, whether that’s Claude Desktop, a custom agent, or an enterprise chat platform, can connect to it immediately. No package manager, no installation step, no version compatibility concerns.
Compare this to CLI distribution: brew install, apt-get, npm install -g, downloading binaries, adding to PATH, and then hoping the installed version matches what the documentation describes. Let’s not kid ourselves that brew install is easier to distribute than a URL.
Auth that works for everyone
MCP defines auth as part of the protocol . Servers can support OAuth 2.1 with dynamic client registration, OAuth 2 client credentials, API keys, or other schemes, and any compliant client knows how to handle them. For chat clients, that means a non-technical user can complete an OAuth flow without leaving the interface. For background agents, headless schemes like client credentials and API keys slot in just as cleanly.
CLIs have no standardized auth. Every tool invents its own approach: gh auth login, aws configure, environment variables, config files, API keys pasted into terminals. This works for developers. It doesn’t work for the product manager who needs to query your API from ChatGPT.
Schema-first by design
Every MCP tool declares its input and output schemas as part of the protocol. Agents know exactly what parameters a tool expects, what types they are, and what the tool returns, before making a single call. This eliminates an entire class of errors where agents hallucinate flag names or misformat arguments.
CLIs are inherently schema-less. The --help output is unstructured text that an agent must parse and interpret. Poehnelt’s article makes a compelling case for adding schema introspection to CLIs , but this is retrofitting a feature that MCP provides natively.
Automatic updates and security
When you fix a vulnerability or ship a feature in your MCP server, every connected client gets the update immediately. There’s no “please update to the latest version” email. No checking whether users are running a version with a known security issue.
CLI updates typically require users to actively pull new versions. In practice, many users run outdated CLIs for months. For security-critical tooling, this gap between “fix deployed” and “fix adopted” is a real liability.
Rich experiences beyond text
MCP isn’t limited to text input and output. MCP Apps enable servers to contribute rich, interactive UI elements to the conversation, turning a tool call into a full user experience. A CLI, by definition, produces text.
A practical framework
Rather than picking a side, consider the following dimensions when deciding which interface to build or expose.
Who is the audience?
If the primary users are developers working in coding agents (Claude Code, Cursor, Windsurf), CLIs are the natural fit. These agents have shell access, and developers are comfortable with CLI workflows. The agent can install the CLI, authenticate, and start composing commands with the rest of the developer’s environment.
If the audience includes non-developers, operations teams, or anyone using a hosted chat interface without shell access, MCP is the only practical option. These users can’t run brew install and shouldn’t need to.
What runtime environment is available?
In a coding agent with shell access, CLIs can leverage the full power of the local environment: reading files, accessing environment variables, piping output through jq, and chaining multiple tools together. MCP tool calls happen in isolation from the local environment, which is both a limitation and a security feature.
In a hosted chat platform, a mobile app, or an enterprise agent deployment, there’s no shell. MCP servers work everywhere an HTTP connection is available. CLIs require sandboxed execution infrastructure that most organizations don’t want to maintain in production.
How critical is security and governance?
MCP servers run in a controlled environment with well-defined boundaries. The server decides what data to expose and what operations to allow. Auth scoping, rate limiting, and audit logging happen at the server level.
CLIs running in a shell have access to everything the shell has access to. An agent with bash access can, in principle, do anything the user can do. This is powerful for development but concerning for production deployments where you want to limit blast radius.
How important is token efficiency?
For API surfaces with hundreds of operations, CLIs can be dramatically more token-efficient. An agent doesn’t need to load any tool definitions upfront. It discovers capabilities through --help and subcommand exploration, loading only what it needs.
MCP servers face the context bloat problem when exposing large APIs. The GitHub MCP server, for example, registers 93 tools consuming roughly 55,000 tokens before a single query. Dynamic toolsets using meta-tools like search_tools, describe_tools, and execute_tool solve this effectively, but the solution requires thoughtful implementation.
The convergence
The interesting thing is that this whole discussion may be moot if CLIs and MCP converge.
Every recommendation for making CLIs “agent-friendly” moves them closer to MCP. Add schema introspection? That’s describe_tools. Add structured JSON output? That’s MCP’s typed responses. Add --dry-run validation? That’s what a well-designed MCP tool does before executing mutations. The Poehnelt article is, in many ways, a guide to reimplementing MCP concepts inside a CLI.
Going the other direction, giving an MCP server a bash tool that can execute CLI commands inside a sandboxed environment effectively turns CLI tools into MCP-accessible resources.
The practical path for most companies is to build both interfaces on top of a shared core, choosing depth of investment based on audience and deployment context. For developer-facing tools where coding agents are the primary consumer, invest in a great CLI with structured output and schema introspection. For broad consumption across an organization or externally, invest in a well-designed MCP server with dynamic toolsets.
The question was never “MCP or CLI?” It was always “MCP and CLI, and when to reach for which.”