Mcp2Cli
Turn any MCP, OpenAPI, or GraphQL server into a CLI — at runtime, with zero codegen
What is Mcp2Cli?
Mcp2Cli is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to turn any mcp, openapi, or graphql server into a cli — at runtime, with zero codegen
Turn any MCP, OpenAPI, or GraphQL server into a CLI — at runtime, with zero codegen
This server falls under the Developer Tools category on MCPgee, the world's largest MCP server directory with 33,000+ servers.
Features
- Turn any MCP, OpenAPI, or GraphQL server into a CLI — at run
Use Cases
Maintainer
Works with
Installation
Manual Installation
npx mcp2cliConfiguration
Configuration Details
claude_desktop_config.json
Performance
Response Metrics
Resource Usage
How to Set Up and Use Mcp2Cli
mcp2cli is a zero-codegen CLI tool that dynamically converts any MCP server, OpenAPI specification, or GraphQL endpoint into an interactive command-line interface at runtime. Instead of writing bespoke client code for each API, you point mcp2cli at an OpenAPI JSON/YAML file, an MCP HTTP/SSE or stdio server, or a GraphQL endpoint and it introspects the schema to generate typed CLI commands on the fly. It is especially useful for AI workflows because it claims 96–99% token savings by compressing verbose tool schemas into compact representations before sending them to an LLM.
Prerequisites
- Python 3.9+ with uv or pip for installation
- Access to the API you want to wrap: an OpenAPI spec URL/file, an MCP server address, or a GraphQL endpoint
- Optional: OAuth credentials or API key if the target API requires authentication
- An MCP-compatible AI client if using mcp2cli as a server bridge
Install mcp2cli via uv (recommended) or pip
The quickest way to use mcp2cli is with uvx for one-off runs, or install it globally as a uv tool for persistent use.
# One-off run without install
uvx mcp2cli --help
# Persistent global install
uv tool install mcp2cliList tools from an OpenAPI spec
Point mcp2cli at a local or remote OpenAPI spec to see all available CLI commands derived from that API's operations.
mcp2cli --spec ./api.json --listCall an API endpoint via the generated CLI
Invoke a specific operation by name, passing parameters as CLI arguments. mcp2cli injects authentication headers as configured.
mcp2cli --spec ./api.json --auth-header "Authorization:Bearer tok_abc" list-itemsWrap an MCP server to browse and call its tools
Connect to a running MCP server over HTTP/SSE and list or invoke its tools from the command line without writing any client code.
mcp2cli --mcp https://mcp.example.com/sse --list
mcp2cli --mcp https://mcp.example.com/sse call-tool --arg valueCreate a baked tool shortcut for frequent use
Save a named shortcut (baked tool) that remembers your spec URL and auth config so you can reuse it with the @ syntax.
mcp2cli bake create myapi --spec https://api.example.com/openapi.json
mcp2cli @myapi --listQuery a GraphQL endpoint
Use mcp2cli against a GraphQL API. It introspects the schema and auto-generates a selection set for queries.
mcp2cli --graphql https://api.example.com/graphql users --limit 10Mcp2Cli Examples
Client configuration
mcp2cli can itself act as an MCP server bridge, wrapping an OpenAPI or GraphQL backend so an AI client like Claude Desktop can call its tools.
{
"mcpServers": {
"mcp2cli": {
"command": "uvx",
"args": ["mcp2cli", "--spec", "https://api.example.com/openapi.json"],
"env": {
"MCP2CLI_CONFIG_DIR": "~/.config/mcp2cli/"
}
}
}
}Prompts to try
When mcp2cli bridges an API to Claude, ask Claude to call API operations by their natural-language descriptions.
- "List all available tools exposed by this OpenAPI spec."
- "Call the list-items endpoint and filter results where status is active."
- "Use the GraphQL users query to fetch the first 10 users and their emails."
- "Create a baked shortcut for the payments API so I can reuse it easily."
- "Show me the schema for the create-order operation including all required fields."Troubleshooting Mcp2Cli
uvx mcp2cli fails with 'No module named mcp2cli'
Ensure you have uv installed (`pip install uv` or `curl -LsSf https://astral.sh/uv/install.sh | sh`). Then retry with `uvx mcp2cli --help`. If you installed globally, activate the uv tool environment with `uv tool run mcp2cli`.
OAuth authentication flow does not complete
mcp2cli uses authorization code + PKCE flow which requires a browser redirect. Make sure your registered OAuth redirect URI matches the local callback server mcp2cli starts (typically http://localhost:PORT/callback). Check `MCP2CLI_CACHE_DIR` for stored tokens.
GraphQL introspection returns no types or fails
Some production GraphQL APIs disable schema introspection for security. If introspection is blocked, provide the schema manually using a local SDL file instead of the endpoint URL.
Frequently Asked Questions about Mcp2Cli
What is Mcp2Cli?
Mcp2Cli is a Model Context Protocol (MCP) server that turn any mcp, openapi, or graphql server into a cli — at runtime, with zero codegen It connects AI assistants to external tools and data sources through a standardized interface.
How do I install Mcp2Cli?
Follow the installation instructions on the Mcp2Cli GitHub repository. Clone the repo, install dependencies, and add the server config to your AI client.
Which AI clients work with Mcp2Cli?
Mcp2Cli works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.
Is Mcp2Cli free to use?
Yes, Mcp2Cli is open source and available under the MIT license. You can use it freely in both personal and commercial projects.
Mcp2Cli Alternatives — Similar Developer Tools Servers
Looking for alternatives to Mcp2Cli? Here are other popular developer tools servers you can use with Claude, Cursor, and VS Code.
Ecc
★ 188.2kThe agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.
Javaguide
★ 155.8kJava 面试 & 后端通用面试指南,覆盖计算机基础、数据库、分布式、高并发、系统设计与 AI 应用开发
Gemini CLI
★ 104.5kA secure MCP server that wraps the Google Gemini CLI, allowing clients to query Gemini models using local OAuth sessions without requiring an API key. It provides tools for model interaction and diagnostics with built-in protection against command in
Awesome MCP Servers
★ 87.3k⭐ Curated list of Model Context Protocol (MCP) servers - tools that extend Claude Desktop, Cursor, Windsurf, and other MCP clients with custom capabilities.
MCP Servers
★ 86.0kModel Context Protocol Servers
CC Switch
★ 77.5kA cross-platform desktop All-in-One assistant for Claude Code, Codex, OpenCode, OpenClaw, Gemini CLI & Hermes Agent. Only official website: ccswitch.io
Browse More Developer Tools MCP Servers
Explore all developer tools servers available in the MCPgee directory. Each server includes setup guides for Claude, Cursor, and VS Code.
Set Up Mcp2Cli in Your Editor
Choose your AI client for step-by-step setup instructions.
Quick Config Preview
Add this to your claude_desktop_config.json or .cursor/mcp.json
Ready to use Mcp2Cli?
Browse our complete directory of 33,000+ MCP servers, read setup guides for your editor, and start building with the Model Context Protocol.