mcp-ibkr-agent
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| IBKR_ACCOUNT_ID | Yes | IBKR account ID (e.g., DU1234567 for paper) | |
| MAX_ORDER_VALUE | No | Maximum order value in USD | 100.0 |
| TRADING_DRY_RUN | No | If 'true', validates orders but does not send them | true |
| IBKR_API_BASE_URL | No | Endpoint of the IBKR Client Portal Gateway | https://localhost:5000/v1/api |
| IBKR_TRADING_MODE | No | Trading mode: 'paper' or 'live' | paper |
| TRADING_ALLOW_LIVE | No | Set to 'true' to allow live trading (hard safety lock) | false |
Instructions
Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.
This server publishes no instructions, or was last inspected before Glama recorded them.
Capabilities
Features and capabilities supported by this server
Protocol revision2025-11-25
| Capability | Details |
|---|---|
| tools | {
"listChanged": false
} |
| prompts | {
"listChanged": false
} |
| resources | {
"subscribe": false,
"listChanged": false
} |
| experimental | {} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| session_statusA | Trading posture — "am I safe to trade right now?" — plus which account is live. Identity: Posture (so an unattended caller can self-gate): |
| reconcile_pendingA | Reconcile dispatched-but-unconfirmed orders against IBKR's open orders. After a timeout/crash an order may have landed without its outcome journaled, so the
safety layer BLOCKS an identical resend until it is reconciled. This clears that block:
orders found resting on IBKR are marked resolved; ones not found stay blocked (they may
have filled — resending blind would double them). Set |
| market_statusA | Indicates whether the US market is open (RTH) right now. |
| get_quoteA | Current quote (last/bid/ask) for a US stock symbol. |
| get_quotesA | Quotes for several US stock symbols at once (one snapshot — cheaper for a watchlist). |
| account_summaryB | Account summary: available funds, net liquidation, buying power. |
| positionsC | Open positions in the account. |
| portfolioA | Combined snapshot: account summary + open positions + total unrealized P&L. |
| buyA | Buy. Provide Omit A |
| sellA | Sell by IBKR does NOT accept selling by US$ value (cashQty is buy-only). To exit
100% of a position use |
| close_positionA | Closes 100% of a symbol's position, trading the exact fractional quantity. Reads the exact position size and sends the opposite order. Note: IBKR's
portfolio is eventually-consistent — right after a recent BUY the position may
not appear yet (and the close will return |
| stop_orderA | Place a STOP order (e.g. a stop-loss). Triggers a market order when
|
| trailing_stopB | Place a TRAILING stop — a stop that follows the price (locks in gains as it moves). The trigger trails the market by |
| bracket_orderA | Place an entry order with attached take-profit and stop-loss exits (OCO). The entry buys (or sells) |
| preview_orderA | Preview an order's impact (margin, estimated commission, warnings) WITHOUT sending it. Uses IBKR's whatif so the agent can reason about cost/margin before committing. |
| order_statusA | Status of a placed order by its order_id: state, filled quantity, average price. Use this after Units: |
| wait_for_fillA | Poll an order until it reaches a terminal state (filled/cancelled/rejected/inactive), or the timeout elapses. Closes the confirm-the-fill loop so the agent doesn't have to orchestrate the
retry itself. Returns the latest status with Same unit contract as |
| cancel_orderA | Cancels an open order by its order_id. |
| open_ordersB | Lists the active orders (live orders) in the account. Same unit contract as |
| trade_historyA | Audit log of the agent's recent order attempts (buys, sells, dry-runs, blocks). Reads the local trade journal — answers "what did my agent do?". Does not hit IBKR. |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
No prompts | |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
No resources | |
TDQS
Scored across 20 tools
Each tool serves a distinct purpose: account info, quotes, order placement (different order types), order management, preview, history, reconciliation, and session status. Descriptions clearly differentiate even similar-sounding tools like 'open_orders' and 'order_status'.
Tool names follow a consistent snake_case verb_noun pattern (e.g., account_summary, cancel_order, get_quote). A few are single verbs (buy, sell) but that is standard for basic actions and does not break consistency.
With 20 tools, the server covers a wide range of trading operations without being excessive. Some tools (e.g., get_quote and get_quotes) could be merged, but the count is still appropriate for the domain.
The tool set covers core trading workflows: account info, quotes, various order types, order management, preview, history, and reconciliation. Minor gaps like order modification are absent, but the set is largely complete for common trading tasks.