The Hallway Track
Engineering Insights

CLI vs MCP: Which Should You Use for Building AI Agents? #LearnOnShorts

LangChain · Jun 27, 2026 · Engineering Insights

Use MCP servers for known, enterprise-auth, human-in-the-loop tools; use CLIs for model-familiar, light-surface tasks to save tokens.

“the MCP server for GitHub is about 45,000 tokens because it's giving every single API name, description, and schema to the model. But with the CLI, running the help command where it can see all of the tools, there's only about 1,500 tokens”

LangChain explains when to use MCP servers versus CLIs for building AI agents, framing MCP as better for known servers needing enterprise auth and human-in-the-loop permissioning, and CLIs as better when the model already knows the tool or the API surface is light. The key tradeoff is token cost: GitHub's MCP server consumes ~45,000 tokens versus ~1,500 for the CLI help command, trading broader access for far higher context usage. It is a useful practical engineering tip but a minor industry signal rather than a major announcement.

ai-agents mcp cli context-window langchain

Watch / read the original source →