frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

Show HN: Mcp2cli – One CLI for every API, 96-99% fewer tokens than native MCP

https://github.com/knowsuchagency/mcp2cli
69•knowsuchagency•4h ago
Every MCP server injects its full tool schemas into context on every turn — 30 tools costs ~3,600 tokens/turn whether the model uses them or not. Over 25 turns with 120 tools, that's 362,000 tokens just for schemas.

mcp2cli turns any MCP server or OpenAPI spec into a CLI at runtime. The LLM discovers tools on demand:

    mcp2cli --mcp https://mcp.example.com/sse --list             # ~16 tokens/tool
    mcp2cli --mcp https://mcp.example.com/sse create-task --help  # ~120 tokens, once
    mcp2cli --mcp https://mcp.example.com/sse create-task --title "Fix bug"
No codegen, no rebuild when the server changes. Works with any LLM — it's just a CLI the model shells out to. Also handles OpenAPI specs (JSON/YAML, local or remote) with the same interface.

Token savings are real, measured with cl100k_base: 96% for 30 tools over 15 turns, 99% for 120 tools over 25 turns.

It also ships as an installable skill for AI coding agents (Claude Code, Cursor, Codex): `npx skills add knowsuchagency/mcp2cli --skill mcp2cli`

Inspired by Kagan Yilmaz's CLI vs MCP analysis and CLIHub.

https://github.com/knowsuchagency/mcp2cli

Comments

nwyin•2h ago
cool!

anthropic mentions MCPs eating up context and solutions here: https://www.anthropic.com/engineering/code-execution-with-mc...

I built one specifically for Cognition's DeepWiki (https://crates.io/crates/dw2md) -- but it's rather narrow. Something more general like this clearly has more utility.

stephantul•2h ago
Tokens saved should not be your north star metric. You should be able to show that tool call performance is maintained while consuming fewer tokens. I have no idea whether that is the case here.

As an aside: this is a cool idea but the prose in the readme and the above post seem to be fully generated, so who knows whether it is actually true.

hrmtst93837•58m ago
Token counts alone tell you nothing about correctness, latency, or developer ergonomics. Run a deterministic test suite that exercises representative MCP calls against both native MCP and mcp2cli while recording token usage, wall time, error rate, and output fidelity.

Measure fidelity with exact diffs and embedding similarity, and include streaming behavior, schema-change resilience, and rate-limit fallbacks in the cases you care about. Check the repo for a runnable benchmark, archived fixtures captured with vcrpy or WireMock, and a clear test harness that reproduces the claimed 96 to 99 percent savings.

rakag•15m ago
The AI prose is getting so tiring to read

"We measured this. Not estimates — actual token counts using the cl100k_base tokenizer against real schemas, verified by an automated test suite."

philipp-gayret•2h ago
Someone had to do it. mcp in bash would make them composable, which I think is the strongest benefit for high capability agents like Claude, Cursor and the like, who can write Bash better than I. Haven't gotten into MCP since early release because of the issues you named. Nice work!
liminal-dev•2h ago
This post and the project README are obviously generated slop, which personally makes me completely skip the project altogether, even if it works.

If you want humans to spend time reading your prose, then spend time actually writing it.

silverwind•2h ago
How would the LLM exactly discover such unknown CLI commands?
Mashimo•2h ago
Skills or tell it the --list command would be my guess.
DieErde•2h ago
Why is the concept of "MCP" needed at all? Wouldn't a single tool - web access - be enough? Then you can prompt:

    Tell me the hottest day in Paris in the
    coming 7 days. You can find useful tools
    at www.weatherforadventurers.com/tools
And then the tools url can simply return a list of urls in plain text like

    /tool/forecast?city=berlin&day=2026-03-09 (Returns highest temp and rain probability for the given day in the given city)
Which return the data in plain text.

What additional benefits does MCP bring to the table?

iddan•2h ago
The prophecy of the hypermedia web
Traubenfuchs•1h ago
I feel like I haven’t read anything about this in combination with mcp and like I am taking crazy pills: does no one remember hateoas?
ewidar•2h ago
One thing that I currently find useful on MCPs is granular access control.

Not all services provide good token definition or access control, and often have API Key + CLI combo which can be quite dangerous in some cases.

With an MCP even these bad interfaces can be fixed up on my side.

Phlogistique•1h ago
The point is authorization. With full web access, your agent can reach anything and leak anything.

You could restrict where it can go with domain allowlists but that has insufficient granularity. The same URL can serve a legitimate request or exfiltrate data depending on what's in the headers or payload: see https://embracethered.com/blog/posts/2025/claude-abusing-net...

So you need to restrict not only where the agent can reach, but what operations it can perform, with the host controlling credentials and parameters. That brings us to an MCP-like solution.

rvz•1h ago
But this is no different to using an API key with access controls and curl and you get the same thing.

MCP is just as worse version of the above allowing lots of data exfiltration and manipulation by the LLM.

