mcp2cli
mcp2cli is a Python CLI tool that dynamically converts MCP servers, OpenAPI specifications, and GraphQL endpoints into command-line interfaces at runtime without code generation. It supports multiple authentication methods (OAuth, API keys, bearer tokens) and allows saving connection profiles for reuse.
Key facts
Objective fields from the source. Values we can't verify are shown as “Unknown” rather than guessed.
| Field | Value |
|---|---|
| Repository | knowsuchagency/mcp2cli |
| Owner | knowsuchagency |
| Primary language | Python |
| License | MIT — OSI-approved |
| Stars | 2.3k |
| Forks | 163 |
| Open issues | 1 |
| Latest release | Unknown |
| Last updated | 2026-06-30 |
| Source | https://github.com/knowsuchagency/mcp2cli |
What mcp2cli is
mcp2cli introspects API sources (MCP via HTTP/SSE/stdio, OpenAPI specs, GraphQL endpoints) and auto-generates CLI commands with proper parameter binding, selection set construction, and result formatting. It handles OAuth token lifecycle (acquisition, caching, refresh), persists usage metrics for LLM-aware tool ranking, and outputs JSON for programmatic consumption.
Get the mcp2cli source
Clone the repository and explore it locally.
git clone https://github.com/knowsuchagency/mcp2cli.gitcd mcp2cli# follow the project's README for install & configurationNeed it deployed, integrated, or customized instead? DEV.co ships production installs.
Best use cases
Implementation considerations
- Installation via `uvx` or `uv tool install` requires Python 3.10+; validate Python environment compatibility in deployment targets.
- OAuth flow requires browser access for authorization code + PKCE; client credentials flow works headless. Plan auth flow choice based on deployment context (agentic vs. interactive).
- Baked tool configs stored in `~/.config/mcp2cli/` and usage tracking in `~/.cache/mcp2cli/`; ensure writable home directory and consider persistence strategy in containerized environments.
- Secrets via `env:` or `file:` prefixes prevent credential leakage in process listings; always use these instead of bare CLI arguments in production.
- MCP stdio mode spawns subprocess; ensure child process permissions, signal handling, and cleanup align with security policy (e.g., no arbitrary command execution without validation).
When to avoid it — and what to weigh
- High-Performance, Low-Latency Requirements — Runtime introspection and dynamic CLI generation introduce latency unsuitable for sub-100ms SLA endpoints or real-time systems. Baking improves this, but still incurs overhead vs. compiled clients.
- Complex State Machine APIs — mcp2cli treats each invocation atomically; APIs requiring multi-step orchestration, session management, or complex flow control will require external orchestration logic outside the tool's scope.
- Proprietary or Undocumented APIs — Requires OpenAPI, GraphQL introspection, or MCP server compliance. Proprietary protocols or APIs without machine-readable schemas cannot be adapted without manual specification work.
- Highly Security-Sensitive Deployments — No formal security audit data provided. Dynamic introspection and schema parsing present a larger attack surface than static binaries; requires careful review before use in isolated or air-gapped environments.
License & commercial use
MIT License permits commercial use, modification, and distribution with attribution and liability disclaimer. No restrictions on proprietary deployment or closed-source integration.
MIT is a permissive OSI license. Commercial use—including building proprietary products, SaaS platforms, and consulting services around mcp2cli—is explicitly permitted. No license fees or commercial restrictions apply. However, derivative works must retain the original license notice.
DEV.co evaluation signals
Editorial assessment — not user reviews. Directional, with an explicit confidence level.
| Signal | Assessment |
|---|---|
| Maintenance | Active |
| Documentation | Strong |
| License clarity | Clear |
| Deployment complexity | Low |
| DEV.co fit | Strong |
| Assessment confidence | High |
No formal security audit or disclosure policy documented. Introspection and dynamic schema parsing may increase surface area vs. static clients. OAuth token caching in `~/.cache/mcp2cli/oauth/` assumes local filesystem is trusted; review file permissions and consider encrypted credential storage for multi-user systems. Secret injection via `env:` and `file:` reduces process-listing leakage but does not provide transport-layer encryption or key rotation. Validate untrusted OpenAPI/GraphQL schemas and MCP servers before use in restricted environments.
Alternatives to consider
OpenAPI Generator / Swagger CLI
Codegen-based tools produce compiled, versioned clients for OpenAPI; trade dynamism for performance and explicit versioning control. Suitable if schema stability is high and performance is critical.
curl / httpie / websocat
Lightweight, shell-friendly HTTP/WebSocket clients; require manual schema parsing and tool discovery. Simpler for one-off requests; not suitable for large API surface or LLM integration.
GraphQL CLI / Apollo Client
Purpose-built for GraphQL; static or code-generation-based. Better performance and type safety for GraphQL-only use cases; does not support MCP or OpenAPI.
Build on mcp2cli with DEV.co software developers
mcp2cli reduces token overhead for LLM agents and simplifies multi-API orchestration. Start with a free installation or consult our team about enterprise integration.
Talk to DEV.coRelated open-source tools
Surfaced by semantic similarity across the DEV.co open-source index.
Related on DEV.co
Explore the category and the services that help you build with it.
mcp2cli FAQ
Can I use mcp2cli in production without worrying about stability?
Does mcp2cli require a server or background process?
How do I secure API keys and OAuth credentials?
What's the performance overhead compared to direct API calls?
Software development & web development with DEV.co
From first prototype to production, DEV.co delivers software development services around tools like mcp2cli. Our software development agency staffs experienced software developers and web developers for custom software development, web development, integrations, and ongoing support across mcp servers and beyond.
Ready to Unify Your APIs?
mcp2cli reduces token overhead for LLM agents and simplifies multi-API orchestration. Start with a free installation or consult our team about enterprise integration.