DEV.co
MCP Servers · knowsuchagency

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.

Source: GitHub — github.com/knowsuchagency/mcp2cli
2.3k
GitHub stars
163
Forks
Python
Primary language
MIT
License (OSI-approved)

Key facts

Objective fields from the source. Values we can't verify are shown as “Unknown” rather than guessed.

FieldValue
Repositoryknowsuchagency/mcp2cli
Ownerknowsuchagency
Primary languagePython
LicenseMIT — OSI-approved
Stars2.3k
Forks163
Open issues1
Latest releaseUnknown
Last updated2026-06-30
Sourcehttps://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.

Quickstart

Get the mcp2cli source

Clone the repository and explore it locally.

terminalbash
git clone https://github.com/knowsuchagency/mcp2cli.gitcd mcp2cli# follow the project's README for install & configuration

Need it deployed, integrated, or customized instead? DEV.co ships production installs.

Best use cases

AI Agent Integration

Teach LLM agents (Claude, Cursor) to discover and invoke any API without hardcoded tool schemas. Reduces token overhead by 96–99% per turn by generating CLI commands dynamically instead of embedding full OpenAPI/GraphQL schemas.

Multi-API Orchestration

Unify command-line access to heterogeneous backend services (MCP servers, REST APIs, GraphQL). Single tool learns new endpoints; no SDK or language-specific client library required.

Rapid Prototyping & Testing

Test new endpoints or MCP servers immediately without writing wrapper scripts. OAuth, auth headers, and secret injection from environment/files enable safe credential handling in CI/testing.

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.

SignalAssessment
MaintenanceActive
DocumentationStrong
License clarityClear
Deployment complexityLow
DEV.co fitStrong
Assessment confidenceHigh
Security considerations

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.

Software development agency

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

Related 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?
Proceed with caution. The project shows active development but has no published releases (v1.0 milestone unclear). Recommend pinning a specific commit or waiting for v1.0 release before critical production deployment. Monitor GitHub for breaking changes.
Does mcp2cli require a server or background process?
No. mcp2cli is a stateless CLI tool—each invocation is independent. Baked configs are stored locally; no central server or daemon required. OAuth tokens are cached locally and refreshed on demand.
How do I secure API keys and OAuth credentials?
Use `env:` or `file:` prefixes to pass secrets from environment variables or files instead of CLI arguments. This prevents credential leakage in process listings. For multi-user systems, ensure strict file permissions on credential files.
What's the performance overhead compared to direct API calls?
Introspection and dynamic CLI generation add latency (milliseconds to seconds depending on schema size and network). Baking trades latency for disk space by caching metadata. For real-time or high-frequency use, consider calling the API directly or caching baked configs aggressively.

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.