acchow•11m ago
But MCP uses Oauth. That is not a "worse version" of API keys. It is better.

The classic "API key" flow requires you to go to the resource site, generate a key, copy it, then paste it where you want it to go.

Oauth automates this. It's like "give me an API key" on demand.

regularfry•11m ago
An MCP server lets you avoid giving the agent your API key so it can't leak it. At least in theory.

You could do the same with a CLI tool but it's more of a hassle to set up.

jbverschoor•1h ago
Proxying / gatekeeping
SyneRyder•1h ago
A few things: in this case, you have to provide the tool list in your prompt for the AI to know it exists. But you probably want the AI agent to be able to act and choose tools without you micromanaging and reminding it in every prompt, so then you'd need a tool list... and then you're back to providing the tool list automatically ala MCP again.

MCP can provide validation & verification of the request before making the API call. Giving the model a /tool/forecast URL doesn't prevent the model from deciding to instead explore what other tools might be available on the remote server instead, like deciding to try running /tool/imagegenerator or /tool/globalthermonuclearwar. MCP can gatekeep what the AI does, check that parameters are valid, etc.

Also, MCP can be used to do local computation, work with local files etc, things that web access wouldn't give you. CLI will work for some of those use cases too, but there is a maximum command line length limit, so you might struggle to write more than 8kB to a file when using the command line, for example. It can be easier to get MCP to work with binary files as well.

I tend to think of local MCP servers like DLLs, except the function calls are over stdio and use tons of wasteful JSON instead of being a direct C-function call. But thinking of where you might use a DLL and where you might call out to a CLI can be a useful way of thinking about the difference.

Ozzie_osman•2h ago
I kind of feel like it might be better to go from CLI to MCP.
rvz•2h ago
MCP itself is a flawed standard to being with as I said before [0] and its wraps around an API from the start.

You might as well directly create a CLI tool that works with the AI agents which does an API call to the service anyway.

[0] https://news.ycombinator.com/item?id=44479406

tuananh•2h ago
mcp just need to add dynamic tools discovery and lazy load them, that would solve this token problem right?
Doublon•2h ago
We had `curl`, HTTP and OpenAPI specs, but we created MCP. Now we're wrapping MCP into CLIs...
Charon77•33m ago
MCP only exists because there's no easy way for AI to run commands on servers.

Oh wait there's ssh. I guess it's because there's no way to tell AI agents what the tool does, or when to invoke it... Except that AI pretty much knows the syntax of all of the standard tools, even sed, jq, etc...

Yeah, ssh should've been the norm, but someone is getting promoted for inventing MCP

re-thc•5m ago
> but we created MCP. Now we're wrapping MCP into CLIs...

Next we'll wrap the CLIs into MCPs.

jkisiel•1h ago
How is it different from 'mcporter', already included in eg. openclaw?
benvan•1h ago
Nice project! I've been working on something very similar here https://github.com/max-hq/max

It works by schematising the upstream and making data locally synchronised + a common query language, so the longer term goals are more about avoiding API limits / escaping the confines of the MCP query feature set - i.e. token savings on reading data itself (in many cases, savings can be upwards of thousands of times fewer tokens)

Looking forward to trying this out!

jofzar•1h ago
How is this the 5th one of these I have seen this week, is everyone just trying to make the same thing?
hnlmorg•1h ago
Basically yes.
ejoubaud•1h ago
How does this differ from mcporter? https://github.com/steipete/mcporter/
tern•1h ago
There are a handful of these. I've been using this one: https://github.com/smart-mcp-proxy/mcpproxy-go
jancurn•1h ago
Cool, adding this to my list of MCP CLIs:

  - https://github.com/apify/mcpc
  - https://github.com/chrishayuk/mcp-cli
  - https://github.com/wong2/mcp-cli
  - https://github.com/f/mcptools
  - https://github.com/adhikasp/mcp-client-cli
  - https://github.com/thellimist/clihub
  - https://github.com/EstebanForge/mcp-cli-ent
  - https://github.com/knowsuchagency/mcp2cli
  - https://github.com/philschmid/mcp-cli
  - https://github.com/steipete/mcporter
  - https://github.com/mattzcarey/cloudflare-mcp
  - https://github.com/assimelha/cmcp
oulu2006•28m ago
Precisely, there are about 100 of these, and everyone makes a new one every week.
Intermernet•1h ago
I may be showing my ignorance here, but wouldn't the ideal situation be for the service to use the same number of tokens no matter what client sent the query?

If the service is using more tokens to produce the same output from the same query, but over a different protocol, than the service is a scam.

mvc•52m ago
When you're using an agent, the "query" isn't just each bit of text you enter into the agent prompt. It's the whole conversation.

But I do wonder about these tools whether they have tested that the quality of subsequent responses is the same.

Intermernet•47m ago
That doesn't explain why the protocol matters. Surely for equivalent responses, you need to send equivalent payloads. You shouldn't be able to hack this from the client side.
acchow•9m ago
> Every MCP server injects its full tool schemas into context on every turn

