m

mcp2cli

by knowsuchagency (independent open-source project)

Developer ToolsAI Agents & OrchestrationAutomation & Workflows

Turn any MCP server, OpenAPI spec or GraphQL endpoint into a CLI at runtime, with zero codegen

Free·Added March 12, 2026·Updated August 1, 2026
Share:
THE DAILY BRIEF
mcp2cli

by knowsuchagency (independent open-source project)

Developer ToolsAI Agents & OrchestrationAutomation & Workflows

Turn any MCP server, OpenAPI spec or GraphQL endpoint into a CLI at runtime, with zero codegen

Free

mcp2cli is an open-source Python command-line tool that introspects an MCP server, OpenAPI specification or GraphQL endpoint at runtime and renders its operations as a typed CLI. It exists to remove the MCP tax — the cost of injecting every tool schema into an agent's context on every turn — by letting the model discover tools on demand instead.

At a Glance

Category
Developer Tools
Pricing
Free
Target Market
Enterprise Developers, Platform Engineers, AI Engineers, DevOps Engineers, CTOs
Deployment
Open-source, Self-hosted
Founded
2026

Key Features

  • Runtime introspection with zero codegen
  • Multi-protocol coverage
  • Baked named configurations
  • OAuth and API-key authentication
  • TOON output encoding
  • Usage-aware tool ranking
  • Spec and tool-list caching
  • Installable agent skill

Capabilities

text generation
image generation
video generation
code generation
workflow automation
api access
audio generation
fine tuning
agent orchestration

Use Cases

  • Cutting the MCP tax on multi-server agents
  • Calling MCP tools from shell scripts and CI
  • Exposing internal REST services to agents
  • Restricting the surface an agent can reach
  • Benchmarking agent token economics

Ideal For

Best For

  • Agent deployments wired to 20 or more MCP tools where schema injection dominates context usage
  • Long-running agent sessions of 10-plus turns in which most connected tools are never actually invoked
  • Scripting and CI pipelines that need MCP tools callable from bash with parseable JSON on stdout
  • Teams exposing internal OpenAPI or GraphQL services to coding agents without writing an MCP server first
  • Cost control on agent workloads where per-turn context is the dominant line item rather than output tokens

Not Ideal For

  • Small setups with only a handful of tools or short conversations — independent write-ups put the crossover at roughly 20-plus tools and 10-plus turns, below which the extra discovery round-trips add latency without saving meaningful context
  • Regulated environments needing per-user authentication and audit trails, since the CLI pattern generally relies on shared credentials with no per-user OAuth or individual access revocation
  • Teams that cannot run a Python 3.10+ toolchain alongside their agent, as installation goes through uv or PyPI rather than a hosted service
  • Anyone wanting a supported commercial product with an SLA — this is a solo-maintained open-source project with 10 open issues and no vendor behind it

Market Analysis

Open-sourceDeveloper-firstCost-optimisationAgent infrastructure

Pros

  • Attacks a genuinely measured problem — third-party benchmarking found MCP consuming 4x to 32x more tokens than CLI for identical GitHub tasks, and 145,000 versus 4,150 tokens on a Microsoft Graph enterprise test
  • Real traction for a solo project: 2,332 GitHub stars, 170 forks, and a Show HN that drew 146 points and 100 comments
  • Active maintenance — 54 releases since the repository was created in March 2026, with version 3.3.1 on 30 June 2026 and only 10 open issues
  • Broad protocol coverage in one tool: MCP over stdio and HTTP/SSE, OpenAPI 3 and GraphQL, with OAuth and API-key auth built in
  • MIT licence and pure self-hosting, so there is no vendor lock-in, no hosted dependency and no data leaving your environment

Cons

  • The core objection on Hacker News is that discovery may only move the problem rather than solve it — as one commenter put it, if there is an mcp2cli --help that dumps tool calls, the context flooding has just relocated
  • Token savings are the headline metric but tool-call accuracy is not reported alongside them; commenters argued tokens saved should not be the north star without evidence that tool-call performance holds
  • The category is crowded and differentiation is contested — mcporter, mcp-use and CLI-use were all raised in the same thread, with one commenter saying there are about 100 of these and a new one appears every week
  • Extra discovery round-trips add latency, and independent analysis puts the break-even at roughly 20-plus tools across 10-plus turns, so smaller setups pay the cost without the benefit
  • The CLI pattern generally uses shared credentials, which independent analysis flags as an enterprise governance gap: no per-user OAuth, no individual access revocation, and auditing that cannot attribute actions to a person
  • Reviewers criticised the documentation as machine-generated filler, which undermines trust in the benchmark claims even where the code is sound
  • Name collision is a real risk: at least two other unrelated projects also ship as mcp2cli — a TypeScript CLI bridge at rodaddy/mcp2cli and an Apache-2.0 project at mcp2cli.dev — so installation instructions found by search may not point at this project

Pricing

Open source (MIT)

$0

  • Full functionality, no paid tier or hosted service
  • Install via uvx mcp2cli or uv tool install mcp2cli
  • Requires Python 3.10 or newer
  • Version 3.3.1 released 30 June 2026

