Convert an MCP server to CLI tools (runs in subagent)
Converts MCP servers into standalone CLI tools with automatic tool discovery and wrapper generation.
/plugin marketplace add nicobailon/mcp2cli-plugin/plugin install nicobailon-mcp2cli@nicobailon/mcp2cli-plugin<mcp-package>Spawn a subagent to convert the specified MCP server into standalone Bash-invokable scripts.
Package: $ARGUMENTS
Use the Task tool to spawn a subagent:
Task(
subagent_type: "general-purpose",
description: "Convert MCP server to CLI tools",
prompt: <full prompt below with $ARGUMENTS substituted>
)
Convert the MCP server "$ARGUMENTS" into standalone CLI tools.
Step 1 - Derive names:
Step 2 - Fetch description (parallel with discovery):
curl -s "https://registry.npmjs.org/<pkg>" | jq -r '.readme // .description'curl -s "https://pypi.org/pypi/<pkg>/json" | jq -r '.info.description // .info.summary'Step 3 - Discover tools (auto-fallback):
# Try npm first
npx mcporter list --stdio "npx -y <pkg>@latest" --name <server> --schema --json
# If npm fails, try uvx (Python)
npx mcporter list --stdio "uvx <pkg>" --name <server> --schema --json
Step 4 - Group tools: Max 5-6 per wrapper, dedicated for complex tools
Step 5 - Generate wrappers: Node.js ES modules with:
Step 6 - Write to ~/agent-tools/<server>/ and symlink:
# Use ~/agent-tools/bin if ~/agent-tools/ exists, otherwise ~/.local/bin
if [ -d ~/agent-tools ]; then
BIN_DIR=~/agent-tools/bin
else
BIN_DIR=~/.local/bin
fi
mkdir -p "$BIN_DIR"
for f in ~/agent-tools/<server>/*.js; do
ln -sf "$f" "$BIN_DIR/$(basename "$f" .js)"
done
Step 7 - Register to ~/.claude/CLAUDE.md:
### <Server Name>
<fetched description>
Usage:
```bash
<server>-<tool1> --help
<server>-<tool2> --param "value"
Full docs: ~/agent-tools/<server>/README.md
(Use actual generated filenames in registration)
**Report:** source (npm/PyPI), description, tools count, wrappers, symlinks created, CLAUDE.md confirmation.