mcp2cli CLI
A CLI that turns any MCP server, OpenAPI spec or GraphQL endpoint into commands at runtime, with no codegen
- 2,440 ★ on the repository
- Last commit
- MIT
Broad access
Why this level
- Can call write operations on external APIs, including POST requests and GraphQL mutations
- Via --mcp-stdio it spawns arbitrary server commands and stores OAuth tokens and secrets in a cache
Install
- Works in
In your terminal, with SkillFoxx CLI
npx skillfoxx add cli/mcp2cliDetects the agents on your machine, shows the access level and pins the version.
Other ways to install
Access and checks
How we reviewBroad accessThe tool can change data, run commands or handle secrets.
- Can call write operations on external APIs, including POST requests and GraphQL mutations
- Via --mcp-stdio it spawns arbitrary server commands and stores OAuth tokens and secrets in a cache
This is third-party code. Review the repository files before installing.
What it does
mcp2cli connects to a source, whether an MCP server over HTTP, SSE or stdio, an OpenAPI spec or a GraphQL endpoint, and builds commands from it at runtime. The --list flag shows available operations, --search finds them by name and description, and calling a command with flags runs the operation. It supports OAuth with authorization-code and client-credentials flows, passing secrets via env and file prefixes, caching, saving ready connections with bake, and output as JSON or the compact TOON format. Context saving matters for agents: the tool ranks the list by call frequency and can return command names only, which cuts token spend on schemas. It ships a skill that teaches Claude Code, Cursor and Codex to use mcp2cli and even to build new skills from APIs.
Who it is for. For developers and engineers who want to call MCP servers and APIs from the terminal and hand those commands to an agent without wasting context.
Good fit when
- You need to quickly call an MCP tool or an API endpoint from the command line
- You need to cut the agent's token spend on tool schemas
- You need to build a skill or wrapper around a third-party API without writing code
Not a fit when
- You need a long-running service with its own logic rather than one-off calls
- The target API has no OpenAPI spec, GraphQL introspection or MCP interface
Example request
List this MCP server's tools with mcp2cli and call search for the word taskLimitations
It needs Python 3.10 or newer and installs via uv or pip. Its capabilities depend on the server or API you connect to: mcp2cli hosts nothing itself. Whether a given remote API is reachable from Russia depends on that service. OAuth tokens and cache live in ~/.cache/mcp2cli, so treat that folder as sensitive.
How to disable. Remove the tool: uv tool uninstall mcp2cli or pip uninstall mcp2cli. The skill is removed from your agent's skills directory.
FAQ
Do I need to generate code for each API?
No. mcp2cli reads the spec or introspects the endpoint at runtime and builds commands on the fly, with no codegen.
How does it save the agent tokens?
It ranks the command list by call frequency and can return names only or the compact TOON format, so the agent does not pull full schemas of every tool into context on each step.
Discussion
No questions or reviews yet.
Related
CLI toolsA universal MCP CLI client from Apify: persistent sessions, OAuth, JSON output for scripts and shell access to any MCP server for agents
A zero-dependency Python CLI: one catalog of MCP servers and skills for every agent, with only a compact index in context
The mcpl CLI searches tools across several MCP servers and calls them from the terminal, with OAuth sign-in done by a human
A CLI for any MCP server: list and call tools, resources and prompts, run mock and proxy modes, guard access and manage agent configs
An Open WebUI proxy that exposes any MCP server as an HTTP API with an OpenAPI schema
A Python framework and CLI for MCP: write servers as plain functions, test tools and install servers into Claude Code, Cursor and other clients
Comparison with similar tools
Cards that share the main search query, and how they differ.
| Tool | Official | Repository stars | Main difference |
|---|---|---|---|
| mcp2cli (this card) | no | 2,440 | |
| clihub | no | 668 | clihub turns any MCP server into a ready CLI |
| skill-creator: skills from OpenAPI, GraphQL and MCP | no | 611 | the /skill-creator command turns a link to an OpenAPI spec |
README in short
The README presents mcp2cli as one CLI for MCP servers, OpenAPI specs and GraphQL endpoints that works at runtime with no codegen. It shows install via uvx and uv tool install, HTTP, SSE and stdio modes for MCP, OpenAPI and GraphQL usage, OAuth flows, passing secrets via env and file, caching and saving connections with bake. It covers token saving through ranking and compact output, JSON and TOON modes, and compatibility with both major MCP SDK versions at once. A skill for Claude Code, Cursor and Codex is included. MIT licensed.