### Setup Hummingbot Exchange Connector Source: https://context7.com/hummingbot/mcp/llms.txt Use `setup_connector` for a guided, four-step flow to connect or remove exchange credentials. It supports listing exchanges, showing required fields, providing credentials, and confirming account setup or deletion. ```python # Step 1: List all available exchange connectors setup_connector() ``` ```python # Step 2: Show required credential fields for Binance setup_connector(connector="binance") ``` ```python # Step 3: Provide credentials — will prompt for account selection setup_connector( connector="binance", credentials={ "binance_api_key": "YOUR_API_KEY", "binance_secret_key": "YOUR_SECRET_KEY" } ) ``` ```python # Step 4: Full setup to master_account setup_connector( connector="binance", credentials={ "binance_api_key": "YOUR_API_KEY", "binance_secret_key": "YOUR_SECRET_KEY" }, account="master_account", confirm_override=True # required if credential already exists ) ``` ```python # Delete connector credentials setup_connector(action="delete", connector="binance", account="master_account") ``` -------------------------------- ### Install uv Source: https://github.com/hummingbot/mcp/blob/main/README.md Installs the uv package manager. Ensure uv is installed before proceeding with development setup. ```bash curl -LsSf https://astral.sh/uv/install.sh | sh ``` -------------------------------- ### Create and Edit .env File Source: https://github.com/hummingbot/mcp/blob/main/README.md Copies the example .env file and prompts the user to edit it with Hummingbot API credentials. This file is essential for both development and production setups. ```bash cp .env.example .env ``` ```env HUMMINGBOT_API_URL=http://localhost:8000 HUMMINGBOT_USERNAME=admin HUMMINGBOT_PASSWORD=admin ``` -------------------------------- ### Position Executor Configuration Example Source: https://github.com/hummingbot/mcp/blob/main/hummingbot_mcp/guides/position_executor.md Example configuration for opening a long BTC position with leverage, stop-loss, and take-profit levels. Ensure you fetch the schema first using `manage_executors(executor_type='position_executor')` before creating. ```json { "connector_name": "binance_perpetual", "trading_pair": "BTC-USDT", "side": 1, "amount": 0.01, "leverage": 5, "triple_barrier_config": { "stop_loss": 0.02, "take_profit": 0.03, "open_order_type": 2 } } ``` -------------------------------- ### Clone and Install MCP Dependencies Source: https://github.com/hummingbot/mcp/blob/main/README.md Clones the MCP repository and installs its dependencies using uv. This is part of the development setup. ```bash git clone https://github.com/hummingbot/mcp cd mcp uv sync ``` -------------------------------- ### BUY Limit Order (Accumulate on Dip) Source: https://github.com/hummingbot/mcp/blob/main/hummingbot_mcp/guides/lp_executor.md Configure a BUY limit order with the LP Executor. This setup creates a position that starts out-of-range below the current price and auto-closes when the price falls below the range for a specified duration, allowing for accumulation on a dip. ```python config = { "connector_name": "meteora/clmm", "trading_pair": "SOL-USDC", "pool_address": "0x123...", "lower_price": 100.0, "upper_price": 120.0, # upper_price < current_price "base_amount": 0, "quote_amount": 50.0, # X "side": 1, # BUY/quote-only "auto_close_below_range_seconds": 60 } ``` -------------------------------- ### Run Hummingbot MCP Server in Development Source: https://github.com/hummingbot/mcp/blob/main/README.md Use this command to start the MCP server for development purposes. Ensure you have the necessary Python environment set up. ```bash uv run main.py ``` -------------------------------- ### Deploy Docker containers Source: https://github.com/hummingbot/mcp/blob/main/README.md Use the `docker compose up -d` command to start all defined services in detached mode. ```bash docker compose up -d ``` -------------------------------- ### `setup_connector` Source: https://context7.com/hummingbot/mcp/llms.txt Connect or remove exchange credentials with progressive disclosure. This function manages exchange connector configurations, supporting both setup and deletion of credentials. ```APIDOC ## `setup_connector` — Connect or remove exchange credentials with progressive disclosure ### Description Four-step guided flow: (1) no params → list available exchanges, (2) `connector` only → show required credential fields, (3) `connector` + `credentials`, no `account` → prompt for account selection, (4) all params → store credentials. A parallel `action="delete"` flow removes credentials. ### Method ```python setup_connector(action: str = "add", connector: str, credentials: dict = None, account: str = None, confirm_override: bool = False) ``` ### Parameters #### Optional Parameters - **action** (str) - Defaults to "add". Use "delete" to remove credentials. - **connector** (str) - Required. The name of the exchange connector (e.g., 'binance'). - **credentials** (dict) - A dictionary containing the API key and secret key for the exchange. - **account** (str) - The account name to associate the credentials with. - **confirm_override** (bool) - Required if credentials already exist for the connector and account. Defaults to `False`. ### Request Example ```python # Step 1: List all available exchange connectors setup_connector() # → Returns list of connector names like ['binance', 'binance_perpetual', 'okx', 'jupiter', ...] # Step 2: Show required credential fields for Binance setup_connector(connector="binance") # → Returns: {"required_fields": ["binance_api_key", "binance_secret_key"], ...} # Step 3: Provide credentials — will prompt for account selection setup_connector( connector="binance", credentials={ "binance_api_key": "YOUR_API_KEY", "binance_secret_key": "YOUR_SECRET_KEY" } ) # → Returns list of available accounts to assign credentials to # Step 4: Full setup to master_account setup_connector( connector="binance", credentials={ "binance_api_key": "YOUR_API_KEY", "binance_secret_key": "YOUR_SECRET_KEY" }, account="master_account", confirm_override=True # required if credential already exists ) # → {"action": "credentials_added", "message": "Successfully connected binance exchange to account master_account"} # Delete connector credentials setup_connector(action="delete", connector="binance", account="master_account") # → {"action": "credentials_deleted", "message": "Successfully deleted binance credentials from account master_account"} ``` ### Response (Responses vary based on the action and step in the flow. Examples are provided in the request section.) #### Success Response Example (Adding credentials) ```json {"action": "credentials_added", "message": "Successfully connected binance exchange to account master_account"} ``` #### Success Response Example (Deleting credentials) ```json {"action": "credentials_deleted", "message": "Successfully deleted binance credentials from account master_account"} ``` ``` -------------------------------- ### LP Executor Configuration Example Source: https://github.com/hummingbot/mcp/blob/main/hummingbot_mcp/guides/lp_executor.md Configure the LP Executor with essential parameters for managing liquidity positions on CLMM DEXs. Ensure correct connector name, trading pair, pool address, and price bounds. ```python config = { "connector_name": "meteora/clmm", "trading_pair": "SOL-USDC", "pool_address": "0x123...", "lower_price": 100.0, "upper_price": 200.0, "base_amount": 0.5, "quote_amount": 50.0, "side": 0, # BOTH "auto_close_above_range_seconds": null, "auto_close_below_range_seconds": null, "keep_position": false, "position_offset_pct": 0.01 } ``` -------------------------------- ### SELL Limit Order (Take Profit on Long) Source: https://github.com/hummingbot/mcp/blob/main/hummingbot_mcp/guides/lp_executor.md Set up a SELL limit order using the LP Executor. This configuration creates a position that starts out-of-range above the current price and auto-closes when the price moves above the range for a specified duration, effectively taking profit on a long position. ```python config = { "connector_name": "meteora/clmm", "trading_pair": "SOL-USDC", "pool_address": "0x123...", "lower_price": 150.0, # lower_price > current_price "upper_price": 200.0, "base_amount": 0.5, # X "quote_amount": 0, "side": 2, # SELL/base-only "auto_close_above_range_seconds": 60 } ``` -------------------------------- ### manage_gateway_swaps Source: https://context7.com/hummingbot/mcp/llms.txt Quote and execute token swaps on DEX routers (Jupiter, 0x). Always get a quote before executing and track transaction status with the returned transaction hash. ```APIDOC ## manage_gateway_swaps ### Description Quote and execute token swaps on DEX routers (Jupiter, 0x). Always get a quote before executing. Track transaction status with the returned transaction hash. ### Method `manage_gateway_swaps` ### Parameters - `action` (string) - Required - The action to perform: "quote", "execute", "get_status", "search". - `connector` (string) - Optional - The DEX connector to use (e.g., "jupiter", "0x"). - `network` (string) - Optional - The network to use (e.g., "solana-mainnet-beta", "ethereum-mainnet"). - `trading_pair` (string) - Optional - The trading pair for the swap (e.g., "SOL-USDC"). - `side` (string) - Optional - The side of the trade: "BUY" or "SELL". - `amount` (string) - Optional - The amount to trade. - `slippage_pct` (string) - Optional - The slippage tolerance in percent. - `transaction_hash` (string) - Optional - The hash of the transaction to check status for. - `search_connector` (string) - Optional - Connector to filter search results. - `search_network` (string) - Optional - Network to filter search results. - `status` (string) - Optional - Status to filter search results (e.g., "CONFIRMED"). - `limit` (integer) - Optional - Limit for search results. - `offset` (integer) - Optional - Offset for search results. ### Request Example - Get a swap quote ```python manage_gateway_swaps( action="quote", connector="jupiter", network="solana-mainnet-beta", trading_pair="SOL-USDC", side="SELL", amount="1.0", slippage_pct="0.5" ) ``` ### Response Example - Quote ```json { "result": { "price": "185.23", "fee": "0.0025", "expected_amount": "184.77", "..." } } ``` ### Request Example - Execute the swap ```python manage_gateway_swaps( action="execute", connector="jupiter", network="solana-mainnet-beta", trading_pair="SOL-USDC", side="SELL", amount="1.0", slippage_pct="0.5" ) ``` ### Response Example - Execute ```json { "result": { "transaction_hash": "5xYzAbc...", "status": "SUBMITTED" } } ``` ### Request Example - Check transaction status ```python manage_gateway_swaps( action="get_status", transaction_hash="5xYzAbc..." ) ``` ### Response Example - Status ```json { "result": { "status": "CONFIRMED", "block": 294000000, "fee_paid": "0.000005" } } ``` ### Request Example - Search swap history ```python manage_gateway_swaps( action="search", search_connector="jupiter", search_network="solana-mainnet-beta", status="CONFIRMED", limit=20, offset=0 ) ``` ``` -------------------------------- ### Describe a controller template's parameters and schema Source: https://context7.com/hummingbot/mcp/llms.txt Get detailed information about a specific controller template, including its parameter schema and any existing saved configurations, by using `manage_controllers` with the `describe` action and specifying the `controller_name`. ```python manage_controllers(action="describe", controller_name="grid_strike") ``` -------------------------------- ### Manage Gateway Swaps (Quote, Execute, Status, History) Source: https://context7.com/hummingbot/mcp/llms.txt Use this function to interact with DEX routers for token swaps. Always get a quote before executing. Track transaction status using the returned transaction hash. ```python # Get a swap quote: sell 1 SOL for USDC manage_gateway_swaps( action="quote", connector="jupiter", network="solana-mainnet-beta", trading_pair="SOL-USDC", side="SELL", amount="1.0", slippage_pct="0.5" ) ``` ```python # Execute the swap manage_gateway_swaps( action="execute", connector="jupiter", network="solana-mainnet-beta", trading_pair="SOL-USDC", side="SELL", amount="1.0", slippage_pct="0.5" ) ``` ```python # Check transaction status manage_gateway_swaps( action="get_status", transaction_hash="5xYzAbc..." ) ``` ```python # Search swap history manage_gateway_swaps( action="search", search_connector="jupiter", search_network="solana-mainnet-beta", status="CONFIRMED", limit=20, offset=0 ) ``` -------------------------------- ### Get Market Data (Prices, Candles, Funding Rates, Order Book) Source: https://context7.com/hummingbot/mcp/llms.txt Aggregates real-time market data from exchanges. Automatically calculates candle records and supports volume/price lookups for order books. Ensure the specified connector and trading pair are valid. ```python # Get latest prices for multiple pairs get_market_data( data_type="prices", connector_name="binance", trading_pairs=["BTC-USDT", "ETH-USDT", "SOL-USDT"] ) # Output: # Latest Prices for binance: # Timestamp: 2024-01-15 10:30:00 # # trading_pair | price # ───────────────────────── # BTC-USDT | 95,432.10 # ETH-USDT | 3,201.50 # SOL-USDT | 185.30 ``` ```python # Get 30 days of 1-hour candles get_market_data( data_type="candles", connector_name="binance", trading_pair="BTC-USDT", interval="1h", days=30 ) # → Returns OHLCV table with 720 candles ``` ```python # Get funding rate for perpetual get_market_data( data_type="funding_rate", connector_name="binance_perpetual", trading_pair="BTC-USDT" ) # Output: # Funding Rate for BTC-USDT on binance_perpetual: # Funding Rate: 0.0100% # Mark Price: $95,450.00 # Index Price: $95,432.00 # Next Funding Time: 2024-01-15 16:00:00 ``` ```python # Get order book snapshot (top 10 levels) get_market_data( data_type="order_book", connector_name="binance", trading_pair="BTC-USDT", query_type="snapshot" ) ``` ```python # Order book query: how much volume is available up to price $95,500? get_market_data( data_type="order_book", connector_name="binance", trading_pair="BTC-USDT", query_type="volume_for_price", query_value=95500.0, is_buy=True ) ``` ```python # What price do I get if I want to sell 2 BTC? get_market_data( data_type="order_book", connector_name="binance", trading_pair="BTC-USDT", query_type="price_for_volume", query_value=2.0, is_buy=False ) ``` -------------------------------- ### Control Hummingbot Gateway Container Lifecycle Source: https://context7.com/hummingbot/mcp/llms.txt These commands manage the Hummingbot Gateway container. Use 'get_status' to check its state, 'start' to launch it with specific configurations, 'get_logs' to view recent logs, 'restart' to reboot it, and 'stop' to shut it down. ```python # Check Gateway status manage_gateway_container(action="get_status") ``` ```python # Start Gateway manage_gateway_container( action="start", config={ "passphrase": "my_gateway_passphrase", "image": "hummingbot/gateway:latest", "port": 15888 } ) ``` ```python # Get last 100 log lines manage_gateway_container(action="get_logs", tail=100) ``` ```python # Restart Gateway manage_gateway_container(action="restart") ``` ```python # Stop Gateway manage_gateway_container(action="stop") ``` -------------------------------- ### Get Portfolio Overview Source: https://context7.com/hummingbot/mcp/llms.txt Retrieves a comprehensive overview of your trading portfolio. By default, it includes all sections and accounts and refreshes data from exchanges. Specific parameters can filter accounts, exclude position types, control refresh behavior, and display data as distribution percentages. ```python get_portfolio_overview() ``` ```python get_portfolio_overview( account_names=["master_account"], include_perp_positions=False, include_lp_positions=False, include_active_orders=False, refresh=False, ) ``` ```python get_portfolio_overview( connector_names=["binance", "binance_perpetual"], as_distribution=True ) ``` ```python get_portfolio_overview( include_balances=False, include_active_orders=False, include_lp_positions=True, include_perp_positions=True, ) ``` -------------------------------- ### Deploy a new bot with multiple controller configurations Source: https://context7.com/hummingbot/mcp/llms.txt Use `manage_bots` with the `deploy` action to launch a new trading bot. Specify the bot name, an array of controller configurations to use, the account name, and optional drawdown limits for overall and individual controller performance. ```python manage_bots( action="deploy", bot_name="my-trading-bot", controllers_config=["grid_btc_v1", "dca_eth_v1"], account_name="master_account", max_global_drawdown_quote=500.0, # stop all if total loss > $500 max_controller_drawdown_quote=200.0 # stop individual controller if loss > $200 ) ``` -------------------------------- ### Pull MCP Docker Image Source: https://github.com/hummingbot/mcp/blob/main/README.md Pulls the latest MCP Docker image. This is a prerequisite for the Docker-based production setup. ```bash docker pull hummingbot/hummingbot-mcp:latest ``` -------------------------------- ### Configure MCP Server in Claude/Gemini CLI (uv) Source: https://github.com/hummingbot/mcp/blob/main/README.md Configuration for integrating the MCP Hummingbot Server using uv. Replace `/path/to/mcp` with the actual directory path. ```json { "mcpServers": { "hummingbot-mcp": { "type": "stdio", "command": "uv", "args": [ "--directory", "/path/to/mcp", "run", "main.py" ] } } } ``` -------------------------------- ### Get status of all active Hummingbot bots Source: https://context7.com/hummingbot/mcp/llms.txt Retrieve a summary of all currently running bots, including their names, status, number of active controllers, and uptime, by calling `manage_bots` with the `status` action. ```python manage_bots(action="status") ``` -------------------------------- ### Get specific CLMM pool details by address Source: https://context7.com/hummingbot/mcp/llms.txt Fetch detailed configuration and performance data for a specific CLMM pool on a given network by providing the `connector`, `network`, and `pool_address` to the `get_pool_info` action in `explore_dex_pools`. ```python explore_dex_pools( action="get_pool_info", connector="meteora", network="solana-mainnet-beta", pool_address="9xAbcDef..." ) ``` -------------------------------- ### List all available controller templates and configurations Source: https://context7.com/hummingbot/mcp/llms.txt View all defined controller templates and their associated saved configurations by calling `manage_controllers` with the `list` action. This helps in understanding available strategies and their parameters. ```python manage_controllers(action="list") ``` -------------------------------- ### Configure MCP Server in Claude/Gemini CLI (Docker - Linux) Source: https://github.com/hummingbot/mcp/blob/main/README.md Configuration for integrating the MCP Hummingbot Server using Docker on Linux. Requires `--network host` to access localhost. ```json { "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" ] } } } ``` -------------------------------- ### Get detailed CLMM pool information on Raydium Source: https://context7.com/hummingbot/mcp/llms.txt Retrieve a comprehensive table of CLMM pool data from Raydium, including volume breakdowns and fee/TVL ratios, by setting `detailed=True`. This provides deeper insights into pool performance. ```python explore_dex_pools( action="list_pools", connector="raydium", detailed=True, limit=50 ) ``` -------------------------------- ### Configure MCP Server in Claude/Gemini CLI (Docker - Mac/Windows) Source: https://github.com/hummingbot/mcp/blob/main/README.md Configuration for integrating the MCP Hummingbot Server using Docker on Mac or Windows. Uses `host.docker.internal` for the API URL. ```json { "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" ] } } } ``` -------------------------------- ### `get_portfolio_overview` Source: https://context7.com/hummingbot/mcp/llms.txt Fetches a unified real-time portfolio view across all accounts, including token balances, perpetual positions, CLMM LP positions, and active orders. ```APIDOC ## `get_portfolio_overview` — Unified real-time portfolio view across all accounts ### Description Fetches token balances, perpetual positions, CLMM LP positions, and active orders in parallel using `asyncio.gather`. All four sections are included by default and can be toggled individually. For historical/closed positions use `search_history()` instead. ### Method ```python get_portfolio_overview(include_balances: bool = True, include_positions: bool = True, include_lp_positions: bool = True, include_orders: bool = True) ``` ### Parameters #### Optional Parameters - **include_balances** (bool) - Whether to include token balances. Defaults to `True`. - **include_positions** (bool) - Whether to include perpetual positions. Defaults to `True`. - **include_lp_positions** (bool) - Whether to include CLMM LP positions. Defaults to `True`. - **include_orders** (bool) - Whether to include active orders. Defaults to `True`. ### Request Example ```python # Fetch all portfolio information get_portfolio_overview() # Fetch only balances and orders get_portfolio_overview(include_positions=False, include_lp_positions=False) ``` ### Response #### Success Response (The response is a dictionary containing sections for balances, positions, LP positions, and orders, depending on the parameters used.) #### Response Example ```json { "balances": [ {"asset": "USDC", "free": "1000.0", "locked": "0.0"}, {"asset": "BTC", "free": "0.05", "locked": "0.001"} ], "positions": [ {"symbol": "BTC-USDC", "side": "long", "size": "0.05", "entry_price": "30000.0", "unrealized_pnl": "150.0"} ], "lp_positions": [ {"pool": "BTC-USDC-LP", "amount": "0.1", "value": "5000.0"} ], "orders": [ {"symbol": "ETH-USDC", "type": "limit", "side": "buy", "price": "2000.0", "amount": "1.0"} ] } ``` ``` -------------------------------- ### Create .env file for Hummingbot API Source: https://github.com/hummingbot/mcp/blob/main/README.md Create a .env file to store your Hummingbot API credentials. This file is used by the MCP server to connect to the Hummingbot API. ```bash touch .env ``` -------------------------------- ### Run Hummingbot MCP Server Tests Source: https://github.com/hummingbot/mcp/blob/main/README.md Execute the test suite for the MCP server using this command. This is useful for verifying code changes and ensuring stability. ```bash uv run pytest ``` -------------------------------- ### Configure Hummingbot MCP Server Source: https://context7.com/hummingbot/mcp/llms.txt Use `configure_server()` to view or update the active Hummingbot API server connection. Called with no arguments, it displays the current configuration. Supplying arguments triggers an update and reconnect. ```python # Show current configuration (no parameters) configure_server() ``` ```python # Update host and port configure_server(host="192.168.1.50", port=8001) ``` ```python # Full reconfiguration for production configure_server( name="production", host="prod-server.example.com", port=8000, username="admin", password="s3cur3p@ss", ) ``` -------------------------------- ### Manage Gateway Configuration (Chains, Networks, Tokens) Source: https://context7.com/hummingbot/mcp/llms.txt Configure Gateway chains, networks, tokens, connectors, pools, and wallets. Manages all configuration resources within the Hummingbot Gateway container. ```python # List configured blockchain chains manage_gateway_config(resource_type="chains", action="list") ``` ```python # List all configured networks manage_gateway_config(resource_type="networks", action="list") ``` ```python # Get Solana mainnet config manage_gateway_config( resource_type="networks", action="get", network_id="solana-mainnet-beta" ) ``` ```python # Update RPC node URL for Solana manage_gateway_config( resource_type="networks", action="update", network_id="solana-mainnet-beta", config_updates={"node_url": "https://my-custom-rpc.example.com"} ) ``` ```python # List tokens on Solana (search for USDC) manage_gateway_config( resource_type="tokens", action="list", network_id="solana-mainnet-beta", search="USDC" ) ``` ```python # Add a custom token manage_gateway_config( resource_type="tokens", action="add", network_id="solana-mainnet-beta", token_address="EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v", token_symbol="USDC", token_decimals=6, token_name="USD Coin" ) ``` -------------------------------- ### `configure_server` Source: https://context7.com/hummingbot/mcp/llms.txt View or update the active API server connection. Manages the Hummingbot API server connection stored in `~/.hummingbot_mcp/server.yml`. Called with no arguments it displays the current config; any supplied argument triggers an update and immediate reconnect. ```APIDOC ## `configure_server` — View or update the active API server connection ### Description Manages a single Hummingbot API server connection stored in `~/.hummingbot_mcp/server.yml`. Called with no arguments it displays the current config; any supplied argument triggers an update and immediate reconnect. Only the provided fields are changed; all others retain their current values. ### Method ```python configure_server(name: str = None, host: str = None, port: int = None, username: str = None, password: str = None) ``` ### Parameters #### Optional Parameters - **name** (str) - The name of the server connection. - **host** (str) - The hostname or IP address of the Hummingbot API server. - **port** (int) - The port number of the Hummingbot API server. - **username** (str) - The username for authentication. - **password** (str) - The password for authentication. ### Request Example ```python # Show current configuration (no parameters) configure_server() # Update host and port configure_server(host="192.168.1.50", port=8001) # Full reconfiguration for production configure_server( name="production", host="prod-server.example.com", port=8000, username="admin", password="s3cur3p@ss", ) ``` ### Response (Output varies based on whether configuration is displayed or updated. When displaying, it shows the active server details. When updating, it may return a success message or error.) #### Success Response Example (Displaying config) ``` Active Server: Name: default URL: http://localhost:8000 Username: admin ``` #### Success Response Example (Updating config) ```json {"message": "Server configuration updated successfully."} ``` ``` -------------------------------- ### Configure Hummingbot MCP server settings Source: https://github.com/hummingbot/mcp/blob/main/README.md Use the `configure_server` tool to manage Hummingbot MCP server settings. You can update host, port, username, and password. Omitted parameters retain their current values. ```python # 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" ) ``` -------------------------------- ### Manage Controllers Source: https://context7.com/hummingbot/mcp/llms.txt Commands for managing reusable strategy templates and saved controller configurations. ```APIDOC ## List all controllers and their configs manage_controllers(action="list") ``` ```APIDOC ## List only market_making controllers manage_controllers(action="list", controller_type="market_making") ``` ```APIDOC ## Describe a controller (show parameter schema + existing configs) manage_controllers(action="describe", controller_name="grid_strike") ``` ```APIDOC ## Describe including full source code manage_controllers(action="describe", controller_name="grid_strike", include_code=True) ``` ```APIDOC ## Describe a specific saved config manage_controllers(action="describe", config_name="grid_btc_v1") ``` ```APIDOC ## Create a new controller config manage_controllers( action="upsert", target="config", config_name="grid_btc_v1", config_data={ "controller_type": "market_making", "controller_name": "grid_strike", "connector_name": "binance", "trading_pair": "BTC-USDT", "start_price": "90000", "end_price": "100000", "number_of_levels": 10, "total_amount_quote": "1000", "side": 1, # 1=BUY "order_type": 2, # 2=LIMIT } ) ``` ```APIDOC ## Upload a custom controller template manage_controllers( action="upsert", target="controller", controller_name="my_strategy", controller_code="class MyStrategy(ControllerBase):\n ..." ) ``` ```APIDOC ## Delete a config manage_controllers(action="delete", target="config", config_name="grid_btc_v1") ``` -------------------------------- ### Describe a controller template including its source code Source: https://context7.com/hummingbot/mcp/llms.txt Retrieve the full source code of a controller template along with its parameter schema and configurations by using the `describe` action in `manage_controllers` and setting `include_code=True`. ```python manage_controllers(action="describe", controller_name="grid_strike", include_code=True) ``` -------------------------------- ### Manage Bots Source: https://context7.com/hummingbot/mcp/llms.txt Commands for deploying, monitoring, and managing individual trading bots. ```APIDOC ## Deploy a new bot with two controller configs manage_bots( action="deploy", bot_name="my-trading-bot", controllers_config=["grid_btc_v1", "dca_eth_v1"], account_name="master_account", max_global_drawdown_quote=500.0, # stop all if total loss > $500 max_controller_drawdown_quote=200.0 # stop individual controller if loss > $200 ) ``` ```APIDOC ## Get status of all active bots manage_bots(action="status") ``` ```APIDOC ## Get logs (errors only) manage_bots( action="logs", bot_name="my-trading-bot", log_type="error", limit=50, search_term="connection" ) ``` ```APIDOC ## Stop specific controllers within a bot (using kill switch) manage_bots( action="stop_controllers", bot_name="my-trading-bot", controller_names=["grid_btc_v1"] ) ``` ```APIDOC ## Resume stopped controllers manage_bots( action="start_controllers", bot_name="my-trading-bot", controller_names=["grid_btc_v1"] ) ``` ```APIDOC ## View running bot's controller configs manage_bots(action="get_config", bot_name="my-trading-bot") ``` ```APIDOC ## Update a controller config at runtime (no restart needed) manage_bots( action="update_config", bot_name="my-trading-bot", config_name="grid_btc_v1", config_data={ "controller_type": "market_making", "controller_name": "grid_strike", "end_price": "105000", # widen the grid "total_amount_quote": "1500", }, confirm_override=True ) ``` ```APIDOC ## Stop and permanently archive a bot manage_bots(action="stop_bot", bot_name="my-trading-bot") ``` -------------------------------- ### View the controller configurations of a running bot Source: https://context7.com/hummingbot/mcp/llms.txt Inspect the current controller configurations loaded for a specific running bot by calling `manage_bots` with the `get_config` action and providing the `bot_name`. ```python manage_bots(action="get_config", bot_name="my-trading-bot") ``` -------------------------------- ### List top CLMM pools by volume on Meteora Source: https://context7.com/hummingbot/mcp/llms.txt Query Hummingbot Gateway for a list of top CLMM liquidity pools on Meteora, sorted by 24-hour volume in descending order. This helps in discovering active pools for potential LP positions. ```python explore_dex_pools( action="list_pools", connector="meteora", sort_key="volume", order_by="desc", limit=20 ) ``` -------------------------------- ### Configure Futures Account Position Mode and Leverage Source: https://context7.com/hummingbot/mcp/llms.txt Use this function to set the position mode (HEDGE or ONE-WAY) and leverage for a specific trading pair or for the entire account. Ensure the connector supports these features. ```python # Set position mode only set_account_position_mode_and_leverage( account_name="master_account", connector_name="binance_perpetual", position_mode="HEDGE" ) # → "Position Mode Set: {'success': True}" ``` ```python # Set leverage only (trading_pair required) set_account_position_mode_and_leverage( account_name="master_account", connector_name="binance_perpetual", trading_pair="BTC-USDT", leverage=10 ) # → "Leverage Set: {'leverage': 10}" ``` ```python # Set both at once set_account_position_mode_and_leverage( account_name="master_account", connector_name="binance_perpetual", trading_pair="ETH-USDT", position_mode="ONE-WAY", leverage=5 ) ``` -------------------------------- ### Docker Compose configuration for Hummingbot deployment Source: https://github.com/hummingbot/mcp/blob/main/README.md This Docker Compose file defines the services required for a Hummingbot cloud deployment, including the Hummingbot API, MCP server, EMQX message broker, and PostgreSQL database. It specifies container configurations, environment variables, volumes, and network settings. ```yaml 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: { } ``` -------------------------------- ### Create or update a controller configuration Source: https://context7.com/hummingbot/mcp/llms.txt Define a new controller configuration or update an existing one using the `upsert` action in `manage_controllers` with `target="config"`. Specify the `config_name` and provide the `config_data` dictionary with strategy parameters. ```python manage_controllers( action="upsert", target="config", config_name="grid_btc_v1", config_data={ "controller_type": "market_making", "controller_name": "grid_strike", "connector_name": "binance", "trading_pair": "BTC-USDT", "start_price": "90000", "end_price": "100000", "number_of_levels": 10, "total_amount_quote": "1000", "side": 1, # 1=BUY "order_type": 2, # 2=LIMIT } ) ``` -------------------------------- ### Manage Multi-Strategy Hummingbot Bots Source: https://context7.com/hummingbot/mcp/llms.txt Deploy, monitor, and control controller-based Hummingbot bots. Supports multi-strategy deployments with centralized risk management and real-time configuration updates. Prefer `manage_executors` for single strategies. -------------------------------- ### Manage Trading Executors Source: https://context7.com/hummingbot/mcp/llms.txt The primary tool for managing all trading strategies. Use it to list executor types, view configuration schemas, create new strategies, search running executors, stop strategies, and manage logs and preferences. Specific actions like 'create' require detailed configuration. ```python # List available executor types manage_executors() ``` ```python # Show full guide + config schema for position_executor manage_executors(executor_type="position_executor") ``` ```python # Create a simple MARKET BUY order (order_executor) manage_executors( action="create", executor_type="order_executor", executor_config={ "connector_name": "binance", "trading_pair": "BTC-USDT", "side": 1, # 1=BUY, 2=SELL "order_type": 1, # 1=MARKET, 2=LIMIT, 3=LIMIT_MAKER "amount": "0.001", } ) ``` ```python # Create a position_executor with stop-loss and take-profit manage_executors( action="create", executor_type="position_executor", executor_config={ "connector_name": "binance_perpetual", "trading_pair": "ETH-USDT", "side": 1, # BUY (long) "entry_price": "3200", "amount": "0.1", "stop_loss": "0.02", # 2% stop-loss "take_profit": "0.05", # 5% take-profit "leverage": 5, }, save_as_default=True # persist as default for future use ) ``` ```python # Create a grid executor for range-bound BTC manage_executors( action="create", executor_type="grid_executor", executor_config={ "connector_name": "binance", "trading_pair": "BTC-USDT", "start_price": "90000", "end_price": "100000", "number_of_levels": 10, "total_amount_quote": "1000", } ) ``` ```python # Create a DCA executor manage_executors( action="create", executor_type="dca_executor", executor_config={ "connector_name": "binance", "trading_pair": "ETH-USDT", "side": 1, "amounts_quote": ["100", "200", "400"], # increasing buy sizes "prices": ["3100", "3000", "2900"], # price levels } ) ``` ```python # Search running executors with filters manage_executors( action="search", status="RUNNING", connector_names=["binance"], trading_pairs=["BTC-USDT"], limit=20 ) ``` ```python # Get detailed info for a specific executor manage_executors(action="search", executor_id="abc123") ``` ```python # Stop an executor and close the position manage_executors(action="stop", executor_id="abc123", keep_position=False) ``` ```python # Stop an executor but keep the position open manage_executors(action="stop", executor_id="abc123", keep_position=True) ``` ```python # Get executor logs (active executors only) manage_executors(action="get_logs", executor_id="abc123", log_level="ERROR") ``` ```python # View all positions held by executors manage_executors(action="positions_summary") ``` ```python # Filter to a specific connector/pair manage_executors( action="positions_summary", connector_name="binance_perpetual", trading_pair="ETH-USDT" ) ``` ```python # Clear a position that was closed externally manage_executors( action="clear_position", connector_name="binance_perpetual", trading_pair="ETH-USDT" ) ``` ```python # Manage executor preferences / saved defaults manage_executors(action="get_preferences") ``` ```python manage_executors(action="reset_preferences") ``` ```python manage_executors( action="save_preferences", preferences_content="# My defaults\n\n## position_executor\n```yaml\nleverage: 3\n```") ```