mcp2cli
Turn any MCP, OpenAPI, or GraphQL server into a CLI — at runtime, with zero codegen
What is mcp2cli?
Turn any MCP, OpenAPI, or GraphQL server into a CLI — at runtime, with zero codegen
Overview of mcp2cli
What it is
mcp2cli is a command-line tool that converts MCP servers, OpenAPI specifications, or GraphQL endpoints into a CLI interface at runtime without code generation. It is written in Python and distributed under the MIT license. The project is hosted on GitHub at knowsuchagency/mcp2cli and published on PyPI.
Key features
- Supports MCP over HTTP/SSE, MCP over stdio, OpenAPI specs, and GraphQL endpoints as input sources.
- Includes an installable skill for AI coding agents (Claude Code, Cursor, Codex) that enables agent-driven API discovery and tool calling.
- Provides OAuth authentication with automatic token acquisition, caching, and refresh, supporting authorization code + PKCE and client credentials flows.
- Allows secrets to be read from environment variables or files using
env:andfile:prefixes to avoid exposing them in process listings. - Offers persistent sessions that keep one MCP connection alive across multiple commands, using Unix domain sockets on macOS/Linux and loopback TCP on Windows.
- Supports tool search by name or description, raw schema output for MCP tools, filesystem roots, and prompt/resource-template completions.
Use cases
mcp2cli is suitable for developers and AI agents who need to interact with MCP servers, REST APIs described by OpenAPI, or GraphQL endpoints from the command line. It can be used for testing API endpoints, building CLI wrappers around existing services, and enabling AI coding agents to discover and call tools dynamically without pre-generated code.
Getting started
bash# Run directly without installinguvx mcp2cli --help# Or install globallyuv tool install mcp2cliTo install the AI agent skill:bashnpx skills add knowsuchagency/mcp2cli --skill mcp2cli
License and pricing
mcp2cli is open source under the MIT license. No pricing information is stated; the project is listed as open source.
Based on the project's public README and repository metadata.