Get the FREE Ultimate OpenClaw Setup Guide →

any-cli

Convert any (whatever) CLI to proper MCP server with tools mapped based on CLI help

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
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:

  1. 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
  2. Verify installation:
    • any-cli-mcp-server --version
  3. Run an example with npx (as shown in Quick Start):
    • npx any-cli-mcp-server gh
  4. 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

Sponsor this space

Reach thousands of developers