mcp-cli
Interface for MCP (Model Context Protocol) servers via CLI. Use when you need to interact with external tools, APIs, or data sources through MCP servers.
Install
npx skills add https://github.com/philschmid/mcp-cli --skill mcp-cliSKILL.md
MCP-CLI
Access MCP servers through the command line. MCP enables interaction with external systems like GitHub, filesystems, databases, and APIs.
Commands
| Command | Output |
|---|---|
mcp-cli |
List all servers and tools |
mcp-cli info <server> |
Show server tools and parameters |
mcp-cli info <server> <tool> |
Get tool JSON schema |
mcp-cli grep "<pattern>" |
Search tools by name |
mcp-cli call <server> <tool> |
Call tool (reads JSON from stdin if no args) |
mcp-cli call <server> <tool> '<json>' |
Call tool with arguments |
Both formats work: <server> <tool> or <server>/<tool>
Workflow
- Discover:
mcp-cli→ see available servers - Explore:
mcp-cli info <server>→ see tools with parameters - Inspect:
mcp-cli info <server> <tool>→ get full JSON schema - Execute:
mcp-cli call <server> <tool> '<json>'→ run with arguments
Examples
# List all servers
mcp-cli
# With descriptions
mcp-cli -d
# See server tools
mcp-cli info filesystem
# Get tool schema (both formats work)
mcp-cli info filesystem read_file
mcp-cli info filesystem/read_file
# Call tool
mcp-cli call filesystem read_file '{"path": "./README.md"}'
# Pipe from stdin (no '-' needed!)
cat args.json | mcp-cli call filesystem read_file
# Search for tools
mcp-cli grep "*file*"
# Output is raw text (pipe-friendly)
mcp-cli call filesystem read_file '{"path": "./file"}' | head -10
Advanced Chaining
# Chain: search files → read first match
mcp-cli call filesystem search_files '{"path": ".", "pattern": "*.md"}' \
| head -1 \
| xargs -I {} mcp-cli call filesystem read_file '{"path": "{}"}'
# Loop: process multiple files
mcp-cli call filesystem list_directory '{"path": "./src"}' \
| while read f; do mcp-cli call filesystem read_file "{\"path\": \"$f\"}"; done
# Conditional: check before reading
mcp-cli call filesystem list_directory '{"path": "."}' \
| grep -q "README" \
&& mcp-cli call filesystem read_file '{"path": "./README.md"}'
# Multi-server aggregation
{
mcp-cli call github search_repositories '{"query": "mcp", "per_page": 3}'
mcp-cli call filesystem list_directory '{"path": "."}'
}
# Save to file
mcp-cli call github get_file_contents '{"owner": "x", "repo": "y", "path": "z"}' > output.txt
Note: call outputs raw text content directly (no jq needed for text extraction)
Options
| Flag | Purpose |
|---|---|
-d |
Include descriptions |
-c <path> |
Specify config file |
Common Errors
| Wrong Command | Error | Fix |
|---|---|---|
mcp-cli server tool |
AMBIGUOUS_COMMAND | Use call server tool or info server tool |
mcp-cli run server tool |
UNKNOWN_SUBCOMMAND | Use call instead of run |
mcp-cli list |
UNKNOWN_SUBCOMMAND | Use info instead of list |
mcp-cli call server |
MISSING_ARGUMENT | Add tool name |
mcp-cli call server tool {bad} |
INVALID_JSON | Use valid JSON with quotes |
Exit Codes
0: Success1: Client error (bad args, missing config)2: Server error (tool failed)3: Network error
Related skills
find-skillsvercel-labs3.6MHelps users discover and install agent skills when they ask questions like "how do I do X", "find a skill for X", "is there a skill that can...", or express interest in extending capabilities. This skill should be used when the user is looking for functionality that might exist as an installable skill.handoffmattpocock883KCompact the current conversation into a handoff document for another agent to pick up.microsoft-foundrymicrosoft618KBuild, deploy, evaluate, optimize, fine-tune, and manage Microsoft Foundry agents, models, and resources end to end. USE FOR: foundry, azd ai agent, azd provision/deploy, hosted agent scaffold/develop/run/deploy/troubleshoot, prompt agent create, create agent, update agent, add tool to agent, invoke agent, agent.yaml, agent insights, pull agent insights, evaluate agent, batch eval, continuous eval, continuous monitoring, agent CI/CD, optimize prompt, improve prompt, prompt optimizer, optimize agcavemanjuliusbrussee544KUltra-compressed communication mode that cuts output tokens while keeping technical accuracy. Levels: lite, full, ultra and the wenyan variants. Use for /caveman, "caveman mode", "talk like caveman", "be brief" or "less tokens".