I consider this a bug. I'm sure the chat clients will fix this soon enough.

Something like: on each turn, a subagent searches available MCP tools for anything relevant. Usually, nothing helpful will be found and the regular chat continues without any MCP context added.

Programmers will document for Claude, but not for each other

https://blog.plover.com/2026/03/09/
1•frizlab•33s ago•0 comments

Emit Emails – Personalized email sending without the fluff

1•AlphaTheGoat•1m ago•0 comments

AI Crash the Physics of the Collapse [video]

https://www.youtube.com/watch?v=PZ0sS41zwo4
1•CrzyLngPwd•2m ago•1 comments

3AM Coding:cracking persistent open-source memory for agents

https://github.com/aayoawoyemi/Ori-Mnemos
1•starro____•3m ago•0 comments

Crow Watch: A Hacker News Alternative

https://crow.watch
1•medv•6m ago•0 comments

Analysis of Ninth Circuit Allows TOS Amendment by Email–Ireland-Gordy vs. Tile

https://blog.ericgoldman.org/archives/2026/03/ninth-circuit-allows-tos-amendment-by-email-ireland...
1•hazzamanic•7m ago•0 comments

Terence Tao: Formalizing a proof in Lean using Claude Code [video]

https://www.youtube.com/watch?v=JHEO7cplfk8
1•helloplanets•8m ago•0 comments

Apple: The first 50 years, CBS Sunday Morning [video]

https://www.youtube.com/watch?v=7bA2w7uwUbs
1•oldnetguy•12m ago•0 comments

NSF National Deep Inference Fabric

https://ndif.us/
1•pramodbiligiri•14m ago•0 comments

CorridorKey – Perfect Green Screen Keys

https://github.com/nikopueringer/CorridorKey
1•h4kor•17m ago•0 comments

Shockwave Player Reimplemented in Rust and WASM

https://github.com/igorlira/dirplayer-rs
2•njaremko•19m ago•0 comments

How to win slots and influence people

https://www.bloomberg.com/features/2026-stake-drake-crypto-casino-adin-ross-gambling/
3•simonebrunozzi•22m ago•0 comments

Ask HN: Where do all the laid off devs hang out?

2•fud101•24m ago•0 comments

Set-OutlookSignatures v4.26.0 support for M365 sovereign clouds

https://set-outlooksignatures.com/
1•explicitcons•26m ago•1 comments

Show HN: TrustScan – Simplify privacy policies and audit GDPR compliance

https://trustscan.dev
1•hafizjavid•27m ago•1 comments

Every business will have AGI by 2027

https://nuggetz.ai/articles/every-business-will-have-agi-by-2027
4•ezisezisezis•30m ago•0 comments

Show HN: Marketing Content Generator AI-powered multi-channel content platform

https://devpost.com/software/marketing-content-generator-ch4p2q
3•gaborishka•30m ago•0 comments

Show HN: I built a mini PowerBI for tech comps with no dev experience with Codex

https://gotham-web.onrender.com/
1•muhneesh•33m ago•0 comments

Fontcrafter: Turn Your Handwriting into a Real Font

https://arcade.pirillo.com/fontcrafter.html
1•rendx•34m ago•0 comments

Show HN: cursor-tg – Run Cursor Cloud Agents from Telegram

https://github.com/tb5z035i/cursor-tg
1•tb5z035i•36m ago•0 comments

MoltBrowser MCP

https://github.com/Joakim-Sael/moltbrowser-mcp
2•geobotPY•37m ago•1 comments

Show HN: FretBench – I tested 14 LLMs on reading guitar tabs. Most failed

https://fretbench.tymo.ai/blog/i-asked-14-ai-models-to-read-guitar-tabs/
1•jmcapra•38m ago•0 comments

Show HN: NirvaCrop – Offline Python tool for batch video cropping

https://nirvasoft.gumroad.com/l/ffdoc
1•Ashwiniakash•39m ago•1 comments

A sneak preview behind an embedded software factory. I suspect "rad" is back

https://ghuntley.com/rad/
1•ghuntley•46m ago•0 comments

Sumi – Open-source voice-to-text with local AI polishing

2•alkd•46m ago•0 comments

Show HN: U-Claw – An Offline Installer USB for OpenClaw in China

https://www.u-claw.org/
2•17vibe•48m ago•0 comments

Replaced by a Goldfish

https://clawd.it/posts/10-replaced-by-a-goldfish/
4•patrikgro•51m ago•0 comments

Why AI Agents Need Email Guardrails

https://molted.email/blog/why-ai-agents-need-email-guardrails
2•spacesh1psoda•51m ago•0 comments

SQLite: Query Result Formatting in the CLI

https://www.sqlite.org/climode.html
1•thunderbong•53m ago•0 comments

Seedance2.0 and OmniVideo: AI video creation from text and images – experiences?

1•hongxiao•54m ago•0 comments