MCPX: MCP servers as composable CLI commands for shell-first agents
Suggested by runchr · today
Draft — a suggested stack, not yet verified by a member.
Author built a CLI that exposes any MCP server as Unix-pipeable commands.
What they did
The author built MCPX, a Go-based CLI that wraps MCP servers and exposes them as ordinary shell commands. The core idea is that agents which are shell-first (the author cites OpenClaw as the motivating case) can invoke `mcpx` like any other binary and immediately use MCP servers, without OpenClaw itself having to implement MCP transport or auth plumbing. The same command contract is meant to fit Codex Apps mode, where connected apps are exposed as MCP servers. The command contract is deliberately shallow: `mcpx` alone, `mcpx <server>`, and `mcpx <server> <tool>`. Design choices include schema-aware `--help` that lists inputs and declared outputs, a native flag surface generated from each tool's MCP `inputSchema`, pass-through of tool output so it composes with `jq`, `head`, and pipes, explicit exit-code mapping (0/1/2/3), support for both stdio and HTTP servers, optional caching, and an `mcpx add` command that bootstraps server config from install links, manifests, or endpoints. Example invocations in the post: `mcpx github search-repositories --help`, `mcpx github search-repositories --query=mcp`, and piping JSON in via `echo '{"query":"mcp"}' | mcpx github search-repositories`. Distribution is via a Homebrew tap/cask, `npm i -g mcpx-go`, and `pip install mcpx-go`. The author asked HN for feedback on command UX, schema/flag edge cases, and where the tool should stop versus expand.
How it went
Shipped as a public Show HN with a working repo, three install paths (Homebrew, npm, pip), and documented examples. The author framed it as functional but explicitly seeking feedback on UX and schema edge cases, implying the flag-generation and help surface are the areas most likely to need polish. No benchmark or adoption numbers were shared.
Worth knowing
The post is a launch announcement, not a usage report, so there is no evidence of real agent runs beyond the author's own OpenClaw workflow. Auth handling for remote MCP servers is asserted but not detailed. Exit-code semantics (0/1/2/3) are stated without a mapping table. The npm and pip packages are named `mcpx-go`, which may confuse users expecting a native package name. Schema-to-flag conversion has known hard cases (nested objects, unions, arrays) that the author flags as open questions.
Wiring
Install MCPX globally (Homebrew cask, npm, or pip). Register each MCP server with `mcpx add`, pointing at an install link, manifest, or endpoint; this writes server config that MCPX reads on subsequent calls. MCPX then connects over stdio or HTTP, fetches the server's tool list and each tool's `inputSchema`, and generates a CLI surface: `mcpx <server> <tool>` with flags derived from schema properties, plus schema-aware `--help`. Tool output is passed through unmodified to stdout so it composes with `jq`, `head`, and pipes; JSON can also be piped in on stdin as an alternative to flags. Exit codes map to 0/1/2/3 for success and failure classes. Optional caching reduces repeated schema or tool fetches. Agents like OpenClaw or Codex Apps mode invoke `mcpx` as a subprocess, so no MCP client library is needed in the agent itself.
Try it yourself
Set up MCPX in this repo so a shell-first agent can call MCP tools as plain commands. Steps: (1) install via `brew tap lydakis/mcpx && brew install --cask mcpx` or `npm i -g mcpx-go`; (2) run `mcpx add` with the install link or endpoint for the MCP server this project needs, and commit the resulting config; (3) verify with `mcpx <server> --help` and `mcpx <server> <tool> --help` that the flag surface matches the tool's inputSchema; (4) run one real call, e.g. `mcpx <server> <tool> --<arg>=<value>`, and confirm output pipes cleanly into `jq`; (5) check exit codes for success, tool error, and bad args; (6) write a short README section showing the exact commands an agent should run, and note any schema edge cases (nested objects, arrays, unions) that did not map to flags cleanly.
Tools in this stack
Run this stack
Install the stack into this project. It writes AGENTS.md and the manifest, merges the MCP servers into .mcp.json, and — with --yes — runs the tool installs.
npx runchr install runchr/show-hn-mcpx-turn-any-mcp-server-into-a-composable-cli-fcurl -s https://api.runchr.com/api/recipes/runchr/show-hn-mcpx-turn-any-mcp-server-into-a-composable-cli-f/manifestSystem prompt
You are a shell-first coding agent that uses MCPX to call MCP servers as ordinary CLI commands. Work through the shell: install and register servers with `mcpx`, discover each tool's flag surface via schema-aware `--help`, and run real calls whose JSON output pipes cleanly into `jq` and other Unix tools.
This system prompt was generated from this stack's copy and tools. A person has not reviewed it.
The manifest is also at api.runchr.com/api/recipes/runchr/show-hn-mcpx-turn-any-mcp-server-into-a-composable-cli-f/manifest.