mcp2cli-api-to-cli

Converts MCP servers, OpenAPI specs, and GraphQL endpoints into runtime-generated CLIs.

7|2|Updated May 16, 2026
One-click install
npx skills add https://github.com/reason-machines/mcp-skills --skill mcp2cli-api-to-cli-reason-machines
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: mcp2cli-api-to-cli
Source: https://github.com/reason-machines/mcp-skills/tree/main/skills/mcp2cli-api-to-cli
Command: npx skills add https://github.com/reason-machines/mcp-skills --skill mcp2cli-api-to-cli-reason-machines

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? LLM agents waste 96-99% of tokens repeatedly transmitting tool schemas when calling MCP servers or APIs. This Skill converts any MCP server, OpenAPI specification, or GraphQL endpoint into a CLI at runtime with zero code generation, replacing schema-heavy tool calls with simple command invocations. ## Core Features & Use Cases - Four Connection Modes: Connect to MCP servers over HTTP/SSE or stdio, generate CLIs from OpenAPI 3.x specs, or introspect and query GraphQL endpoints. - Bake Mode: Save named, reusable connection configurations with auth headers, tool filtering (include/exclude patterns, HTTP methods), and cache TTL, then invoke them with an @ prefix. - OAuth & Secret Management: Supports OAuth 2.0 authorization code with PKCE and client credentials flows, plus secrets loaded from environment variables or files. - Use Case: You need an agent to query a Hasura GraphQL API repeatedly. Bake the endpoint once with its admin secret, then call mcp2cli @hasura users --limit 10 instead of sending full tool schemas every turn. ## Quick Start Use mcp2cli to list the available tools from the MCP server at https://mcp.example.com/sse and then call its search tool with a test query.

Frequently Asked Questions about mcp2cli-api-to-cli

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I turn an OpenAPI spec into a CLI?▼

Run mcp2cli with the --spec flag pointing to a local or remote OpenAPI 3.x JSON or YAML file, then use --list to see generated commands. Call endpoints directly, for example: mcp2cli --spec ./openapi.json list-pets --limit 20.

How to connect to an MCP server from the command line?▼

Use mcp2cli --mcp with the server URL for HTTP/SSE servers, or --mcp-stdio with a launch command for local servers. Add --list to enumerate tools, then invoke any tool as a subcommand with its arguments as flags.

Does mcp2cli support OAuth authentication?▼

Yes, all modes support OAuth 2.0 authorization code with PKCE and client credentials flows via the --oauth flag. Tokens are cached in ~/.cache/mcp2cli/oauth/ and refreshed automatically.

Can I query a GraphQL endpoint without writing queries?▼

Yes, mcp2cli introspects the GraphQL schema and auto-generates selection sets when you call a query or mutation by name. You can override returned fields with the --fields flag.

Why does mcp2cli show stale tools after an API changes?▼

Specs and tool lists are cached for one hour by default in ~/.cache/mcp2cli/. Pass --refresh to bypass the cache, or set a custom TTL with --cache-ttl in seconds.

How do I avoid passing API keys as CLI arguments?▼

Reference secrets with env: or file: prefixes, such as --auth-header "Authorization:env:MY_API_TOKEN". This keeps credentials out of shell history and works with secret managers like Vault.