any-cli
Convert any (whatever) CLI to proper MCP server with tools mapped based on CLI help
claude mcp add --transport stdio eirikb-any-cli-mcp-server npx -y any-cli-mcp-server az
How to use
any-cli-mcp-server turns any CLI tool that supports a --help output into an MCP server. It leverages the CLI's built-in help to expose a stable MCP-compatible interface for commands like gh, az, git, or any other tool that prints actionable help text. You can start multiple MCP endpoints (e.g., gh, az, or a cached git workflow) from a single setup. Once running, clients can interact with these MCP endpoints to explore, test, and chain CLI commands in an MCP-friendly manner. The server uses the CLI’s own --help output to drive the available commands and arguments, so you get a familiar experience tailored to the specific tool you expose.
How to install
Prerequisites:
- Node.js 18+ installed on your system
- npm or yarn available
- Internet connection to install the MCP server package
Installation steps:
- Install the MCP server package globally or in your project:
- npm i -g any-cli-mcp-server
- or as a devDependency: npm i -D any-cli-mcp-server
- Verify installation:
- any-cli-mcp-server --version
- Run an example with npx (as shown in Quick Start):
- npx any-cli-mcp-server gh
- If you plan to host multiple CLIs, configure them in your app’s configuration (see the mcp_config example in README):
- Use npx with -y to install and run the specific CLI adapter (e.g., gh, az, git) through the MCP server.
Notes:
- The server relies on each target CLI exposing a usable --help output. If a CLI requires additional flags for help, configure those in your startup command accordingly.
- For performance, you can build a cache as demonstrated in the documentation to speed up startup times.
Additional notes
Tips and common issues:
- If a CLI tool frequently updates, consider regenerating any caches or reconfiguring the server to ensure the help output remains accurate.
- Use the provided cache-build and cache usage flow to optimize startup time for frequently used CLIs.
- Ensure your terminal environment supports the CLI's interactive prompts if the underlying tool uses them; MCP is designed to work with non-interactive help-driven usage.
- The configuration can be extended to include more servers by adding additional entries under mcpServers with the same structure.
- If you run into permission or PATH issues, preferring npx with -y helps ensure consistent installation behavior across environments.
Related MCP Servers
iterm
A Model Context Protocol server that executes commands in the current iTerm session - useful for REPL and CLI assistance
mcp
Octopus Deploy Official MCP Server
furi
CLI & API for MCP management
editor
MCP Server for Phaser Editor
DoorDash
MCP server from JordanDalton/DoorDash-MCP-Server
mcp
MCP сервер для автоматического создания и развертывания приложений в Timeweb Cloud