Loading...
Loading...
Turn any MCP server or OpenAPI spec into a CLI. Use this skill when the user wants to interact with an MCP server or OpenAPI/REST API via command line, discover available tools/endpoints, call API operations, or generate a new skill from an API. Triggers include "mcp2cli", "call this MCP server", "use this API", "list tools from", "create a skill for this API", or any task involving MCP tool invocation or OpenAPI endpoint calls without writing code.
npx skill4agent add knowsuchagency/mcp2cli mcp2cli# Run directly (no install needed)
uvx mcp2cli --help
# Or install
pip install mcp2cli--list<command> --help# MCP over HTTP
mcp2cli --mcp https://mcp.example.com/sse --list
mcp2cli --mcp https://mcp.example.com/sse create-task --help
mcp2cli --mcp https://mcp.example.com/sse create-task --title "Fix bug"
# MCP over stdio
mcp2cli --mcp-stdio "npx @modelcontextprotocol/server-filesystem /tmp" --list
mcp2cli --mcp-stdio "npx @modelcontextprotocol/server-filesystem /tmp" read-file --path /tmp/hello.txt
# OpenAPI spec (remote or local, JSON or YAML)
mcp2cli --spec https://petstore3.swagger.io/api/v3/openapi.json --list
mcp2cli --spec ./openapi.json --base-url https://api.example.com list-pets --status availablemcp2cli [global options] <subcommand> [command options]
Source (mutually exclusive, one required):
--spec URL|FILE OpenAPI spec (JSON or YAML, local or remote)
--mcp URL MCP server URL (HTTP/SSE)
--mcp-stdio CMD MCP server command (stdio transport)
Options:
--auth-header K:V HTTP header sent with requests (repeatable)
--base-url URL Override base URL from spec
--env KEY=VALUE Env var for stdio server process (repeatable)
--cache-key KEY Custom cache key
--cache-ttl SECONDS Cache TTL (default: 3600)
--refresh Bypass cache
--list List available subcommands
--pretty Pretty-print JSON output
--raw Print raw response body
--toon Encode output as TOON (token-efficient for LLMs)
--version Show version# API key header
mcp2cli --spec ./spec.json --auth-header "Authorization:Bearer tok_..." list-items
# Multiple headers
mcp2cli --mcp https://mcp.example.com/sse \
--auth-header "x-api-key:sk-..." \
--auth-header "x-org-id:org_123" \
search --query "test"echo '{"name": "Fido", "tag": "dog"}' | mcp2cli --spec ./spec.json create-pet --stdinmcp2cli --mcp-stdio "node server.js" --env API_KEY=sk-... --env DEBUG=1 search --query "test"~/.cache/mcp2cli/mcp2cli --spec https://api.example.com/spec.json --refresh --list # Force refresh
mcp2cli --spec https://api.example.com/spec.json --cache-ttl 86400 --list # 24h TTLmcp2cli --mcp https://mcp.example.com/sse --toon list-tagsuvx mcp2cli --mcp https://target.example.com/sse --listuvx mcp2cli --mcp https://target.example.com/sse <command> --helpuvx mcp2cli --mcp https://target.example.com/sse <command> --param value--mcp--mcp-stdio--spec--list--helpuvx mcp2cli ...