cli2mcp
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@cli2mcpturn curl into an MCP server"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
cli2mcp -- Turn any CLI into an MCP Server
An educational Python library that bridges the gap between traditional command-line tools and the Model Context Protocol (MCP).
cli2mcp scans a CLI tool's --help output, extracts its arguments and
subcommands, and generates a JSON descriptor file. It can then serve that
file as a fully functional MCP server -- letting AI assistants call the CLI
tool through a standard protocol.
Quick start
uv sync1. Scan a CLI tool
uv run cli2mcp scan curlThis runs curl --help, parses the output, and writes curl.tools.json.
For tools with subcommands (like git):
uv run cli2mcp scan git -o git.tools.jsonEach subcommand becomes its own MCP tool.
2. Serve as an MCP server
uv run cli2mcp serve curl.tools.jsonThis starts an MCP server (stdio transport) that exposes every entry in the JSON file as a callable tool.
To use HTTP transport instead:
uv run cli2mcp serve curl.tools.json -t streamable-http3. Connect to an AI assistant
Add the server to your assistant's MCP configuration.
{
"mcpServers": {
"curl": {
"command": "cli2mcp",
"args": ["serve", "curl.tools.json"]
}
}
}Related MCP server: mcp-cli-catalog
How it works
MCP client
|
cli2mcp scan curl --> curl.tools.json |
| |
cli2mcp serve <---+
|
subprocess.run(["curl", ...])The JSON schema
The generated file looks like this:
{
"command": "curl",
"tools": [
{
"name": "curl",
"description": "transfer a URL",
"args": [
{
"name": "url",
"description": "URL to transfer",
"type": "string",
"required": true
},
{
"name": "--output",
"description": "Write output to file instead of stdout",
"type": "string",
"required": false
}
]
}
]
}command-- the base CLI binary to run.tools-- one entry per tool (or per subcommand).args-- each argument has aname,description,type(always"string"), andrequiredflag.Argument names starting with
--are flags; others are positional.You can hand-edit this file to add, remove, or rename tools.
How arguments map back to CLI commands
When the MCP server receives a tool call like:
{"name": "git_commit", "arguments": {"message": "fix bug", "all": "true"}}It reconstructs the CLI command:
git commit --message "fix bug" --all trueFlags (names starting with --) are emitted as --flag value.
Positional arguments are appended at the end.
Supported help styles
Different CLI frameworks produce different --help formats.
cli2mcp auto-detects the style and uses the right parser:
Style | Frameworks | Flag format |
GNU | argparse, click, GNU |
|
Cobra | kubectl, oc, docker, gh |
|
Plain | curl, busybox | flags listed without section headers |
Requirements
Python 3.10+
uv (recommended) or pip
mcp[cli](the official MCP Python SDK, installed automatically)
This server cannot be deployed
Maintenance
Related MCP Connectors
- QuallaaOAuthcom.quallaa
Talk to your public-facing AI from any MCP client — Claude, ChatGPT, Cursor, Cline, Windsurf.
MCP server for progressive tool usage at any scale (see https://klavis.ai)
MCP server for Clipkit — gives AI agents a video toolbox via the Clipkit schema.
Nifty's MCP server — exposes tasks, projects, messages, and files as tools for AI agents.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceTurns any shell command into an MCP server by defining command-line tools in simple YAML files. Enables AI agents to execute system commands, security scanners, DevOps tools, and CLI utilities directly from chat interfaces.4-
- AlicenseNot gradedqualityDmaintenanceAn MCP server that publishes CLI tools on your machine for discoverability by LLMs7 npm1MIT
- AlicenseNot gradedqualityDmaintenanceTurn any CLI tool into an MCP server by leveraging its --help output, enabling natural language interaction with tools like gh, az, git, etc.11 npm22MIT
- AlicenseNot gradedqualityBmaintenanceAutomatically converts any CLI built with Python's Typer into an MCP server without changing code. Gives AI agents instant access to thousands of CLI tools.AGPL 3.0