CLIリファレンス
CLIリファレンス
Section titled “CLIリファレンス”Hatago MCP Hub は hatago
コマンドとして提供されます。ここでは主なサブコマンドとオプションを説明します。
インストール/実行
Section titled “インストール/実行”# npx で直接実行(推奨)npx @himorishige/hatago-mcp-hub --version
npm install -g @himorishige/hatago-mcp-hub
hatago init
Section titled “hatago init”設定ファイル(hatago.config.json
)を作成します。
hatago init # 対話的に作成
hatago init --mode stdio # STDIO モード前提のテンプレート
hatago init --mode http # HTTP モード前提のテンプレート
hatago init --config my-config.json # 出力先を指定
-c, --config <path>
: 出力先のパス(既定:./hatago.config.json
)-f, --force
: 既存ファイルを上書き-m, --mode <stdio|http>
: 統合モードの事前選択
hatago serve
Section titled “hatago serve”Hatago Hub を起動します。
hatago serve # 既定(STDIO)
hatago serve --stdio # 明示的に STDIO
hatago serve --http # HTTP モード
hatago serve --watch # 設定のホットリロード
hatago serve --verbose # 詳細ログ
hatago serve --tags development,test # タグでサーバーを選別
--stdio
/--http
: 実行モードの選択(既定: STDIO)-c, --config <path>
: 設定ファイルのパス(STDIO では必須)-h, --host <host>
: HTTP のホスト(既定:127.0.0.1
)-p, --port <port>
: HTTP のポート(既定:3535
)--tags <a,b,c>
: タグで有効化するサーバーを絞り込み--watch
: 設定ファイルを監視して自動リロード--verbose
/--quiet
: ログ出力の詳細度
{ "mcpServers": { "hatago": { "command": "npx", "args": ["@himorishige/hatago-mcp-hub", "serve", "--stdio", "--config", "./hatago.config.json"] } }}
[mcp_servers.hatago]command = "npx"args = ["-y", "@himorishige/hatago-mcp-hub", "serve", "--stdio", "--config", "./hatago.config.json"]
環境変数のセットアップ
Section titled “環境変数のセットアップ”# 環境変数の設定export GITHUB_TOKEN="your-github-token"export OPENAI_API_KEY="your-openai-key"export API_TOKEN="your-api-token"
# または.envファイルを使用
echo "GITHUB_TOKEN=your-github-token" >> .envecho "OPENAI_API_KEY=your-openai-key" >> .envecho "API_TOKEN=your-api-token" >> .env
Docker 例
Section titled “Docker 例”# Dockerイメージのビルドdocker build -t hatago-hub .
# コンテナの起動
docker run -it \-v $(pwd)/hatago-config.json:/app/hatago-config.json \ -e GITHUB_TOKEN=$GITHUB_TOKEN \hatago-hub
# docker-composeを使用
docker-compose up
# デバッグモードで起動hatago serve --verbose
# ログレベルを設定
export LOG_LEVEL=debughatago serve
# 特定のサーバーのみデバッグ
hatago serve --tags debug --verbose
関連ドキュメント: