Show HN: Mcp2cli – One CLI for every API, 96-99% fewer tokens than native MCP
This Show HN introduces mcp2cli, a CLI tool that dynamically converts MCP servers and OpenAPI specs into shell commands for LLM agents. It dramatically slashes token consumption by 96-99% by only loading tool schemas on demand, addressing a major pain point for developers integrating LLMs with numerous APIs. The project gains traction for offering a practical, LLM-agnostic solution to context window bloat and escalating token costs.
The Lowdown
mcp2cli tackles the pervasive problem of excessive token usage in LLM applications that interact with external tools and APIs. Traditional methods often inject full tool schemas into the LLM's context on every turn, leading to massive token expenditures, regardless of whether those tools are actually used. This project offers a clever workaround by transforming these API definitions into a dynamic command-line interface, allowing LLMs to discover and interact with tools efficiently without constant schema injection.
- Dynamic Tooling: mcp2cli converts Model Context Protocol (MCP) servers and OpenAPI specifications into a runtime CLI.
- Token Efficiency: It achieves 96-99% token savings by only fetching tool definitions when needed, rather than injecting all schemas upfront.
- LLM Agnostic: The solution works with any LLM, from Claude to local models, as it operates by having the model shell out to a standard CLI.
- No Codegen: The tool avoids static code generation, meaning API changes are immediately reflected without needing to rebuild or recompile.
- Feature Rich: Includes caching with configurable TTL, support for both remote and local specs, and a 'TOON' output format for even greater token efficiency.
By providing a lean, on-demand method for LLMs to access diverse functionalities, mcp2cli presents a compelling strategy for reducing operational costs and improving the scalability of LLM-powered agent systems.
The Gossip
Token Taming and Tooling Triumph
Commenters widely acknowledge and appreciate the project's core value proposition: drastically reducing token usage when LLMs interact with numerous APIs. They highlight that the problem of 'tool sprawl' and expensive context windows is a significant pain point, making mcp2cli's approach to lazy-loading schemas a welcome and necessary innovation for LLM-powered agents. The idea of making tools composable in a familiar CLI environment for advanced agents is also praised.
Prose or Prompt: The Readme Ruckus
A recurring concern among some users is the perceived inauthenticity of the project's documentation. Multiple comments suggest that the GitHub README and introductory text appear to be AI-generated, which leads to skepticism about the project's claims and discourages further engagement, despite the technical merits of the idea itself. This highlights a tension between rapid content generation and the desire for genuine, human-written explanation.
Performance vs. Paring: A Pragmatic Ponder
While celebrated for its token savings, the project also prompts questions regarding potential trade-offs. One commenter specifically asks whether the significant reduction in token cost comes at the expense of tool call performance, indicating a desire for a more comprehensive understanding of the solution's impact beyond just token counts. This suggests a need to balance efficiency with overall operational speed.