Entirely free and MIT-licensed with no paid tier, hosted edition, seat charge or enterprise SKU — the project publishes no commercial offering at all. The real cost is indirect: you run it yourself on a Python 3.10+ toolchain, you own the operational burden of a solo-maintained dependency, and its value is measured in avoided model spend rather than a licence saved. Third-party benchmarking of the underlying CLI-versus-MCP pattern put 10,000 GitHub operations a month at roughly $3.20 via CLI against $55.20 via MCP, and the project's own scaling estimate reaches around $21,000 a month for a team running 1,000 conversations daily against 100 tools — treat both as directional and re-measure on your own workload.

Security & Compliance

soc2
gdpr
hipaa
iso27001
sso
data residency

THE DAILY BRIEF

Enterprise AI insights for technology and business leaders, twice weekly.

beri.net

Subscribe at beri.net/subscribe for twice-weekly AI insights delivered to your inbox.

LinkedIn: linkedin.com/in/rberi  |  X: x.com/rajeshberi

© 2026 Rajesh Beri. All rights reserved.

mcp2cli is an open-source Python command-line tool that introspects an MCP server, OpenAPI specification or GraphQL endpoint at runtime and renders its operations as a typed CLI. It exists to remove the MCP tax — the cost of injecting every tool schema into an agent's context on every turn — by letting the model discover tools on demand instead.

mcp2cli is an MIT-licensed Python utility that converts Model Context Protocol servers, OpenAPI 3 specifications and GraphQL endpoints into command-line interfaces at runtime, without generating any code. It introspects the target, then renders the discovered operations as a typed CLI in which required schema fields become required flags, JSON Schema drives argument parsing and dotted tool names become subcommands. The problem it targets is structural rather than cosmetic: connecting an MCP server to an agent injects every tool schema into the context window on every turn, which independent analysis puts at roughly 28,000 tokens per turn for GitHub's 43 tools alone. mcp2cli replaces that with on-demand discovery, where the model calls list and help only when it needs them. Its published benchmarks claim 96% savings at 30 tools over 15 turns, cutting 54,525 tokens to 2,309, and 99% at 120 tools over 25 turns, cutting 362,350 tokens to 5,181 — vendor-measured numbers that align directionally with third-party work showing 4x to 35x token gaps between MCP and CLI access to the same APIs. Practically it supports stdio and HTTP/SSE MCP transports, local and remote specs, OAuth authorization-code-with-PKCE and client-credentials flows with cached refresh tokens, API-key auth via environment or file references, one-hour spec caching, usage-aware tool ranking learned from invocation history, and JSON or token-efficient TOON output. A bake command persists named configurations to disk, and the project ships an installable agent skill for Claude Code, Cursor and Codex. Version 3.3.1 shipped on 30 June 2026, the 54th release since the repository was created in March 2026, and it requires Python 3.10 or newer.

Ideal Buyer

Platform engineers running coding agents against many MCP servers, whose context window and token bill are being consumed by tool schemas the agent mostly never calls.

Key Benefit

Replaces always-loaded tool schemas with on-demand CLI discovery, with published benchmarks showing 54,525 tokens cut to 2,309 at 30 tools over 15 turns.

At a Glance

Category
Developer Tools
Pricing
Free
Target Market
Enterprise Developers, Platform Engineers, AI Engineers, DevOps Engineers, CTOs
Deployment
Open-source, Self-hosted
Founded
2026

Key Features

  • Runtime introspection with zero codegen

    Discovers tools, resources and prompts when invoked rather than generating static bindings, so a server-side schema change needs no rebuild.

  • Multi-protocol coverage

    Handles MCP over stdio and HTTP/SSE, OpenAPI 3 JSON or YAML specs local or remote, and GraphQL endpoints with auto-generated selection sets.

  • Baked named configurations

    Persists connection settings to ~/.config/mcp2cli/baked.json with include and exclude glob filters and HTTP method restrictions for OpenAPI targets.

  • OAuth and API-key authentication

    Supports authorization code with PKCE and client credentials flows, with automatic token refresh and caching, plus env: and file: prefixed key references.

  • TOON output encoding

    Offers a token-efficient alternative to JSON that the project claims uses 40-60% fewer tokens, on top of the discovery savings.

  • Usage-aware tool ranking

    Learns from invocation history so the tools an agent actually uses surface first in listings, reducing the cost of discovery itself.

  • Spec and tool-list caching

    Caches remote specs and MCP tool lists for one hour by default under a configurable directory, cutting repeated connection overhead.

  • Installable agent skill

    Ships as a skill for Claude Code, Cursor and Codex so an agent can adopt the CLI workflow without bespoke prompt engineering.

Capabilities

text generation
image generation
video generation
code generation
workflow automation
api access
audio generation
fine tuning
agent orchestration

