Skip to main content
Glama
drasticstatic

hummingbot-mcp

drasticstatic ワーキングコピーFortuna取引システムで使用されています。これはhummingbot/mcpのローカルクローンから作成された独立したリポジトリです。アップストリームは比較のためにリモートとして追跡されており、変更は適用前にレビューされます。

# Check for upstream updates (review before applying)
git fetch upstream && git log upstream/main --oneline

MCP Hummingbotサーバー

ClaudeおよびGemini CLIがHummingbotと連携し、複数の取引所にわたる自動暗号資産取引を可能にするMCP(Model Context Protocol)サーバーです。

インストールと設定

オプション1: uvを使用する(開発に推奨)

  1. uvをインストールする(まだインストールされていない場合):

    curl -LsSf https://astral.sh/uv/install.sh | sh
  2. クローンを作成し、依存関係をインストールする:

    git clone https://github.com/hummingbot/mcp
    cd mcp
    uv sync
  3. .envファイルを作成する:

    cp .env.example .env
  4. .envファイルを編集し、HummingbotのAPI認証情報を入力します:

    HUMMINGBOT_API_URL=http://localhost:8000
    HUMMINGBOT_USERNAME=admin
    HUMMINGBOT_PASSWORD=admin
  5. Claude CodeまたはGemini CLIで設定する:

    {
      "mcpServers": {
        "hummingbot-mcp": {
          "type": "stdio",
          "command": "uv",
          "args": [
            "--directory",
            "/path/to/mcp",
            "run",
            "main.py"
          ]
        }
      }
    }

    注意: /path/to/mcp は、実際のMCPディレクトリへのパスに置き換えてください。

オプション2: Dockerを使用する(本番環境に推奨)

  1. .envファイルを作成する:

    touch .env
  2. .envファイルを編集し、HummingbotのAPI認証情報を入力します:

    HUMMINGBOT_API_URL=http://localhost:8000
    HUMMINGBOT_USERNAME=admin
    HUMMINGBOT_PASSWORD=admin

    重要: DockerでMCPサーバーを実行し、ホスト上のHummingbot APIに接続する場合:

    • Linux: コンテナが localhost:8000 にアクセスできるように --network host を使用します(下記参照)

    • Mac/Windows: HUMMINGBOT_API_URLhttp://host.docker.internal:8000 に変更します

  3. Dockerイメージをプルする:

    docker pull hummingbot/hummingbot-mcp:latest
  4. Claude CodeまたはGemini CLIで設定する:

    Linuxの場合(--network hostを使用):

    {
      "mcpServers": {
        "hummingbot-mcp": {
          "type": "stdio",
          "command": "docker",
          "args": [
            "run",
            "--rm",
            "-i",
            "--network",
            "host",
            "--env-file",
            "/path/to/mcp/.env",
            "-v",
            "$HOME/.hummingbot_mcp:/root/.hummingbot_mcp",
            "hummingbot/hummingbot-mcp:latest"
          ]
        }
      }
    }

    Mac/Windowsの場合:

    {
      "mcpServers": {
        "hummingbot-mcp": {
          "type": "stdio",
          "command": "docker",
          "args": [
            "run",
            "--rm",
            "-i",
            "--env-file",
            "/path/to/mcp/.env",
            "-v",
            "$HOME/.hummingbot_mcp:/root/.hummingbot_mcp",
            "hummingbot/hummingbot-mcp:latest"
          ]
        }
      }
    }

    .env ファイルで HUMMINGBOT_API_URL=http://host.docker.internal:8000 を設定することを忘れないでください)

    注意: /path/to/mcp は、実際のMCPディレクトリへのパスに置き換えてください。

Docker Composeによるクラウドデプロイ

