Skip to main content

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.

소스 정보

저장소
philschmid/mcp-cli
최근 소스 활동
2026년 2월 5일 18:31
감지된 SKILL.md 언어
영어
스타
1,279
포크
162

설치 방법

기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.

소스 파일 검토

설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.

SKILL.md 표시 중

SKILL.md
소스 지침 · 읽기 전용 미리보기
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.
# 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 1. **Discover**: `mcp-cli` → see available servers 2. **Explore**: `mcp-cli info <server>` → see tools with parameters 3. **Inspect**: `mcp-cli info <server> <tool>` → get full JSON schema 4. **Execute**: `mcp-cli call <server> <tool> '<json>'` → run with arguments ## Examples ```bash # 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 ```bash # 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`: Success - `1`: Client error (bad args, missing config) - `2`: Server error (tool failed) - `3`: Network error
GitHub에서 보기