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 |
Capabilities
Features and capabilities supported by this server
| 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 | |
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/pedrobraiti/agentic-trading-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server