Skip to main content

mcp-cli

Call any MCP server tool as a CLI command with shell composition. Use when tool args come from files, pipes, or shell commands. Trigger on "mcp-call", "call mcp from cli", or when MCP tool content is in a file.

Quellinformationen

Repository
wise-toddler/mcp-cli-skill
Letzte Quellaktivität
19. Oktober 2026 um 01:29
Erkannte Sprache von SKILL.md
Englisch
Sterne
2
Forks
0

Installationsoptionen

Standardmäßig ist der Prompt ausgewählt, der zuerst die Quelle prüft. Sie können zu einem direkten Befehl wechseln oder eine lokale Kopie herunterladen.

Quelldateien prüfen

Lesen Sie SKILL.md und alle von SkillsMP angezeigten Begleitdateien, bevor Sie sich für eine Installation entscheiden.

SKILL.md wird angezeigt

SKILL.md
Quellanweisungen · Schreibgeschützte Vorschau
name
mcp-cli
description
Call any MCP server tool as a CLI command with shell composition. Use when tool args come from files, pipes, or shell commands. Trigger on "mcp-call", "call mcp from cli", or when MCP tool content is in a file.
# MCP CLI Call any configured MCP server tool from the command line with `--flag=value` style args and full shell composition support. If `mcp-call` is not found, install it first: `uv tool install mcp-cli-skill` Always use `mcp-call` as the command, never `uvx mcp-cli-skill`. ## Commands ```bash mcp-call --search <words> # find tools across ALL servers, with params (start here) mcp-call --servers # list configured servers mcp-call <server> --tools # list tools (human-readable; --list / --help work too) mcp-call <server> --discover # list tools as JSON with schemas (= --tools -o json) # --servers / --tools / --search all take -o table|json|name; name prints `server` or `server tool` mcp-call <server> <tool> --schema # show tool's input schema as JSON mcp-call <server> <tool> --key=value ... # call a tool mcp-call <server> <tool> --input-json '{"key":"val"}' # call with JSON args echo '{}' | mcp-call <server> <tool> # call with stdin JSON mcp-call --add <name> <cmd> [args] [--env K=V ...] # add stdio server mcp-call --add-http <name> <url> [--header 'K: V' ...] # add HTTP server (auth via --header/-H) mcp-call --remove <name> # remove server mcp-call --login <name> [--no-browser] # OAuth browser login (the user runs this, not you) mcp-call --logout <name> # forget stored OAuth tokens mcp-call --sync # re-sync from Claude configs mcp-call --completion <bash|zsh|fish> # print shell completion hook mcp-call --refresh-completions # cache tool lists for tab completion mcp-call --clear-cache [server] # bust the completion cache ``` ## Server Management Config stored at `~/.mcp-cli/servers.json`. On first run, seeds from `~/.claude/settings.json` and `~/.claude.json`. Supports both stdio and HTTP MCP servers. ```bash mcp-call --add myredash uvx redash-mcp --env REDASH_URL=http://localhost --env REDASH_API_KEY=abc123 mcp-call --add github npx @modelcontextprotocol/server-github --env GITHUB_TOKEN=ghp_xxx mcp-call --remove myredash mcp-call --sync ``` Don't know which server has the tool you need? Run `mcp-call --search <words>` first: it searches every server's tool names and descriptions from a local cache in one call (name matches listed first, exit 1 if nothing matches), so you don't have to run `--tools` on each server. Each hit shows its params (`*` = required), so you can usually call the tool right away without `--help`. Read the default table and pick the server yourself: when the same tool is on several servers (e.g. `emergent-work` and `emergent-personal` are different accounts), never just take the first hit. `-o json` is there for jq. An unknown option or tool name exits 2 with a "Did you mean" hint and is never sent to the server — use the hint instead of guessing another name. If a call exits 4 with "needs interactive browser login", ask the user to run the `mcp-call --login <name>` command it prints; don't run it yourself. ## Examples ```bash mcp-call redash redash_query --action=adhoc --query="$(cat /tmp/query.sql)" --data_source_id=1 mcp-call redash redash_query --action=list --page_size=5 | jq '.results[].name' mcp-call slack slack_chat --action=post --channel=C123 --text="$(cat /tmp/msg.txt)" mcp-call redash redash_query --action=run --id=42 | jq '.query_result.data.rows' > /tmp/result.json ``` ## Multi-tool Workflow When you need to chain multiple MCP tools together, generate a bash script and run it: ```bash #!/bin/bash # Fetch github issues, search code, post to slack # 1. Fetch open bugs mcp-call github list_issues \ --owner=acme --repo=backend --state=open --labels=bug \ | jq '.[] | {number, title}' > /tmp/bugs.json # 2. Search for related code for title in $(jq -r '.[].title' /tmp/bugs.json | head -5); do mcp-call github search_code --query="$title repo:acme/backend" | jq '.items[:2]' done > /tmp/code_matches.txt # 3. Post summary to slack mcp-call slack send_message \ --channel="#engineering" \ --text="$(jq -r '.[] | "• #\(.number): \(.title)"' /tmp/bugs.json)" ``` This is better than making separate MCP tool calls because you get file I/O, pipes, loops, and variable expansion for free. ## When to Use Prefer this over MCP tool calls when: - Content comes from a file: `--arg="$(cat file)"` - Output needs piping: `| jq`, `> file`, `| grep` - Shell variable expansion needed: `--arg="$VAR"` - Chaining multiple calls in one command ## Arg Types Values auto-parse: `--id=42` → int, `--flag=true` → bool, `--name=hello` → string. ## Colliding param names If a tool has a param named `help`, `schema`, or `input-json` (which clash with mcp-call's own flags), pass it after `--`: ```bash mcp-call srv tool --id=5 -- --help=true --schema=foo # everything after -- goes to the tool verbatim ```
Auf GitHub ansehen