
philschmid/mcp-cli
Developer toolsこのページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。 原文を見る
MCPサーバーとやり取りするための軽量CLIです
概要
MCP(モデルコンテキストプロトコル)サーバーとやり取りするための軽量でBunベースのCLIです。 - 🪶 - 依存関係が最小限で、起動が速い - 📦 - bunビルドによるスタンドアロン実行ファイルへのコンパイル -- コンパイル - 🔧 - 呼び出し用のJSON出力、jqパイプ、チェインサポート - 🤖 - AIコーディングエージェント向けに設計(Gemini CLI、Claude Codeなど) - 🔌 StdioおよびHTTP MCPサーバーの両方をサポート - ⚡ - レイジースポーンデーモンが接続をウォーム化(60秒のアイドルタイムアウト)を保つ - - config 📋を通じてサーバーごとに特定のツールを許可/無効化- - MCPサーバー命令を出力💡に表示- - 利用可能なサーバーと回復提案を含む構造化エラーメッセージ 現在のディレクトリや ~/.config/mcp/ でmcp_servers.jsonを作成してください: 説明を含めるために任意のコマンドに -d を加えます。 シングルクォート、特殊文字、または長いテキストを含むJSON引数の場合、シェルのエスケープ問題を避けるために以下をご利用ください: {}、引用符、特殊文字のシェル解釈は慎重な脱出が必要です。Stdinはシェル解析を完全にバイパスします。
概要(AI 翻訳)
MCP(モデルコンテキストプロトコル)サーバーとやり取りするための軽量でBunベースのCLIです。
特徴
- 🪶 軽量 - 依存関係が最小限で、起動が速い
- 📦 シングルバイナリ - [[T0]経由でスタンドアロン実行ファイルにコンパイル
- 🔧 Shell-Friendly - JSON出力(呼び出し、
jq]パイプ)、チェインサポート - 🤖 Agent-Optimized - AIコーディングエージェント向けに設計されています(Gemini CLI、Claude Codeなど)
- 🔌 ユニバーサル - スタンディオサーバーとHTTP MCPサーバーの両方をサポートします
- ⚡ 接続プーリング - レイジースポーンデーモンが接続を温かく保つ(60秒のアイドルタイムアウト)
- ツールフィルタリング - 設定を通じてサーバーごとに特定のツールを許可/無効化
- 📋 サーバー命令 - MCPサーバー命令を出力に表示
- 💡 実行可能なエラー - 利用可能なサーバーと復元提案を含む構造化されたエラーメッセージ
クイックスタート
1.設置
または
2.設定ファイルを作成する
現在のディレクトリまたは~/.config/mcp/にmcp_servers.jsonを作成してください:
3.利用可能なツールを発見
4.ツールを呼んでください
使用法
両方のフォーマットで動作します: info または info /
[!ヒント] 記述を含めるために任意のコマンドに
-dを追加します。
オプション
| オプション | 説明 |
|---|
このページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。
README
以下は原文 README の抜粋です。原文を見る。
mcp-cli
A lightweight, Bun-based CLI for interacting with MCP (Model Context Protocol) servers.
Features
- 🪶 Lightweight - Minimal dependencies, fast startup
- 📦 Single Binary - Compile to standalone executable via
bun build --compile - 🔧 Shell-Friendly - JSON output for call, pipes with
jq, chaining support - 🤖 Agent-Optimized - Designed for AI coding agents (Gemini CLI, Claude Code, etc.)
- 🔌 Universal - Supports both stdio and HTTP MCP servers
- ⚡ Connection Pooling - Lazy-spawn daemon keeps connections warm (60s idle timeout)
- � Tool Filtering - Allow/disable specific tools per server via config
- 📋 Server Instructions - Display MCP server instructions in output
- �💡 Actionable Errors - Structured error messages with available servers and recovery suggestions
Quick Start
1. Installation
curl -fsSL https://raw.githubusercontent.com/philschmid/mcp-cli/main/install.sh | bash
or
# requires bun install
bun install -g https://github.com/philschmid/mcp-cli
2. Create a config file
Create mcp_servers.json in your current directory or ~/.config/mcp/:
{
"mcpServers": {
"filesystem": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-filesystem",
"."
]
},
"deepwiki": {
"url": "https://mcp.deepwiki.com/mcp"
}
}
}
3. Discover available tools
# List all servers and tools
mcp-cli
# With descriptions
mcp-cli -d
4. Call a tool
# View tool schema first
mcp-cli info filesystem read_file
# Call the tool
mcp-cli call filesystem read_file '{"path": "./README.md"}'
Usage
mcp-cli [options] List all servers and tools
mcp-cli [options] info Show server tools and parameters
mcp-cli [options] info Show tool schema
mcp-cli [options] grep Search tools by glob pattern
mcp-cli [options] call Call tool (reads JSON from stdin if no args)
mcp-cli [options] call Call tool with JSON arguments
Both formats work: info or info /
[!TIP] Add
-dto any command to include descriptions.
Options
| Option | Description |
|---|---|
-h, --help |
Show help message |
-v, --version |
Show version number |
-d, --with-descriptions |
Include tool descriptions |
-c, --config |
Path to config file |
Output
| Stream | Content |
|---|---|
| stdout | Tool results and human-readable info |
| stderr | Errors and diagnostics |
Commands
List Servers
# Basic listing
$ mcp-cli
github
• search_repositories
• get_file_contents
• create_or_update_file
filesystem
• read_file
• write_file
• list_directory
インストール
npx -y @modelcontextprotocol/server-filesystem .設定
{
"mcpServers": {
"filesystem": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-filesystem",
"."
]
},
"deepwiki": {
"url": "https://mcp.deepwiki.com/mcp"
}
}
}