# cli2mcp MCP server

> Expose any command-line binary as a Model Context Protocol tool by automatically synthesizing JSON schemas from its help output.

- Repository: https://github.com/RonieNeubauer/cli2mcp
- Page: https://hostedmcp.org/servers/ronieneubauer/cli2mcp
- Transport: stdio
- Stars: 13
- License: MIT
- Latest version: 0.1.4

## Install

### Claude Code

```sh
claude mcp add cli2mcp -- npx -y cli2mcp
```

### Cursor (`~/.cursor/mcp.json`)

```json
{
  "mcpServers": {
    "cli2mcp": {
      "command": "npx",
      "args": [
        "-y",
        "cli2mcp"
      ]
    }
  }
}
```

### VS Code (`.vscode/mcp.json`)

```json
{
  "servers": {
    "cli2mcp": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "cli2mcp"
      ]
    }
  }
}
```

### VS Code CLI

```sh
code --add-mcp '{"name":"cli2mcp","type":"stdio","command":"npx","args":["-y","cli2mcp"]}'
```

### Claude Desktop (`claude_desktop_config.json`)

```json
{
  "mcpServers": {
    "cli2mcp": {
      "command": "npx",
      "args": [
        "-y",
        "cli2mcp"
      ]
    }
  }
}
```

### Codex

```sh
codex mcp add cli2mcp -- npx -y cli2mcp
```

### Codex config.toml (`~/.codex/config.toml`)

```toml
[mcp_servers.cli2mcp]
command = "npx"
args = ["-y", "cli2mcp"]
```

### Gemini CLI

```sh
gemini mcp add -s user cli2mcp npx -- -y cli2mcp
```

### Gemini settings.json (`~/.gemini/settings.json`)

```json
{
  "mcpServers": {
    "cli2mcp": {
      "command": "npx",
      "args": [
        "-y",
        "cli2mcp"
      ]
    }
  }
}
```

## FAQ

### What happens if a CLI does not have a --help flag?

The server will still start but will fall back to a single variadic args positional, meaning the AI gets a free-form argument list instead of typed flags.

### Does cli2mcp install the command-line tools for me?

No, the CLI must already be installed and available on your system's PATH.

### Is the AI sandboxed when using this tool?

No, the AI is not sandboxed and can invoke any CLI you expose with arguments it chooses; you are responsible for the security implications.
