BPM, Workflow, and Case

BPM, Workflow, and Case

Come for answers. Stay for best practices. All we’re missing is you.

 View Only

MCP vs CLI: Two Ways to Let AI Take Action (and Why It Matters)

By Jia Qi posted Wed April 08, 2026 11:04 AM

  

There’s a growing shift in how AI systems interact with the real world.
If you’ve been exploring agents, coding assistants, or automation tools, you’ve likely encountered two patterns:

  • MCP (Model Context Protocol)

  • CLI-based execution (Command Line + feedback loop)

At first glance, they seem like two ways to solve the same problem.
But under the hood, they represent two very different philosophies.

This post walks through them step by step—from intuition to real trade-offs—so you can clearly understand:

  • How each works

  • Why token cost behaves differently

  • Where each approach shines

  • Why modern systems are moving toward hybrid designs



1. The Three Roles in Any AI System

Before comparing MCP and CLI, we need to clarify roles:

1. Human

Provides intent:

“Delete database db_123”


2. LLM (Large Language Model)

Responsible for:

  • Understanding intent

  • Generating decisions (tool call or command)

It does not execute anything.


3. Agent (Orchestrator)

Responsible for:

  • Calling the LLM

  • Executing actions (API or CLI)

  • Feeding results back to the LLM


👉 Key idea:

The LLM decides, the Agent executes.


2. Path A: MCP (Structured Tool Calling)

Let’s walk through the same task:

“Delete db_123”


Step 1: Agent sends tools + prompt to LLM

User: Delete db_123

Available tools:
- deleteDatabase(dbId: string)
- queryDatabase(...)
- ...

Step 2: LLM selects a tool

{
  "tool": "deleteDatabase",
  "args": { "dbId": "db_123" }
}

Step 3: Agent executes via MCP server

  • Calls actual backend API

  • Deletes database


Step 4: Result returned

{ "status": "success" }

What just happened?

  • LLM chose from a predefined set of tools

  • Execution happened outside the model


👉 MCP is:

Structured, deterministic tool selection


3. Path B: CLI (Command + Feedback Loop)

Same task:

“Delete db_123”


Step 1: Agent sends prompt (no tools)

User: Delete db_123

Step 2: LLM generates a command

db delete db_123

Step 3: Agent executes in environment

> db delete db_123

Step 4: Feedback loop

If error:

Error: database not found

LLM tries again:

db delete --force db_123

👉 CLI is:

Guess → Execute → Observe → Correct


4. The Core Difference

This is the most important distinction:

MCP CLI
Selects from known tools Generates commands
Deterministic Probabilistic
One-shot correctness Iterative refinement
Schema-driven Feedback-driven

👉 In one sentence:

MCP eliminates guessing; CLI embraces it and corrects over time.


5. Why MCP Feels “Natural”

MCP mirrors how developers design APIs:

  • Define capabilities

  • Provide schema

  • Enforce correctness

Example:

deleteDatabase(dbId: string)

The model doesn’t need to guess:

  • Function name

  • Parameters

  • Structure


👉 MCP philosophy:

“Define the world clearly so the model can’t go wrong.”


6. Why CLI Feels “Magical”

With CLI, there is no schema.

The model generates:

db delete db_123

But how does it “know”?

It doesn’t.


👉 It relies on:

1. Pattern learning

Most systems follow:

<system> + <action> + <target>

2. Context hints (optional)

You can use:
- db delete <id>

3. Feedback loop

Error → Fix → Retry

👉 CLI philosophy:

“The world is messy—let the model explore and converge.”


7. Token Cost: The Real Trade-Off

This is where things get interesting.


MCP: Heavy per request

Each call includes:

  • User input

  • All tool definitions

Example:

  • 30 tools × 150 tokens = 4500 tokens

  • Every single request repeats this


👉 Even a simple request becomes expensive.


CLI: Light but iterative

Each step includes:

  • Prompt

  • Command

  • Error/log

Example:

  • 3 iterations × 300 tokens = 900 tokens


👉 Even with retries, it’s often cheaper.


Key Insight

MCP = few steps, heavy context
CLI = more steps, lightweight context


8. Information Density Matters

Another subtle but critical difference:


MCP input

{
  "name": "...",
  "parameters": {...}
}

👉 Mostly definitions


CLI feedback

Error: permission denied

👉 Highly actionable signal


👉 CLI provides:

Better learning signals per token


9. Where MCP Breaks Down

In simple systems, MCP works great.

But in complex environments (like coding):


Problem 1: Tool explosion

You’d need tools for:

  • File operations

  • Git

  • Testing

  • Build systems

  • Package managers

👉 Easily 50–200 tools


Problem 2: Token explosion

Every request includes all tool schemas.


Problem 3: Composition complexity

The model must chain tools manually:

readFile → edit → writeFile → runTests

👉 This becomes unnatural for LLMs.


10. Why CLI Fits Coding and DevOps

Because the real world already looks like this:

npm install
npm test
git commit
docker build

Each command hides complexity:

  • Execution pipelines

  • Dependencies

  • Side effects


👉 CLI advantage:

Compresses complex workflows into simple language actions


11. Where MCP Shines

MCP is still essential in many domains.


Best for:

1. Business systems

  • Workflow engines

  • Approval processes

2. Financial / regulated environments

  • Strict validation

  • No room for trial and error

3. Structured APIs

  • Stable interfaces

  • Predictable inputs


👉 These systems require:

Correctness over flexibility


12. Where CLI Wins

CLI excels in:

1. Coding agents

  • Iterative debugging

  • Trial-and-error workflows

2. DevOps

  • Shell-based environments

  • Logs as feedback

3. Data processing

  • Script-driven pipelines


👉 These systems benefit from:

Exploration over precision

⚠️ A Note on Safety: CLI Needs a Harness

While CLI-based systems are powerful, they also introduce risk because the model can generate arbitrary commands, such as

rm -rf /  
# Recursively (-r) and forcefully (-f) delete everything from the root directory (/),
# removing all files and folders on the system without confirmation.
# This will completely wipe the system and make it unusable.

In practice, this is mitigated by adding a harness layer in the Agent, which enforces safety constraints such as:

  • allowlist (only permitted commands like db)
  • sandbox (restricted execution environment)
  • dry-run (simulate before actual execution)

This harness acts as a control layer between the LLM and the system.

(For a deeper explanation of harness design, see: “Making Sense of AI: From LLMs to Agents and AI Systems”)


13. The Hidden Truth

This is the deeper insight:


MCP approach

“Tell the model everything upfront.”


CLI approach

“Let the model discover the solution step by step.”


👉 Two fundamentally different ways to handle uncertainty.


14. The Future: Hybrid Systems

In practice, the best systems combine both.


Example hybrid:

  • CLI for:

    • Code execution

    • Testing

    • File manipulation

  • MCP for:

    • Payments

    • User data updates

    • Critical business actions


👉 Why?

Because:

  • CLI is flexible but risky

  • MCP is safe but heavy


Hybrid principle

Use MCP where mistakes are expensive
Use CLI where iteration is expected


15. Final Mental Model

If you remember nothing else, remember this:


MCP is about removing uncertainty
CLI is about managing uncertainty


And the real world needs both.


16. One-Line Summary

MCP tells the model exactly what it can do;
CLI lets the model figure out what to do—and improve through feedback.


Once you see this, the design choices behind modern AI systems start to make a lot more sense.

0 comments
17 views

Permalink