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