Skip to main content
MCP server CX Codex

cli2mcp — Claude Code MCP server: what it does, how to install

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.

Install into Claude Code · Platform CLI All methods and platforms ↓
claude mcp add cli2mcp -- npx -y cli2mcp
Open on GitHub

What cli2mcp 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.

What it helps with

  • 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 for the agent

  • Search for TODO comments across the src folder using ripgrep
  • Extract the id fields from data.json using jq

How to install cli2mcp

Platform CLI

claude mcp add cli2mcp -- npx -y cli2mcp

Step by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more

Questions about cli2mcp

How do I install cli2mcp in Claude Code?

Run claude mcp add cli2mcp -- npx -y cli2mcp.

What does cli2mcp do?

It wraps any installed CLI utility into an MCP stdio server by inferring a JSON Schema straight from its help flag.

What are the prerequisites?

It requires Node.js 22 or higher, and the target executable must be present in your PATH.

Similar MCP servers

All MCP servers for Agent setup: memory, context, orchestration →

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor