Fire in da houseTop Tip:Paying $100+ per month for Perplexity, MidJourney, Runway, ChatGPT and other tools is crazy - get all your AI tools in one site starting at $15 per month with Galaxy AI Fire in da houseCheck it out free

cli-mcp

MCP.Pizza Chef: mlaugharn

cli-mcp is an MCP server that bridges command-line interfaces (CLIs) with the Model Context Protocol, enabling LLMs to interact with arbitrary CLI tools in a structured way. It uses a custom cli:// URI scheme to access CLI resources, each with a name, help menu subtree, and text/plain mimetype. The server supports commands to add CLI definitions, retrieve help subtrees, and run known commands, updating server state and notifying clients of changes. This allows developers to integrate CLI tools into AI workflows, enhancing automation and real-time command execution within MCP-enabled environments.

Use This MCP server To

Integrate CLI tools into AI workflows Run CLI commands via LLMs in real-time Parse and expose CLI help menus as structured data Notify clients of CLI resource updates Access CLI resources using custom URI scheme

README

cli MCP server

cli bridge

image

Pretty much a remix of the demo notes app.

Components

Resources

The server implements a simple system for working with arbitrary clis with:

  • Custom cli:// URI scheme for accessing individual notes
  • Each cli resource has a name, help menu subtree, and text/plain mimetype

Tools

The server implements one tool:

  • add (cmd): Recursively parses cli help menu subtrees and stores definition
    • Takes "cmd"
    • Updates server state and notifies clients of resource changes
  • help (cmd): Return subtrees definition
  • run (cmd, cmd_args | None): Run a known command

Quickstart

Install

Claude Desktop

Note: I had to use /opt/homebrew/bin/uv instead of just uv in the command field in this json:

On MacOS: ~/Library/Application\ Support/Claude/claude_desktop_config.json

On Windows: %APPDATA%/Claude/claude_desktop_config.json

{"mcpServers": {
  "cli": {
    "command": "uv",
    "args": [
      "run",
      "--directory",
      "\<path to repo folder\>",
      "cli"
    ]}
  }
}

By design, you have to explicitly 'add' a command before it can be run.

Debugging

Since MCP servers run over stdio, debugging can be challenging. For the best debugging experience, we strongly recommend using the MCP Inspector.

You can launch the MCP Inspector via npm with this command:

npx @modelcontextprotocol/inspector uv --directory <path to repo> run cli

Upon launching, the Inspector will display a URL that you can access in your browser to begin debugging.

cli-mcp FAQ

How do I install cli-mcp on MacOS?
On MacOS, update the Claude Desktop config at ~/Library/Application Support/Claude/claude_desktop_config.json, using the full path to uv like /opt/homebrew/bin/uv.
What is the cli:// URI scheme used for?
The cli:// URI scheme uniquely identifies CLI resources, allowing structured access to individual commands and their help menus within the MCP framework.
How does cli-mcp handle CLI help menus?
cli-mcp recursively parses CLI help menu subtrees using the 'add' command and stores their definitions for easy retrieval and execution.
Can cli-mcp run arbitrary CLI commands?
Yes, cli-mcp can run known commands with optional arguments via the 'run' command, enabling real-time CLI interaction through the MCP client.
How does cli-mcp notify clients of changes?
When CLI resources are updated, cli-mcp updates its server state and notifies connected clients to keep context in sync.
Is cli-mcp limited to specific CLI tools?
No, cli-mcp is designed to work with arbitrary CLI tools by parsing their help menus and exposing them over MCP.
What MIME type does cli-mcp use for CLI resources?
cli-mcp uses the text/plain MIME type for CLI resources to represent command definitions and help text.
Can cli-mcp be used with multiple LLM providers?
Yes, cli-mcp works with MCP clients that can connect to models from OpenAI, Claude, Gemini, and others.