mcp-cli
github/awesome-copilot
CLI interface to discover and call MCP servers and tools from the command line.
What is mcp-cli?
mcp-cli provides command-line access to Model Context Protocol (MCP) servers, enabling you to discover available tools, inspect their schemas, and execute them directly. Use it when you need to interact with external systems like filesystems, APIs, or databases through MCP without writing custom code.
- List all available MCP servers and their tools
- Explore tool parameters and JSON input schemas
- Execute MCP tools with JSON arguments from the CLI
- Search and filter tools by name using glob patterns
- Output results as JSON for scripting and piping
- Include tool descriptions for better understanding
How to install mcp-cli
npx skills add https://github.com/github/awesome-copilot --skill mcp-cli- Node.js and npm installed
- MCP servers configured and running in your environment
How to use mcp-cli
- 1.Run `mcp-cli` to list all available servers and tools
- 2.Run `mcp-cli <server>` to see tools and their parameters for a specific server
- 3.Run `mcp-cli <server>/<tool>` to view the full JSON input schema for a tool
- 4.Run `mcp-cli <server>/<tool> '<json>'` to execute a tool with arguments
- 5.Use `mcp-cli grep "<glob>"` to search for tools by name pattern
- 6.Add `-d` flag to any command to include tool descriptions in output
- 7.Use `--json` flag to output results as JSON for parsing by other tools
Use cases
- Discover what MCP servers and tools are available in your environment
- Read files or query data sources through filesystem or database MCP servers
- Chain multiple MCP tool calls together using pipes and command substitution
- Debug MCP tool schemas before integrating them into agent workflows
- Automate data extraction by piping MCP output to jq or other CLI tools
- Developers integrating MCP servers into workflows
- DevOps engineers automating tool interactions
- AI agent developers testing MCP tool availability
- Command-line users exploring external data sources
mcp-cli FAQ
Run `mcp-cli` with no arguments to list all servers and their tool names.
Use a heredoc (`<<EOF`) or pipe from a file: `cat args.json | mcp-cli server/tool` to avoid shell quoting issues.
Exit code 0 is success, 1 is a client error (bad args/config), 2 is a server error (tool failed), and 3 is a network error.
Yes, use the `--json` flag to get JSON output suitable for parsing with jq or other tools.
Use `mcp-cli grep "<glob>"` to search tools by name pattern, e.g., `mcp-cli grep "*file*"`.
Full instructions (SKILL.md)
Source of truth, from github/awesome-copilot.
name: mcp-cli 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.
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 tool names |
mcp-cli <server> | Show tools with parameters |
mcp-cli <server>/<tool> | Get tool JSON schema |
mcp-cli <server>/<tool> '<json>' | Call tool with arguments |
mcp-cli grep "<glob>" | Search tools by name |
Add -d to include descriptions (e.g., mcp-cli filesystem -d)
Workflow
- Discover:
mcp-cli→ see available servers and tools - Explore:
mcp-cli <server>→ see tools with parameters - Inspect:
mcp-cli <server>/<tool>→ get full JSON input schema - Execute:
mcp-cli <server>/<tool> '<json>'→ run with arguments
Examples
# List all servers and tool names
mcp-cli
# See all tools with parameters
mcp-cli filesystem
# With descriptions (more verbose)
mcp-cli filesystem -d
# Get JSON schema for specific tool
mcp-cli filesystem/read_file
# Call the tool
mcp-cli filesystem/read_file '{"path": "./README.md"}'
# Search for tools
mcp-cli grep "*file*"
# JSON output for parsing
mcp-cli filesystem/read_file '{"path": "./README.md"}' --json
# Complex JSON with quotes (use heredoc or stdin)
mcp-cli server/tool <<EOF
{"content": "Text with 'quotes' inside"}
EOF
# Or pipe from a file/command
cat args.json | mcp-cli server/tool
# Find all TypeScript files and read the first one
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\": \"{}\"}"'
Options
| Flag | Purpose |
|---|---|
-j, --json | JSON output for scripting |
-r, --raw | Raw text content |
-d | Include descriptions |
Exit Codes
0: Success1: Client error (bad args, missing config)2: Server error (tool failed)3: Network error
Related skills
More from github/awesome-copilot and the wider catalog.
git-commit
Execute semantic git commits with conventional message analysis and intelligent staging.
excalidraw-diagram-generator
Generate Excalidraw diagrams from natural language descriptions.
documentation-writer
Create structured technical documentation using the Diátaxis framework for tutorials, how-to guides, references, and explanations.
gh-cli
GitHub CLI comprehensive reference for repositories, issues, PRs, Actions, projects, releases, and all GitHub operations from the command line.
prd
Generate comprehensive Product Requirements Documents with executive summaries, user stories, technical specs, and risk analysis.
refactor
Surgical code refactoring to improve maintainability without changing behavior.