ibkr-mcp-server

GaoChX/ibkr-mcp-server

3.3

If you are the rightful owner of ibkr-mcp-server and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.

The IBKR MCP Server is an implementation based on FastMCP 2.0 and MCP StreamableHTTP, designed to facilitate account management, trading operations, and market data queries with Interactive Brokers.

The IBKR MCP Server is a robust and efficient server implementation that leverages the FastMCP 2.0 and MCP StreamableHTTP protocols to provide seamless integration with Interactive Brokers' TWS/Gateway. This server is designed to handle various financial operations, including account management, trading, and market data retrieval. It ensures stable connections with IBKR's systems, allowing users to perform tasks such as querying account summaries, placing and canceling orders, and accessing real-time and historical market data. The server is built with an asynchronous architecture to support high-performance I/O operations, and it incorporates type safety through Pydantic for data validation. Additionally, it offers flexible configuration options and rich logging capabilities to enhance user experience and troubleshooting.

Features

  • Stable connection management with IBKR TWS/Gateway
  • Comprehensive account information retrieval
  • Efficient trading operations including order placement and cancellation
  • Access to real-time and historical market data
  • High-performance asynchronous architecture with type safety

Usages

usage with Claude Desktop

{
  "mcpServers": {
    "ibkr": {
      "command": "python",
      "args": ["-m", "ibkr_mcp_server.cli", "serve"],
      "env": {
        "IBKR__HOST": "127.0.0.1",
        "IBKR__PORT": "7497",
        "IBKR__CLIENT_ID": "1"
      }
    }
  }
}

Tools

  1. get_account_summary

    Get account summary information

  2. get_positions

    Get position information

  3. place_order

    Place an order

  4. cancel_order

    Cancel an order

  5. get_open_orders

    Get open orders

  6. get_market_data

    Get real-time market data

  7. get_historical_data

    Get historical data

  8. connection_status

    Check connection status

  9. reconnect

    Reconnect to IBKR