Universal CLI adapter that turns MCP servers, OpenAPI specs, and GraphQL APIs into interactive command-line tools.
Inspired by mcp2cli (Python) — this is a ground-up Rust rewrite with expanded protocol support.
curl -fsSL https://raw.githubusercontent.com/christopher-kapic/mcp2cli-rs/master/scripts/install.sh | bashThis installs the latest release to /usr/local/bin. Run it again at any time to update.
To install a specific version or to a custom directory:
# Specific version
curl -fsSL https://raw.githubusercontent.com/christopher-kapic/mcp2cli-rs/master/scripts/install.sh | bash -s v0.2.0
# Custom directory
curl -fsSL https://raw.githubusercontent.com/christopher-kapic/mcp2cli-rs/master/scripts/install.sh | INSTALL_DIR=~/.local/bin bashcargo install --git https://github.com/christopher-kapic/mcp2cli-rs.git# HTTP / SSE server
mcp2cli --mcp http://localhost:3000 --list
mcp2cli --mcp http://localhost:3000 get-user --id 42
# Stdio server
mcp2cli --mcp-stdio "npx -y @modelcontextprotocol/server-filesystem /" --listmcp2cli --spec https://petstore3.swagger.io/api/v3/openapi.json --list
mcp2cli --spec ./openapi.yaml findPetsByStatus --status available --prettymcp2cli --graphql https://countries.trevorblades.com --list
mcp2cli --graphql https://countries.trevorblades.com country --code US --pretty- Three protocols — MCP (HTTP, SSE, stdio), OpenAPI, and GraphQL through one binary
- Authentication — static headers (
--auth-header) or OAuth 2.0 (PKCE and client-credentials flows) - Sessions — persistent background daemons for long-lived MCP connections
- Bake — save and recall CLI configurations as named profiles, installable as shell commands
- Output — pretty-print, raw,
--jqfilters,--toonformatting,--headto limit arrays - Caching — file-based response cache with configurable TTL
- Filtering —
--searchglobally;--include/--excludeglob patterns and--methodsin bake configs
# Static header
mcp2cli --spec api.yaml --auth-header "Authorization:Bearer $TOKEN" list-items
# OAuth 2.0 PKCE (opens browser)
mcp2cli --spec api.yaml --oauth https://auth.example.com --oauth-client-id my-app list-items
# OAuth 2.0 client credentials
mcp2cli --spec api.yaml --oauth https://auth.example.com \
--oauth-client-id my-app --oauth-client-secret $SECRET list-itemsKeep an MCP connection alive across invocations:
mcp2cli --mcp http://localhost:3000 --session-start my-session
mcp2cli --session my-session get-user --id 42
mcp2cli --session my-session --session-stop my-session
mcp2cli --session-list# Save a configuration
mcp2cli bake create petstore --spec https://petstore3.swagger.io/api/v3/openapi.json --pretty
# Use it
mcp2cli @petstore --list
mcp2cli @petstore findPetsByStatus --status available
# Install as a standalone shell command
mcp2cli bake install petstore
petstore findPetsByStatus --status availablemcp2cli --spec api.yaml list-items --pretty # Pretty-print JSON
mcp2cli --spec api.yaml list-items --jq '.[0].name' # jq filter
mcp2cli --spec api.yaml list-items --head 5 # First 5 items
mcp2cli --spec api.yaml list-items --raw # Raw text- Rust 1.80+
MIT
