{
  "markdown": "# mcp2cli\n\n**MCP servers are expensive. CLIs are not.**\n\n> A Claude Code plugin that converts MCP servers into token-efficient CLI tools.\n\n---\n\n## Why?\n\nMCP servers load **every tool schema** into the agent's context window on startup. For a server with 30 tools, that's ~55,000 tokens burned before the agent does anything.\n\nA CLI tool with a SKILL.md loads **on-demand** — only when relevant — and returns compact text instead of verbose JSON.\n\n|  | MCP | CLI + Skill |\n|:---|:---|:---|\n| **Startup** | Load all tool schemas into context | Nothing loaded |\n| **Token cost** | ~55,000 tokens for 30 tools | 0 tokens until first use |\n| **On use** | JSON + metadata per call | Load SKILL.md once (~2K tokens) |\n| **Output** | Verbose structured JSON | Compact plain text |\n\n> **Bottom line:** 94–96% token savings across all scales.\n\n|  | MCP | CLI + Skill | Savings |\n|:---|---:|---:|---:|\n| 5 tools | 8,000 tok | 500 tok | **94%** |\n| 30 tools | 55,000 tok | 2,000 tok | **96%** |\n| 100 tools | 134,000 tok | 5,000 tok | **96%** |\n\n> The canonical example: **Playwright** shipped a CLI + SKILL.md alongside their MCP server — specifically for coding agents where token efficiency matters.\n\n---\n\n## Quick Start\n\n**1. Clone the plugin:**\n\n```bash\ngit clone https://github.com/myeolinmalchi/mcp2cli.git\n```\n\n**2. Load it in Claude Code:**\n\n```bash\nclaude --plugin-dir ./mcp2cli\n```\n\n**3. Convert your first MCP server:**\n\n```\n/convert ./my-mcp-server\n```\n\nThat's it. The plugin analyzes the server, generates CLI code, and creates a SKILL.md — all in one step.\n\n---\n\n## How It Works\n\nThe plugin runs a **5-phase conversion pipeline**:\n\n| Phase | Name | What happens | Output |\n|:-----:|:-----|:-------------|:-------|\n| 1 | **Analyze** | Read MCP source, extract tools, params, outputs, auth | Structured analysis table |\n| 2 | **Design** | Map tool names → CLI commands, params → flags | Command structure spec |\n| 3 | **Generate** | Write TypeScript CLI reusing MCP's business logic | Working npm CLI tool |\n| 4 | **Skill** | Generate SKILL.md under 500 lines with examples | SKILL.md file |\n| 5 | **Validate** | Run each command, compare with MCP output | Test report |\n\n### Supported MCP Patterns\n\nThe plugin classifies MCP servers into 4 tiers by CLI conversion feasibility:\n\n| Tier | Patterns | CLI Fit |\n|:----:|:---------|:-------:|\n| 1 | Local System Tool, SaaS API Wrapper, DevOps, Document/Media Processing | Excellent |\n| 2 | Database, Search, Proxy, Multi-tool, Messaging, Monitoring | Good |\n| 3 | Browser Automation, Code Execution, Memory, Auth/Identity | Partial |\n| 4 | Aggregator/Gateway, Reasoning/Cognitive | Not recommended |\n\n---\n\n## Commands\n\n| Command | Description |\n|:--------|:------------|\n| `/convert <path>` | Full end-to-end conversion (all 5 phases) |\n| `/analyze-mcp <path>` | Analysis only — assess feasibility, no code gen |\n| `/generate-skill <cli-name>` | Generate SKILL.md for an existing CLI tool |\n\n```bash\n/convert ./my-mcp-server\n/convert https://github.com/user/their-mcp-server\n/analyze-mcp ./my-mcp-server\n/generate-skill my-existing-cli\n```\n\n---\n\n## What's Inside\n\n```\nmcp2cli/\n├── .claude-plugin/\n│   └── plugin.json\n│\n├── skills/\n│   ├── mcp-analyze/                    # MCP server analysis & pattern classification\n│   │   ├── SKILL.md\n│   │   └── references/\n│   │       └── pattern-classification.md\n│   │\n│   ├── mcp-codegen/                    # TypeScript CLI code generation\n│   │   ├── SKILL.md\n│   │   └── references/\n│   │       ├── cli-scaffold.md\n│   │       ├── porting-cheatsheet.md\n│   │       ├── tier-1-templates.md\n│   │       ├── tier-2-templates.md\n│   │       └── tier-3-strategies.md\n│   │\n│   └── skill-author/                   # SKILL.md generation\n│       ├── SKILL.md\n│       └── references/\n│           └── skill-template.md\n│\n├── commands/\n│   ├── convert.md                      # /convert — orchestrates all skills\n│   ├── analyze-mcp.md                  # /analyze-mcp — analysis only\n│   └── generate-skill.md              # /generate-skill — SKILL.md for existing CLI\n│\n└── agents/\n    └── mcp-analyzer.md                 # Subagent for MCP source analysis\n```\n\n| Component | Count | Purpose |\n|:----------|:-----:|:--------|\n| Skills | 3 | `mcp-analyze`, `mcp-codegen`, `skill-author` |\n| Commands | 3 | `/convert` (orchestrator), `/analyze-mcp`, `/generate-skill` |\n| Agents | 1 | MCP server source code analysis |\n\n---\n\n## When to Convert (and When Not To)\n\n| Convert to CLI | Keep as MCP |\n|:---------------|:------------|\n| Stateless request/response tools | Real-time streaming / subscriptions |\n| Text or JSON output | Binary streams (audio, video) |\n| Infrequently used tools (schema overhead > value) | Bidirectional communication |\n| Simpler deployment desired | Complex state management across calls |\n\n> **Rule of thumb:** If the MCP tool is basically `input → API call → output`, it should be a CLI.\n\n---\n\n## Contributing\n\n1. **Add patterns** — New conversion patterns go in `skills/mcp-codegen/references/`\n2. **Keep it lean** — SKILL.md stays under 500 lines. Detailed docs go in `references/`\n3. **Test conversions** — Point `/convert` at any MCP server and verify the output works\n\n```bash\n# Test locally\nclaude --plugin-dir ./mcp2cli\n```\n\n---\n\n## References\n\n- [Playwright CLI + SKILL.md](https://www.npmjs.com/package/@playwright/cli) — The canonical MCP-to-CLI migration\n- [mcp-cli](https://www.philschmid.de/mcp-cli) — Dynamic tool discovery bridge (99% token reduction)\n- [MCP vs CLI Benchmarks](https://mariozechner.at/posts/2025-08-15-mcp-vs-cli/) — 33% token efficiency advantage for CLI\n- [Cloudflare Code Mode](https://blog.cloudflare.com/code-mode-mcp/) — 99.9% token reduction via single-tool MCP\n- [Claude Code Skills Docs](https://code.claude.com/docs/en/skills) — Official skill authoring guide\n- [Claude Code Plugins Docs](https://code.claude.com/docs/en/plugins) — Official plugin development guide\n",
  "bytes": 5916,
  "sha": "a871c6be814855db4c0824d1e9870a329a73a043443f29c2543cf9f38ec5d444",
  "repo_slug": "myeolinmalchi/mcp2cli",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/plg_myeolinmalchi_mcp2cli_mcp2cli_60b6c05d/readme"
}