# mcp2cli-api-to-cli

mcp2cli-api-to-cli converts MCP servers, OpenAPI specs, and GraphQL endpoints into CLI commands on the fly without codegen. It cuts context token usage by replacing heavy tool schemas with CLI calls.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode, Windsurf (Devin Desktop), Claude.ai · 225 installs · ★ 9 repo stars
- Author: reason-machines
- License: not stated · policy=link-only · description only; the file stays with the author
- Source: https://github.com/reason-machines/mcp-skills/tree/HEAD/skills/mcp2cli-api-to-cli/SKILL.md
- Updated: 2026-10-09
- Security check: automated, 2026-11-16 (text) — no signs of malicious code found.
- HTML: https://affpapa.org/en/nevibecode/skills/mcp2cli-api-to-cli

## What it does

The skill routes agent interactions with MCP servers, OpenAPI 3.x specs, and GraphQL endpoints through the `mcp2cli` terminal utility. Instead of stuffing full JSON schemas of every tool into the model's context window on every turn, the agent triggers standard terminal commands. This drastically limits token consumption on repetitive tool schemas.

Under the hood, four runtime modes are available: MCP over HTTP or SSE, local MCP processes via stdio, OpenAPI document parsing, and GraphQL introspection. The bake feature allows saving complex connection flags into reusable aliases prefixed with `@`, or exporting them into standalone executable scripts inside `~/.local/bin/`.

Passing secrets as bare CLI arguments exposes them in process trees, so the tool resolves credentials via `env:` or `file:` references instead. OAuth tokens persist in `~/.cache/mcp2cli/oauth/` with automatic refresh. Running the CLI directly expects `uvx` or a global installation via `uv tool`.

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add reason-machines/mcp-skills --skill mcp2cli-api-to-cli -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/mcp2cli-api-to-cli/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/mcp2cli-api-to-cli/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add reason-machines/mcp-skills --skill mcp2cli-api-to-cli -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/mcp2cli-api-to-cli/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add reason-machines/mcp-skills --skill mcp2cli-api-to-cli -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/mcp2cli-api-to-cli/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install reason-machines/mcp-skills skills/mcp2cli-api-to-cli
```

2. **Manually: put the files in place**
- File: `.github/skills/mcp2cli-api-to-cli/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add reason-machines/mcp-skills --skill mcp2cli-api-to-cli -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/reason-machines/mcp-skills --path skills/mcp2cli-api-to-cli
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/mcp2cli-api-to-cli/SKILL.md` — The legacy .windsurf/skills/ path still works

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add reason-machines/mcp-skills --skill mcp2cli-api-to-cli -a opencode
```

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/reason-machines/mcp-skills/tree/HEAD/skills/mcp2cli-api-to-cli/SKILL.md

## When to use it
- connect to remote MCP servers over HTTP or SSE
- execute endpoints from an OpenAPI 3.x document without generating code
- query or mutate GraphQL schemas directly from the command line
- save recurring connection flags as named presets with `bake`
- pass sensitive API tokens through environment variables or file paths

## Example prompts
- Connect to the MCP server at `https://mcp.example.com/sse` using `mcp2cli` and list all available tools.
- Call the `list-pets` endpoint with `--limit 10` using our local `./openapi.yaml` spec.
- Save the connection configuration for `https://api.example.com/graphql` into a baked preset called `backend`.

## Similar
- [mcp2cli](https://affpapa.org/en/nevibecode/skills/mcp2cli.md) — skill · 1400 installs
- [api-documenter](https://affpapa.org/en/nevibecode/skills/api-documenter.md) — skill · 727 installs
- [api-documentation](https://affpapa.org/en/nevibecode/skills/bobmatnyc-api-documentation.md) — skill · 397 installs
- [api-design](https://affpapa.org/en/nevibecode/skills/agent-skills-team-api-design.md) — skill · 390 installs
- [api-designer](https://affpapa.org/en/nevibecode/skills/api-designer.md) — skill · 7100 installs
- [api-recon-and-docs](https://affpapa.org/en/nevibecode/skills/api-recon-and-docs.md) — skill · 4200 installs

From the same set: [reason-machines/mcp-skills](https://affpapa.org/en/nevibecode/by/reason-machines/mcp-skills.md) — 98 cards

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
