XNews

Agentic CLI Token Costs Minimal for Familiar Commands

A detailed analysis compared MCP and CLI for AI agent tool use, concluding that CLI remains superior in many scenarios due to lower token costs, model familiarity, and simplicity. MCP has advantages in environments without terminal access, multi-user auth, and compliance. The author disagreed with claims that MCP is better in most cases.

Key insights

CLI Token Cost Advantage for Familiar Commands

For commands like gh, aws, kubectl that models already know from training data, CLI requires no schema injection in the context. The token cost is only the command itself (tens of tokens) plus the output. Even for unfamiliar CLI tools, --help can be used. This makes CLI significantly more token-efficient than MCP, which requires tool definitions even with deferred tools.

MCP Deferred Tools Reduce Context Overhead but Still Lag CLI

MCP's deferred tools feature allows tools to be marked with defer_loading: true, so only the tool name and short description are in the initial context, with full schema loaded on demand. Anthropic reports about 85% reduction in tool definition context for large tool sets. While this narrows the gap with CLI, it still does not match CLI's token efficiency for well-known commands.

Model Tool Calling Improvement Benefits Both, but MCP More

As models improve their tool calling abilities, both CLI and MCP benefit. However, MCP benefits more because its main disadvantage was the need to learn tools from schema. Stronger models can handle schema-based tool discovery more easily, reducing the advantage of CLI's pre-trained knowledge.

Scenarios Where CLI is Preferable

CLI is better when: the model already knows the CLI commands; running locally; pipeline composition (pipe); token saving is critical; CI/CD and script automation; debugging and quick verification. For CI pipelines using known tools with fixed commands, CLI is clearly more suitable.

Scenarios Where MCP is Preferable

MCP is better when: no terminal access (browser, mobile); multi-user environments requiring authentication and authorization; tools not trained in the model (MCP provides structured JSON Schema); compliance and audit requirements (standardized logs, trace headers); tool discovery via tools/list interface for platforms with growing tool sets.

Author Disagrees with Claim that MCP is Better in Most Cases

The author explicitly states that Thariq's claim that MCP is better than CLI for most integrations is biased. While MCP has improved significantly, CLI still holds advantages in many common scenarios. The choice depends on specific use case requirements such as environment, security, and tool familiarity.

Source posts