Mcp2Cli

v1.0.0Developer Toolsstable

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

aicligraphqlmcpopenapi
Share:
2,146
Stars
0
Downloads
0
Weekly
0/5

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

Convert MCP, OpenAPI, or GraphQL servers to CLI at runtime
knowsuchagency

Maintainer

LicenseMIT
Languagepython
Versionv1.0.0
UpdatedMay 22, 2026
Statushealthy
Maintenanceactive

Works with

ClaudeOpenAIwindowsmacoslinux

Installation

Manual Installation

npx mcp2cli

Configuration

Configuration Details

Config File

claude_desktop_config.json

Performance

Response Metrics

Response Time< 200ms
ThroughputMedium

Resource Usage

Memory UsageLow
CPU UsageLow

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
1

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 mcp2cli
2

List 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 --list
3

Call 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-items
4

Wrap 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 value
5

Create 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 --list
6

Query 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 10

Mcp2Cli 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.

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.

Quick Config Preview

{ "mcpServers": { "mcp2cli": { "command": "npx", "args": ["-y", "mcp2cli"] } } }

Add this to your claude_desktop_config.json or .cursor/mcp.json

Read the full setup guide →

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.

33,000+ ServersFree & Open SourceStep-by-Step Guides