$ man how-to/cli-vs-mcp-tools
Comparisonsintermediate
CLI Tools vs MCP Integrations
When to use CLI access vs MCP and why the answer matters for context windows
The Core Tradeoff
MCPs give AI agents direct access to external services. The agent calls a tool, the MCP server handles the API request, and the result comes back into context. Seamless. But every MCP server loads its tool definitions into the context window. A HubSpot MCP with 30 tools burns tokens just by existing.
CLI tools sit on your machine. Zero context cost until you use them. When you need to query HubSpot, Claude Code runs the hs CLI command and reads the output. The tool definitions are not in context - the agent constructs the command from its training knowledge.
The tradeoff: MCPs are more integrated but expensive on context. CLIs are leaner but require the agent to know the CLI syntax. For simple operations, CLIs win. For complex multi-step workflows where the agent needs to discover available tools, MCPs win.
FORMULA
Context Window Cost Comparison
A rough comparison:
MCP server with 10 tools: ~2,000-4,000 tokens loaded into every session. That is context you pay for whether you use those tools or not.
MCP server with 30 tools: ~8,000-12,000 tokens. A meaningful chunk of your context window spent on tool definitions.
5 MCP servers simultaneously: 20,000-50,000 tokens. That is 10-25% of a 200k context window consumed before you ask a single question.
CLI equivalent: 0 tokens until invoked. When Claude Code runs a CLI command, the command and its output enter context. A typical CLI interaction costs 200-500 tokens. You pay per use, not per load.
The math is clear for tools you use occasionally. If you query HubSpot once per session, the CLI saves 3,500 tokens over the MCP. If you query HubSpot 20 times per session, the MCP amortizes its cost and the integration advantage wins.
PATTERN
Which Tools Have What
CLI only: Vercel, Salesforce (sf), Homebrew, Git, most Unix tools.
MCP only: Slack, Attio (currently), PostHog, Browserbase, Substack.
Both CLI and MCP: HubSpot, GitHub (gh CLI + GitHub MCP), potentially Attio (CLI in development).
The trend: tools are shipping both. The CLI for power users and automation scripts. The MCP for AI agent integration. The tools that ship both give you the flexibility to choose based on your use case.
For GTM stacks: the enrichment layer (Apollo, Clearbit, ZoomInfo) mostly uses API keys directly. The CRM layer (HubSpot, Salesforce, Attio) is moving to both CLI and MCP. The outreach layer (Instantly, Lemlist, HeyReach) is mostly MCP or API only.
PRO TIP
The Convergence
The distinction between CLI and MCP is dissolving. Claude Code wraps both. When you say "check my Vercel deployments," it uses the CLI. When you say "search my Slack channels," it uses the MCP. You do not care which mechanism it uses. You care about the result.
The future is probably a unified tool layer where Claude Code picks the best access method for each request. CLI for simple queries. MCP for complex interactions. Direct API calls for everything else. The agent handles the routing.
For now, the practical advice: install CLIs for tools you use heavily (saves context). Set up MCPs for tools where you need the agent to discover capabilities (complex tools with many operations). Use both when available and let Claude Code pick the right one per request.
knowledge guide
related guides