# cli2mcp

Exposes command-line binaries as Model Context Protocol tools by converting their --help output into JSON Schemas on startup. Useful for giving agents direct access to CLI utilities.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed, Gemini CLI · ★ 12
- Author: RonieNeubauer
- License: MIT · policy=link-only · description only; the file stays with the author
- Source: https://github.com/RonieNeubauer/cli2mcp
- Updated: 2026-04-29
- HTML: https://affpapa.org/en/nevibecode/mcp/cli2mcp

## What it does

The server turns terminal commands into MCP tools via stdio without boilerplate. During launch, it inspects `--help` text, extracts flags, and builds an input schema. If help parsing fails on an unusual format, it provides a fallback variadic `args` array so the model can still execute the command.

The tool handles data piping into `stdin` and accepts options for `--name`, `--description`, `--cwd`, and `--timeout`. Running it requires Node.js 22 or newer.

Target binaries must already exist on your system `PATH`, as `cli2mcp` does not install external software for you. This is an early 0.1 release limited to stdio transport.

## Requirements
- Needs: Node.js (commands run via npx)

## Install

### Claude Code (native platform)

**Platform CLI**
```bash
claude mcp add cli2mcp -- npx -y cli2mcp
```

### Codex

**Platform CLI**
```bash
codex mcp add cli2mcp -- npx -y cli2mcp
```

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "cli2mcp": {
            "command": "npx",
            "args": [
                "-y",
                "cli2mcp"
            ]
        }
    }
}
```

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "cli2mcp": {
            "type": "stdio",
            "command": "npx",
            "args": [
                "-y",
                "cli2mcp"
            ]
        }
    }
}
```

### Gemini CLI

**Platform CLI**
```bash
gemini mcp add cli2mcp npx -y cli2mcp
```

## When to use it
- expose local CLI binaries as agent tools without manual coding
- derive parameter schemas directly from command help text
- pipe string payloads into subprocess `stdin` during tool calls
- confine command execution to a safe directory or runtime limit

## Example prompts
- Search for TODO comments across the src folder using ripgrep
- Extract the id fields from data.json using jq

## Similar
- [Stepgate](https://affpapa.org/en/nevibecode/mcp/stepgate.md) — MCP server · ★ 13
- [cyrus-setup-prerequisites](https://affpapa.org/en/nevibecode/skills/cyrus-setup-prerequisites.md) — skill · 1000 installs
- [cli-anything-pm2](https://affpapa.org/en/nevibecode/skills/cli-anything-pm2.md) — skill · 491 installs
- [hook-development](https://affpapa.org/en/nevibecode/skills/hook-development.md) — skill · 7028 installs
- [aem-cli](https://affpapa.org/en/nevibecode/skills/aem-cli.md) — skill · 840 installs
- [k-skill-setup](https://affpapa.org/en/nevibecode/skills/k-skill-setup.md) — skill · 8400 installs

---
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
