MCP CLI

MCP CLI

Teaches an agent to discover and call MCP server tools from the command line with mcp-cli: list servers, inspect schemas and run tools with JSON arguments.

Skill files1 file
SKILL.md79 lines
1
---
2
name: mcp-cli
3
description: 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, list available MCP servers/tools, or call MCP tools from command line.
4
---
5
6
# MCP-CLI
7
8
Access MCP servers through the command line. MCP enables interaction with external systems like GitHub, filesystems, databases, and APIs.
9
10
## Commands
11
12
| Command | Output |
13
| ---------------------------------- | ------------------------------- |
14
| `mcp-cli` | List all servers and tool names |
15
| `mcp-cli <server>` | Show tools with parameters |
16
| `mcp-cli <server>/<tool>` | Get tool JSON schema |
17
| `mcp-cli <server>/<tool> '<json>'` | Call tool with arguments |
18
| `mcp-cli grep "<glob>"` | Search tools by name |
19
20
**Add `-d` to include descriptions** (e.g., `mcp-cli filesystem -d`)
21
22
## Workflow
23
24
1. **Discover**: `mcp-cli` → see available servers and tools
25
2. **Explore**: `mcp-cli <server>` → see tools with parameters
26
3. **Inspect**: `mcp-cli <server>/<tool>` → get full JSON input schema
27
4. **Execute**: `mcp-cli <server>/<tool> '<json>'` → run with arguments
28
29
## Examples
30
31
```bash
32
# List all servers and tool names
33
mcp-cli
34
35
# See all tools with parameters
36
mcp-cli filesystem
37
38
# With descriptions (more verbose)
39
mcp-cli filesystem -d
40
41
# Get JSON schema for specific tool
42
mcp-cli filesystem/read_file
43
44
# Call the tool
45
mcp-cli filesystem/read_file '{"path": "./README.md"}'
46
47
# Search for tools
48
mcp-cli grep "*file*"
49
50
# JSON output for parsing
51
mcp-cli filesystem/read_file '{"path": "./README.md"}' --json
52
53
# Complex JSON with quotes (use heredoc or stdin)
54
mcp-cli server/tool <<EOF
55
{"content": "Text with 'quotes' inside"}
56
EOF
57
58
# Or pipe from a file/command
59
cat args.json | mcp-cli server/tool
60
61
# Find all TypeScript files and read the first one
62
mcp-cli filesystem/search_files '{"path": "src/", "pattern": "*.ts"}' --json | jq -r '.content[0].text' | head -1 | xargs -I {} sh -c 'mcp-cli filesystem/read_file "{\"path\": \"{}\"}"'
63
```
64
65
## Options
66
67
| Flag | Purpose |
68
| ------------ | ------------------------- |
69
| `-j, --json` | JSON output for scripting |
70
| `-r, --raw` | Raw text content |
71
| `-d` | Include descriptions |
72
73
## Exit Codes
74
75
- `0`: Success
76
- `1`: Client error (bad args, missing config)
77
- `2`: Server error (tool failed)
78
- `3`: Network error
79

© GitHub, Inc. · MIT · source · posted by @OpenSourceBuffGuy on promptparty.com

@OpenSourceBuffGuy

I find openly licensed prompts and post them here.

0 followers · 14,621 prompts

More by @OpenSourceBuffGuy

See all
Sea turtle carrying floating film studio island prompt image

Sea turtle carrying floating film studio island

Draws a giant sea turtle carrying a floating island film studio through a starry sky, where fairies polish rough film strips into golden film.

image-prompt, nano-banana, 3d-render, cartoon, fantasy-world, creatures, animals, whimsical, dreamy, cinematic, dramatic-lighting, vibrant-colors, bokeh, miniature, widescreen, night-scene, illustration, concept-art, surreal, storytelling, clay-3d

Desert buggy escapes drones past industrial outpost prompt image

Desert buggy escapes drones past industrial outpost

Builds a 15-second desert chase video where a racer in an armored buggy escapes drones past an industrial outpost, using five reference images with set jobs.

video-prompt, hailuo, action, multi-shot, timed-beats, camera-movement, reference-image, character-consistency, negative-prompt, cinematic, sci-fi, cars, landscape, aerial-view, tracking-shot, photorealistic, sound-effects, structured-output, long-form, widescreen

1 view
Cozy Pixel Art Farm Island Village prompt image

Cozy Pixel Art Farm Island Village

Draws a cozy 16-bit pixel-art farming village across six small islands joined by bridges, with exact counts for buildings, animals and crops.

image-prompt, gpt-image, pixel-art, isometric, game-assets, concept-art, maps, worldbuilding, cozy, vibrant-colors, ocean, landscape, wide-shot, widescreen, game-development, video-games, structured-output, whimsical, summer, high-angle, aerial-view, animals, negative-prompt, cityscape

1 view

Reviews

Loading reviews…

Discussion

Loading comments…