mcpField
F
fastmcp-client-cli

fastmcp-client-cli

github.com/prefecthqエージェントワークフロー28.2k148 回インストール今日更新
リポジトリ

fastmcp-client-cli について

fastmcp-client-cli は MCP サーバーの検出、ツール一覧の表示、呼び出しを行うコマンドラインツールです。複数の接続先形式に対応し、エディターやプロジェクトの設定も検索できます。

主な機能

  1. 01設定済み MCP サーバーの検出
  2. 02ツールとスキーマの一覧表示
  3. 03型を自動変換してツールを呼び出し
  4. 04HTTP、SSE、stdio、Python ファイルに対応
  5. 05OAuth と構造化出力のオプション

活用シーン

  1. 01エディター設定内の MCP サーバーを確認
  2. 02ローカルまたはリモートサーバーのツールを調査
  3. 03引数を指定してコマンドラインからツールを実行
  4. 04ツールの入出力スキーマをデバッグ

MCP 対応

コマンドラインから MCP サーバーに接続し、ツールの一覧表示と呼び出しを行います。URL、Python ファイル、MCPConfig、stdio コマンド、検出済みの設定名を接続先に指定できます。

インストール

コマンドをコピーしてターミナルで実行します。

$npx skills add https://github.com/prefecthq/fastmcp --skill fastmcp-client-cli

インストール後、Claude Code で/fastmcp-client-cliを入力して読み込まれたか確認します。

詳細

FastMCP CLI:一覧表示と呼び出し

fastmcp list と fastmcp call を使って、コマンドラインから任意の MCP サーバーを操作できます。

ツールの一覧表示

# Remote server
fastmcp list http://localhost:8000/mcp

# Local Python file (runs via fastmcp run automatically)
fastmcp list server.py

# MCPConfig with multiple servers
fastmcp list mcp.json

# Stdio command (npx, uvx, etc.)
fastmcp list --command 'npx -y @modelcontextprotocol/server-github'

# Include full input/output schemas
fastmcp list server.py --input-schema --output-schema

# Machine-readable JSON
fastmcp list server.py --json

# Include resources and prompts
fastmcp list server.py --resources --prompts

デフォルトの出力には、ツールのシグネチャと説明が表示されます。完全な JSON スキーマを含めるには --input-schema または --output-schema を、構造化出力にするには --json を使います。

ツールの呼び出し

# Key=value arguments (auto-coerced to correct types)
fastmcp call server.py greet name=World
fastmcp call server.py add a=3 b=4

# Single JSON object for complex/nested args
fastmcp call server.py create_item '{"name": "Widget", "tags": ["a", "b"]}'

# --input-json with key=value overrides
fastmcp call server.py search --input-json '{"query": "hello", "limit": 5}' limit=10

# JSON output for scripting
fastmcp call server.py add a=3 b=4 --json

型変換は自動で行われます。ツールの入力スキーマに基づき、limit=5 は整数に、verbose=true はブール値に変換されます。

サーバーの指定方法

すべてのコマンドで、次のサーバーの指定方法を使用できます。

指定方法例
HTTP/HTTPS URLhttp://localhost:8000/mcp
Python ファイルserver.py
MCPConfig JSONmcp.json(mcpServers キーが必要です)
Stdio コマンド--command 'npx -y @mcp/server'
検出された名前weather または source:name

エディター設定(Claude Desktop、Claude Code、Cursor、Gemini CLI、Goose)またはプロジェクトレベルの mcp.json で設定されたサーバーは、名前で指定できます。特定のソースを対象にするには、source:name(例:claude-code:my-server、cursor:weather)を使います。利用可能な名前を確認するには、fastmcp discover を実行します。

SSE サーバーの場合は、--transport sse を指定します。

fastmcp list http://localhost:8000/mcp --transport sse

認証

HTTP の指定先では OAuth が自動的に使用されます(サーバーが認証を必要としない場合は何も行いません)。無効にするには --auth none を指定します。

fastmcp call http://server/mcp tool --auth none

設定済みサーバーの検出

# See all MCP servers in editor/project configs
fastmcp discover

# Filter by source
fastmcp discover --source claude-code

# JSON output
fastmcp discover --json

Claude Desktop、Claude Code、Cursor、Gemini CLI、Goose、および ./mcp.json をスキャンします。ソース:claude-desktop、claude-code、cursor、gemini、goose、project。

ワークフローのパターン

まずツールを検出してから、呼び出します。

# 1. See what servers are configured
fastmcp discover

# 2. See what tools a server has
fastmcp list weather

# 3. Call a tool
fastmcp call weather get_forecast city=London

存在しないツールを呼び出すと、FastMCP が名前の似た候補を提示します。

コメント