urfave-cli
Expose https://github.com/urfave/cli app as an MCP server
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)
- Install Docker on your system.
- Pull and run the MCP image: docker run -d --name urfave-cli-mcp -p 6000:6000 thepwagner/urfave-cli-mcp:latest
- Ensure the container starts correctly and listens on the MCP port (default 6000).
Option B: Build from source (Go required)
- Install Go (1.17+ preferred).
- Clone the repository: git clone https://github.com/thepwagner/urfave-cli-mcp.git
- Build the server: cd urfave-cli-mcp go build ./...
- Run the server locally (adjust as needed to point to your app if required by build): ./urfave-cli-mcp
- 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
mcp-language
mcp-language-server gives MCP enabled clients access semantic tools like get definition, references, rename, and diagnostics.
ophis
Transform any Cobra CLI into an MCP server
mcpshim
Turn remote MCP servers into local command workflows.
mcp-tidy
CLI tool to visualize and manage MCP server configurations in Claude Code. List servers, analyze usage statistics, and clean up unused servers
slackbot -host
MCP Host as a Slack Bot
WisAI
Agentic AI Orchestrator and coding agent for business-as-code platforms, services, and data. Focused on streamlining development for startups and small business who want to own their own cloud.