ibkr-mcp
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| IBKR_HOST | No | TWS / Gateway host | 127.0.0.1 |
| IBKR_PORT | No | Match your TWS / Gateway mode (7496 live, 7497 paper, 4001 live gateway, 4002 paper gateway) | 7497 |
| IBKR_TIMEOUT | No | Connect and request timeout in seconds | 10 |
| IBKR_CLIENT_ID | No | Unique per API client (must be at least 1) | 23 |
| IBKR_FLEX_TOKEN | No | The Flex Web Service token itself (fallback; prefer IBKR_FLEX_TOKEN_CMD) | |
| IBKR_FLEX_QUERY_ID | No | Numeric ID of your Activity Flex Query (or IBKR_FLEX_QUERY_IDS for multiple) | |
| IBKR_ENABLE_TRADING | No | Set to 'true', '1', or 'yes' to register order tools | |
| IBKR_FLEX_TOKEN_CMD | No | Command whose stdout is the Flex Web Service token | |
| IBKR_MAX_ORDER_VALUE | No | Cap on order notional (ceiling 10,000,000) | 50000 |
| IBKR_MARKET_DATA_TYPE | No | 1 live, 2 frozen, 3 delayed, 4 delayed-frozen | 3 |
| IBKR_ORDERS_PER_MINUTE | No | Aggregate order rate limit across concurrent calls | 6 |
| IBKR_MAX_ORDER_QUANTITY | No | Hard cap on units per order (ceiling 1,000,000) | 1000 |
| IBKR_ALLOW_EXTERNAL_CANCEL | No | Set to 'true' to allow cancel_order to cancel orders not placed by this server |
Capabilities
Features and capabilities supported by this server
| Capability | Details |
|---|---|
| tools | {
"listChanged": true
} |
| logging | {} |
| prompts | {
"listChanged": false
} |
| resources | {
"subscribe": false,
"listChanged": false
} |
| extensions | {
"io.modelcontextprotocol/ui": {}
} |
| experimental | {} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| list_accountsB | List account IDs managed by the current TWS/Gateway login. |
| get_account_summaryB | Account summary: net liquidation, cash, buying power, margin, etc. |
| get_positionsB | Current positions with quantity and average cost. |
| get_portfolioB | Portfolio with market value, unrealized and realized PnL per position. |
| review_positionsA | Review open positions for loss discipline. Flags positions that have fallen past a loss threshold so a deliberate decision gets made — "has the thesis changed, or just the price?" — instead of defaulting to holding. Surfaces the book so the well-documented tendency to hold losers and sell winners (the disposition effect) gets a conscious check. Informational, not advice. |
| get_pnlB | Today's realized/unrealized/daily PnL for an account. |
| get_quoteC | Market data snapshot (delayed by default; see IBKR_MARKET_DATA_TYPE). |
| get_historical_dataC | Historical OHLCV bars. |
| lookup_contractC | Resolve a symbol to a fully qualified IB contract (conId, exchange, etc.). |
| search_contractsC | Search instruments by symbol or company name. |
| get_open_ordersA | Open (working) orders across accounts. |
| get_executionsA | Executions (fills) from the current session/day. |
| get_history_coverageA | Date span and row counts of locally archived account history. |
| get_trade_historyA | Historical executed trades from the configured Flex query (up to its period, plus everything previously archived locally). Needs IBKR_FLEX_QUERY_ID + token; see README. |
| get_cash_transactionsC | Historical cash activity (dividends, interest, deposits/withdrawals, fees) from the configured Flex query. Needs IBKR_FLEX_QUERY_ID + token; see README. |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
No prompts | |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
No resources | |
Latest Blog Posts
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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/jgalea/ibkr-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server