mcp2cli-api-to-cli

Convert 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/Aradotso/mcp-skills --skill mcp2cli-api-to-cli
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: mcp2cli-api-to-cli
Source: https://github.com/Aradotso/mcp-skills/tree/main/skills/mcp2cli-api-to-cli
Command: npx skills add https://github.com/Aradotso/mcp-skills --skill mcp2cli-api-to-cli

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

It solves the high token cost and friction of repeatedly exposing large tool schemas by turning MCP servers, OpenAPI specs, or GraphQL endpoints into a compact CLI interface.

Core Features & Use Cases

  • Dynamic CLI generation (no codegen): Create commands at runtime from MCP HTTP/SSE, MCP stdio, OpenAPI 3.x, or GraphQL introspection.
  • Token-efficient tool calls: Replace repetitive tool-schema transmissions with reusable CLI-style invocations to save 96-99% of tokens per LLM turn.
  • Auth, caching, and reusable connections: Support OAuth flows, secret management, spec/tool caching with TTL, and “baked” named configs for repeatable workflows.
  • Use case: Turn a third-party OpenAPI service into a ready-to-run command set so an agent can list and query endpoints (with auth) without embedding massive schema text in every conversation.

Quick Start

Ask mcp2cli to list available tools from an OpenAPI spec you provide by running the command: mcp2cli --spec ./openapi.json --list.

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 reduce token usage when exposing OpenAPI specs to LLM agents?

By converting OpenAPI specifications into a runtime-generated CLI interface, you replace repetitive tool-schema transmissions with compact CLI invocations. This approach saves 96-99% of tokens per LLM turn while preserving endpoint access.

Can I generate a CLI from an MCP server without codegen?

Yes, dynamic CLI generation creates commands at runtime from MCP HTTP/SSE, MCP stdio, OpenAPI 3.x, or GraphQL introspection without any codegen. This produces a ready-to-run command set for agent-driven operations.

Does this CLI generation approach support OAuth 2.0 and secret management?

Yes, the CLI generation approach supports OAuth 2.0 flows, secret management, and spec/tool caching with configurable TTL. It also enables creating baked named configurations for repeatable authenticated workflows.

What is the best way to list available tools from a GraphQL endpoint?

The best way to list available tools is using a runtime CLI generator that performs GraphQL introspection. This allows you to query endpoints and mutations directly via a compact CLI without embedding massive schema text in conversations.

Why does passing large tool schemas to agents increase token costs?

Passing large tool schemas to agents increases token costs because the massive schema text must be repeatedly transmitted in every conversation turn. Converting these schemas into a compact CLI interface eliminates this repetitive schema overhead.

Are there limitations when using cached CLI configurations for REST APIs?

A limitation of using cached CLI configurations is that schemas may become stale if the API changes before the TTL expires. You must configure appropriate TTL values and manage baked configs carefully to ensure endpoint accuracy.