Hummingbot APIとMCPサーバーの両方を同じサーバーで実行するクラウドデプロイの場合:

  1. .envファイルを作成する:

    touch .env
  2. .envファイルを編集し、HummingbotのAPI認証情報を入力します:

    HUMMINGBOT_API_URL=http://localhost:8000
    HUMMINGBOT_USERNAME=admin
    HUMMINGBOT_PASSWORD=admin
  3. docker-compose.ymlを作成する:

    services:
      hummingbot-api:
        container_name: hummingbot-api
        image: hummingbot/hummingbot-api:latest
        ports:
          - "8000:8000"
        volumes:
          - ./bots:/hummingbot-api/bots
          - /var/run/docker.sock:/var/run/docker.sock
        environment:
          - USERNAME=admin
          - PASSWORD=admin
          - BROKER_HOST=emqx
          - DATABASE_URL=postgresql+asyncpg://hbot:hummingbot-api@postgres:5432/hummingbot_api
        networks:
          - emqx-bridge
        depends_on:
          - postgres
    
      mcp-server:
        container_name: hummingbot-mcp
        image: hummingbot/hummingbot-mcp:latest
        stdin_open: true
        tty: true
        env_file:
          - .env
        environment:
          - HUMMINGBOT_API_URL=http://hummingbot-api:8000
        depends_on:
          - hummingbot-api
        networks:
          - emqx-bridge
    
      # Include other services from hummingbot-api docker-compose.yml as needed
      emqx:
        container_name: hummingbot-broker
        image: emqx:5
        restart: unless-stopped
        environment:
          - EMQX_NAME=emqx
          - EMQX_HOST=node1.emqx.local
          - EMQX_CLUSTER__DISCOVERY_STRATEGY=static
          - EMQX_CLUSTER__STATIC__SEEDS=[emqx@node1.emqx.local]
          - EMQX_LOADED_PLUGINS="emqx_recon,emqx_retainer,emqx_management,emqx_dashboard"
        volumes:
          - emqx-data:/opt/emqx/data
          - emqx-log:/opt/emqx/log
          - emqx-etc:/opt/emqx/etc
        ports:
          - "1883:1883"
          - "8883:8883"
          - "8083:8083"
          - "8084:8084"
          - "8081:8081"
          - "18083:18083"
          - "61613:61613"
        networks:
          emqx-bridge:
            aliases:
              - node1.emqx.local
        healthcheck:
          test: [ "CMD", "/opt/emqx/bin/emqx_ctl", "status" ]
          interval: 5s
          timeout: 25s
          retries: 5
    
      postgres:
        container_name: hummingbot-postgres
        image: postgres:15
        restart: unless-stopped
        environment:
          - POSTGRES_DB=hummingbot_api
          - POSTGRES_USER=hbot
          - POSTGRES_PASSWORD=hummingbot-api
        volumes:
          - postgres-data:/var/lib/postgresql/data
        ports:
          - "5432:5432"
        networks:
          - emqx-bridge
        healthcheck:
          test: ["CMD-SHELL", "pg_isready -U hbot -d hummingbot_api"]
          interval: 10s
          timeout: 5s
          retries: 5
    
    networks:
      emqx-bridge:
        driver: bridge
    
    volumes:
      emqx-data: { }
      emqx-log: { }
      emqx-etc: { }
      postgres-data: { }
  4. デプロイする:

    docker compose up -d
  5. 既存のコンテナに接続するようにClaude CodeまたはGemini CLIを設定する:

    {
      "mcpServers": {
        "hummingbot-mcp": {
          "type": "stdio",
          "command": "docker",
          "args": [
            "exec",
            "-i",
            "hummingbot-mcp",
            "uv",
            "run",
            "main.py"
          ]
        }
      }
    }

    注意: hummingbot-mcp は実際のコンテナ名に置き換えてください。コンテナ名は以下を実行して確認できます:

    docker ps

Related MCP server: ai-trader

サーバー設定