Use Cases

  • Cutting the MCP tax on multi-server agents

    Replace always-loaded schemas for dozens of MCP tools with on-demand help lookups, freeing context for actual task reasoning.

  • Calling MCP tools from shell scripts and CI

    Invoke tools as ordinary commands with parseable JSON on stdout, so existing pipelines can pipe and compose results normally.

  • Exposing internal REST services to agents

    Point mcp2cli at an existing OpenAPI spec to give an agent typed access without building and hosting a dedicated MCP server.

  • Restricting the surface an agent can reach

    Bake a filtered configuration with include and exclude globs and HTTP method limits so an agent only sees approved operations.

  • Benchmarking agent token economics

    Compare native MCP schema injection against CLI discovery on a real workload to decide whether the round-trip trade-off pays off.

Ideal For

Best For

  • Agent deployments wired to 20 or more MCP tools where schema injection dominates context usage
  • Long-running agent sessions of 10-plus turns in which most connected tools are never actually invoked
  • Scripting and CI pipelines that need MCP tools callable from bash with parseable JSON on stdout
  • Teams exposing internal OpenAPI or GraphQL services to coding agents without writing an MCP server first
  • Cost control on agent workloads where per-turn context is the dominant line item rather than output tokens

Not Ideal For

  • Small setups with only a handful of tools or short conversations — independent write-ups put the crossover at roughly 20-plus tools and 10-plus turns, below which the extra discovery round-trips add latency without saving meaningful context
  • Regulated environments needing per-user authentication and audit trails, since the CLI pattern generally relies on shared credentials with no per-user OAuth or individual access revocation
  • Teams that cannot run a Python 3.10+ toolchain alongside their agent, as installation goes through uv or PyPI rather than a hosted service
  • Anyone wanting a supported commercial product with an SLA — this is a solo-maintained open-source project with 10 open issues and no vendor behind it

Integrations

SDK Available
SDK:Python

Deployment

On-Premise

Market Analysis

Open-sourceDeveloper-firstCost-optimisationAgent infrastructure

Pros

  • Attacks a genuinely measured problem — third-party benchmarking found MCP consuming 4x to 32x more tokens than CLI for identical GitHub tasks, and 145,000 versus 4,150 tokens on a Microsoft Graph enterprise test
  • Real traction for a solo project: 2,332 GitHub stars, 170 forks, and a Show HN that drew 146 points and 100 comments
  • Active maintenance — 54 releases since the repository was created in March 2026, with version 3.3.1 on 30 June 2026 and only 10 open issues
  • Broad protocol coverage in one tool: MCP over stdio and HTTP/SSE, OpenAPI 3 and GraphQL, with OAuth and API-key auth built in
  • MIT licence and pure self-hosting, so there is no vendor lock-in, no hosted dependency and no data leaving your environment

Cons

  • The core objection on Hacker News is that discovery may only move the problem rather than solve it — as one commenter put it, if there is an mcp2cli --help that dumps tool calls, the context flooding has just relocated
  • Token savings are the headline metric but tool-call accuracy is not reported alongside them; commenters argued tokens saved should not be the north star without evidence that tool-call performance holds
  • The category is crowded and differentiation is contested — mcporter, mcp-use and CLI-use were all raised in the same thread, with one commenter saying there are about 100 of these and a new one appears every week
  • Extra discovery round-trips add latency, and independent analysis puts the break-even at roughly 20-plus tools across 10-plus turns, so smaller setups pay the cost without the benefit
  • The CLI pattern generally uses shared credentials, which independent analysis flags as an enterprise governance gap: no per-user OAuth, no individual access revocation, and auditing that cannot attribute actions to a person
  • Reviewers criticised the documentation as machine-generated filler, which undermines trust in the benchmark claims even where the code is sound
  • Name collision is a real risk: at least two other unrelated projects also ship as mcp2cli — a TypeScript CLI bridge at rodaddy/mcp2cli and an Apache-2.0 project at mcp2cli.dev — so installation instructions found by search may not point at this project

Pricing

Open source (MIT)

$0

  • Full functionality, no paid tier or hosted service
  • Install via uvx mcp2cli or uv tool install mcp2cli
  • Requires Python 3.10 or newer
  • Version 3.3.1 released 30 June 2026

Entirely free and MIT-licensed with no paid tier, hosted edition, seat charge or enterprise SKU — the project publishes no commercial offering at all. The real cost is indirect: you run it yourself on a Python 3.10+ toolchain, you own the operational burden of a solo-maintained dependency, and its value is measured in avoided model spend rather than a licence saved. Third-party benchmarking of the underlying CLI-versus-MCP pattern put 10,000 GitHub operations a month at roughly $3.20 via CLI against $55.20 via MCP, and the project's own scaling estimate reaches around $21,000 a month for a team running 1,000 conversations daily against 100 tools — treat both as directional and re-measure on your own workload.

Security & Compliance

soc2
gdpr
hipaa
iso27001
sso
data residency

Connect

Sources

This page was written from 5 sources, 4 on domains other than github.com.

  1. 1.github.commcp2clivendor
  2. 2.pypi.orgmcp2cli
  3. 3.news.ycombinator.comitem
  4. 4.firecrawl.devmcp vs cli
  5. 5.jangwook.netmcp2cli token cost optimization
Newsletter

Stay Ahead of the Curve

Weekly enterprise AI insights for technology leaders. No spam, no vendor pitches—unsubscribe anytime.

Subscribe