Skip to main content
Glama
atomcp-ai

ib-async-mcp

by atomcp-ai

ib-async-mcp

MCP (Model Context Protocol) server wrapping ib_async for Interactive Brokers API.

Features

  • Connection Management: Connect/disconnect to TWS or IB Gateway

  • Account Data: Account values, summary, portfolio, positions, P&L

  • Contracts: Create and qualify contracts (stocks, options, futures, forex, crypto, etc.)

  • Market Data: Real-time quotes and historical data

  • Orders: Place, modify, cancel orders (market, limit, stop, stop-limit)

  • Options: Option chains, implied volatility, option pricing

  • Scanners: Market scanners with various criteria

  • News: News providers and articles

Related MCP server: claude-tws-connect

Prerequisites

  • Python 3.10+

  • Interactive Brokers TWS or IB Gateway running with API enabled

  • API port configured (default: 7497 for TWS, 4001 for Gateway)

Installation

cd ib-async-mcp
uv sync

Usage

Running the Server

uv run ib-async-mcp

MCP Configuration

Add to your MCP client configuration (e.g., .kiro/settings/mcp.json):

{
  "mcpServers": {
    "ib-async": {
      "command": "uv",
      "args": ["--directory", "/path/to/ib-async-mcp", "run", "ib-async-mcp"],
      "env": {}
    }
  }
}

Or using uvx (after publishing):

{
  "mcpServers": {
    "ib-async": {
      "command": "uvx",
      "args": ["ib-async-mcp"],
      "env": {}
    }
  }
}

Available Tools

Connection

  • connect - Connect to TWS/Gateway

  • disconnect - Disconnect

  • is_connected - Check connection status

Account

  • get_accounts - List managed accounts

  • get_account_values - Account values (balance, margin, etc.)

  • get_account_summary - Account summary

  • get_portfolio - Portfolio with market values

  • get_positions - All positions

  • get_pnl - Profit and loss

Contracts

  • create_contract - Create a contract

  • qualify_contracts - Qualify contracts (fill conId)

  • get_contract_details - Detailed contract info

  • search_symbols - Search for symbols

Market Data

  • get_market_data - Real-time snapshot

  • get_historical_data - Historical bars

  • get_head_timestamp - Earliest available data

Orders

  • place_order - Place new order

  • cancel_order - Cancel order

  • cancel_all_orders - Cancel all orders

  • get_open_orders - List open orders

  • get_open_trades - List open trades

  • get_executions - Execution reports

  • get_fills - Order fills

  • what_if_order - Check margin impact

Options

  • get_option_chain - Option chain

  • calculate_implied_volatility - Calculate IV

  • calculate_option_price - Calculate option price

Scanners

  • get_scanner_parameters - Available scanner params

  • run_scanner - Run market scanner

News

  • get_news_providers - List news providers

  • get_news_article - Get article

  • get_historical_news - Historical headlines

Utility

  • get_current_time - TWS server time

Example Usage

# Connect first
connect(host="127.0.0.1", port=7497, client_id=1)

# Get account info
get_accounts()
get_portfolio()

# Get market data
get_market_data(contract_type="stock", symbol="AAPL")

# Get historical data
get_historical_data(
    contract_type="stock",
    symbol="SPY",
    duration="5 D",
    bar_size="1 hour"
)

# Place an order
place_order(
    contract_type="stock",
    symbol="AAPL",
    action="BUY",
    quantity=100,
    order_type="limit",
    limit_price=150.00
)

License

MIT

Disclaimer

This software is not affiliated with Interactive Brokers Group, Inc. Use at your own risk.

Install Server
A
license - permissive license
B
quality
C
maintenance

Maintenance

Maintainers
Response time
Release cycle
1Releases (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

  • F
    license
    C
    quality
    C
    maintenance
    An MCP server that provides an interface for the Interactive Brokers API via the ib_async library. It enables users to manage accounts, access real-time and historical market data, and execute or monitor trades through TWS or IB Gateway.
    Last updated
    33
    1
  • A
    license
    -
    quality
    D
    maintenance
    An MCP server that enables interaction with Interactive Brokers TWS/Gateway via natural language for portfolio management and market data retrieval. It provides tools for account summaries, historical data, and a secure two-step confirmation process for placing and canceling orders.
    Last updated
    6
    MIT
  • A
    license
    -
    quality
    D
    maintenance
    MCP server for Interactive Brokers TWS API that enables AI assistants to retrieve portfolio, account information, and real-time market prices.
    Last updated
    23
    Apache 2.0
  • A
    license
    A
    quality
    F
    maintenance
    MCP server for Interactive Brokers API integration, enabling account management, trading, market data, and short selling analysis through Claude.
    Last updated
    8
    35
    MIT

View all related MCP servers

Related MCP Connectors

  • MCP server exposing the Backtest360 engine API as tools for AI agents.

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

  • Hosted MCP for stocks, options, Greeks, brokers, order previews, alerts, and workflows.

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/atomcp-ai/ib-async-mcp'

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