初回実行時、サーバーは環境変数からデフォルト設定を作成します(またはデフォルトの認証情報で http://localhost:8000 を使用します)。設定は ~/.hummingbot_mcp/server.yml に保存されます。

configure_serverツールの使用

# Show the current server configuration
configure_server()

# Update the host and port
configure_server(host="192.168.1.100", port=8001)

# Update credentials
configure_server(username="admin", password="secure_password")

# Update everything at once
configure_server(
    name="production",
    host="prod-server",
    port=8000,
    username="admin",
    password="secure_password"
)

指定されたパラメータのみが変更され、省略されたパラメータは現在の値を保持します。クライアントは更新後に自動的に再接続します。

環境変数

MCPサーバーの .env ファイルには、以下の環境変数を設定できます:

変数

デフォルト

説明

HUMMINGBOT_API_URL

http://localhost:8000

初期のデフォルトAPIサーバーURL(初回実行時のみ使用)

HUMMINGBOT_USERNAME

admin

初期のユーザー名(初回実行時のみ使用)

HUMMINGBOT_PASSWORD

admin

初期のパスワード(初回実行時のみ使用)

HUMMINGBOT_TIMEOUT

30.0

接続タイムアウト(秒)

HUMMINGBOT_MAX_RETRIES

3

最大再試行回数

HUMMINGBOT_RETRY_DELAY

2.0

再試行間隔(秒)

HUMMINGBOT_LOG_LEVEL

INFO

ログレベル(DEBUG, INFO, WARNING, ERROR, CRITICAL)

注意: 初期設定後、サーバー接続を更新するには configure_server ツールを使用してください。環境変数は初期のデフォルト設定を作成するためにのみ使用されます。

要件

  • Python 3.11以上

  • 実行中のHummingbot APIサーバー

  • 有効なHummingbot API認証情報

利用可能なツール

MCPサーバーは以下のためのツールを提供します:

サーバー管理

  • configure_server: アクティブなHummingbot APIサーバー接続の表示または更新

    • パラメータなし: 現在のサーバー設定を表示

    • パラメータあり: 更新して再接続

    • 設定は ~/.hummingbot_mcp/server.yml に永続化されます

取引およびアカウント管理

  • アカウント管理とコネクタ設定

  • ポートフォリオの残高と配分

  • 注文の発注と管理

  • ポジション管理

  • 市場データ(価格、オーダーブック、ローソク足)

  • ファンディングレート

  • ボットのデプロイと管理

  • コントローラー設定

開発

開発モードでサーバーを実行するには:

uv run main.py

テストを実行するには:

uv run pytest

トラブルシューティング

MCPサーバーは、接続や認証の問題を診断するために包括的なエラーメッセージを提供するようになりました:

接続エラー

以下のようなエラーメッセージが表示された場合:

  • ❌ Cannot reach Hummingbot API at <url> - APIサーバーが実行されていないか、アクセスできません

  • ❌ Authentication failed when connecting to Hummingbot API - ユーザー名またはパスワードが正しくありません

  • ❌ Failed to connect to Hummingbot API - 一般的な接続失敗

エラーメッセージには以下が含まれます:

  • 使用されている正確なURL

  • 設定されたユーザー名(パスワードはマスクされます)

  • 問題を解決するための具体的な提案

  • configure_server などのツールへの参照

一般的な解決策

  1. APIが実行されていない:

    • Hummingbot APIサーバーが実行されていることを確認してください

    • APIが設定されたURLでアクセス可能であることを確認してください

  2. 認証情報が間違っている:

    • configure_server ツールを使用してサーバーの認証情報を更新してください

    • または .env ファイルの設定を確認してください

  3. URLが間違っている:

    • configure_server ツールを使用してサーバーURLを更新してください

    • Mac/Windows上のDockerの場合は、localhost の代わりに host.docker.internal を使用してください

  4. Dockerネットワークの問題:

    • Linuxでは、Docker設定で --network host を使用してください

    • Mac/Windowsでは、API URLとして host.docker.internal:8000 を使用してください

エラー防止

MCPサーバーは以下の動作を行います:

  • 認証失敗(401エラー)時には再試行しません - 認証情報が間違っていることを即座に通知します

  • 接続失敗時には、何が問題であるかについての役立つメッセージとともに再試行します

  • Dockerで実行しているかどうかについてのコンテキストを提供し、適切な修正を提案します

  • 問題を解決するために適切なツール(configure_server)へ案内します

Install Server
A
license - permissive license
A
quality
D
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

  • A
    license
    A
    quality
    D
    maintenance
    An MCP server that enables Claude and Gemini CLI to interact with Hummingbot for automated cryptocurrency trading across multiple exchanges.
    11
    59
    Apache 2.0
  • A
    license
    -
    quality
    D
    maintenance
    Enables AI assistants like Claude to run backtests, fetch market data, list strategies, and analyze trading algorithms via natural language.
    995
    GPL 3.0
  • A
    license
    B
    quality
    B
    maintenance
    Provides 31 AI-powered crypto trading tools for Claude, Cursor, and any MCP client, enabling strategy creation, backtesting, bot deployment, copy trading, and portfolio management across multiple exchanges.
    34
    54
    MIT

View all related MCP servers

Related MCP Connectors

  • Trade Robinhood through natural language in Claude Code.

  • Trade, monitor portfolios, and build Coinrule strategies by chat.

  • MCP server for Gainium — manage trading bots, deals, and balances via AI assistants

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/drasticstatic/hummingbot-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server