Get the FREE Ultimate OpenClaw Setup Guide →

urfave-cli

Expose https://github.com/urfave/cli app as an MCP server

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio thepwagner-urfave-cli-mcp docker run -i thepwagner/urfave-cli-mcp \
  --env MCP_PORT="6000 (optional: MCP server port, if applicable in image)" \
  --env MCP_LOG_LEVEL="info (optional: set to debug for verbose logs)"

How to use

This MCP server reuses an urfave/cli application by exposing its command tree as MCP tools. Each subcommand defined under the root CLI becomes an MCP tool that can be invoked remotely, with flags and default values preserved. Tools are executed by forking the current process and returning stdout as the tool's result, allowing you to reuse query-only CLIs as a remote service. To use, deploy the server image and connect an MCP client to the exposed server; the client will discover the available subcommands and parameters and pass them through to the underlying CLI as if you were running it locally.

From a high level, you start the container (or run the server) and then issue MCP tool invocations that target specific subcommands of your urfave/cli app. Each tool inherits the flags defined in the CLI, including default values and whether flags are required. The server handles argument construction, executes the CLI tool in-process, and streams the resulting stdout back to the client as the MCP tool output.

How to install

Prerequisites:

  • Docker (for containerized deployment) or Go toolchain (for building from source)
  • Internet access to fetch dependencies

Option A: Run via Docker (recommended for quick setup)

  1. Install Docker on your system.
  2. Pull and run the MCP image: docker run -d --name urfave-cli-mcp -p 6000:6000 thepwagner/urfave-cli-mcp:latest
  3. Ensure the container starts correctly and listens on the MCP port (default 6000).

Option B: Build from source (Go required)

  1. Install Go (1.17+ preferred).
  2. Clone the repository: git clone https://github.com/thepwagner/urfave-cli-mcp.git
  3. Build the server: cd urfave-cli-mcp go build ./...
  4. Run the server locally (adjust as needed to point to your app if required by build): ./urfave-cli-mcp
  5. If your application is in a separate binary, ensure the mcp server is configured to expose its commands via the MCP interface.

Notes:

  • The exact image name or build tags may vary; consult the repository for latest release details.
  • If you customize flags or environment, ensure the MCP server environment matches your CLI expectations.

Additional notes

Tips and common considerations:

  • The server exposes urfave/cli subcommands as MCP tools; if you add new commands or flags to your CLI, rebuild or redeploy the MCP server to reflect the changes.
  • Flags with default values will be surfaced to the MCP client; required flags must be provided by the client when invoking a tool.
  • You can enable verbose logging by setting MCP_LOG_LEVEL to debug if troubleshooting is needed.
  • If your underlying CLI prints non-deterministic output (timestamps, progress bars), consider adjusting the CLI to output stable stdout suitable for MCP results.
  • Ensure network accessibility between the MCP client and the server, especially when using Docker or containerized deployments.
  • If you rename the root command or restructure the CLI, the MCP tool discovery may need adjustments to reflect the new command tree.

Related MCP Servers

Sponsor this space

Reach thousands of developers