activate_alert
Activate a previously created alert. Usage: { "accountId": "<id>", "alertId": "<alertId>" }.
Check an Interactive Brokers account, pull real-time quotes and option chains, place orders and set price alerts from your client.
LABSCO SUMMARY
The order path is modelled the way IB actually behaves rather than as a single fire-and-forget call: some orders come back needing confirmation with reply and message ids, and get_live_orders exists precisely because a returned order id is not proof of a fill. Given that it places real trades against a real account, the sensible order of operations is paper trading first with IB_PAPER_TRADING=true, and reading positions and orders back after every write.
A community server for the Interactive Brokers trading platform. The npm package ships a preconfigured IB Gateway and a Java runtime, so authentication, market data and order routing all run locally against your own account.
An Interactive Brokers account — paper or live — and Node.js 18+; nothing else to install, since IB Gateway and the Java runtime come with the package. It runs as npx -y interactive-brokers-mcp. By default a browser window opens for the IB login. Headless environments set IB_HEADLESS_MODE=true with IB_USERNAME and IB_PASSWORD_AUTH; two-factor may still be requested, and headless authentication waits up to 60 seconds for you to approve it before returning AUTHENTICATION_PENDING. IB_PAPER_TRADING=true points the session at a paper account. The author states this is unofficial, not affiliated with Interactive Brokers, in alpha, and meant to run locally rather than on a public server.
One command — npx -y interactive-brokers-mcp
USE CASES
Authenticate once, then read balances and open positions for the account you name.
Pull the expirations and strikes for the underlying, resolve the exact contract, and check the live quote before deciding.
Submit it, answer any confirmation prompt with the ids it returned, then look at live orders rather than trusting the response.
Create the alert with its condition on the contract, activate it, and list or delete alerts as they stop being relevant.
Run the same account, quote and order calls against a paper account by switching the paper trading variable on.
Counted once with only startup setup. Other versions, modes or optional credentials may expose a different list.
activate_alertActivate a previously created alert. Usage: { "accountId": "<id>", "alertId": "<alertId>" }.
authenticateAuthenticate with Interactive Brokers. Usage: { "confirm": true }.
confirm_orderManually confirm an order that requires confirmation. Usage: { "replyId": "742a95a7-55f6-4d67-861b-2fd3e2b61e3c", "messageIds": ["o10151", "o10153"] }.
create_alertCreate a new trading alert. Usage: { "accountId": "<id>", "alertRequest": { "alertName": "Price Alert", "conditions": [{ "conidex": "265598", "type": "price", "operator": ">", "triggerMethod": "last", "value": "150" }] } }.
delete_alertDelete an alert. Usage: { "accountId": "<id>", "alertId": "<alertId>" }.
get_account_infoGet account information and balances. Usage: { "confirm": true }.
get_alertsGet all trading alerts for an account. Usage: { "accountId": "<id>" }.
get_live_ordersGet all live/open orders for monitoring and validation. Usage: {} for all accounts or { "accountId": "<id>" } for a specific account. This is the recommended way to validate that market orders were executed successfully after placing them.
get_market_dataGet real-time market data. Usage: { "symbol": "AAPL" } or { "symbol": "AAPL", "exchange": "NASDAQ" }.
get_option_chainGet option expirations and strikes for an underlying symbol. Usage: { "symbol": "AAPL" } or { "symbol": "AAPL", "exchange": "SMART" }.
get_order_statusGet the status of a specific order. Usage: { "orderId": "12345" }.
get_positionsGet current positions. Usage: {} or { "accountId": "<id>" }.
place_orderPlace a trading order. Examples:
{ "accountId":"abc","symbol":"AAPL","action":"BUY","orderType":"MKT","quantity":1 }{ "accountId":"abc","symbol":"AAPL","action":"SELL","orderType":"LMT","quantity":1,"price":185.5 }{ "accountId":"abc","symbol":"AAPL","action":"SELL","orderType":"STP","quantity":1,"stopPrice":180 }{ "accountId":"abc","symbol":"AAPL","secType":"OPT","expiry":"JAN27","strike":200,"right":"C","action":"BUY","orderType":"LMT","quantity":1,"price":4.5 }{ "accountId":"abc","conid":123456789,"secType":"OPT","action":"BUY","orderType":"MKT","quantity":1 }{ "accountId":"abc","symbol":"AAPL","action":"BUY","orderType":"MKT","quantity":1,"suppressConfirmations":true }resolve_option_conidResolve a specific option contract conid. Usage: { "symbol": "AAPL", "expiry": "JAN27", "strike": 200, "right": "C" } or add { "exchange": "SMART" }.
BEFORE YOU INSTALL
14 tools when we connected; the project documents 17. The three Flex Query tools (get_flex_query, list_flex_queries, forget_flex_query) appear only with IB_FLEX_TOKEN set. place_order works only when IB_READ_ONLY_MODE is disabled.
All 6 documented setups run the server on your machine.
INSTALLATION
npx -y interactive-brokers-mcp{
"mcpServers": {
"interactive-brokers": {
"command": "npx",
"args": [
"-y",
"interactive-brokers-mcp"
]
}
}
}{
"mcpServers": {
"interactive-brokers": {
"command": "npx",
"args": [
"-y",
"interactive-brokers-mcp"
],
"env": {
"IB_HEADLESS_MODE": "true",
"IB_USERNAME": "<YOUR_IB_USERNAME>",
"IB_PASSWORD_AUTH": "<YOUR_IB_PASSWORD_AUTH>"
}
}
}
}{
"mcpServers": {
"interactive-brokers": {
"command": "npx",
"args": [
"-y",
"interactive-brokers-mcp"
],
"env": {
"IB_HEADLESS_MODE": "true",
"IB_USERNAME": "<YOUR_IB_USERNAME>",
"IB_PASSWORD_AUTH": "<YOUR_IB_PASSWORD_AUTH>",
"IB_PAPER_TRADING": "true"
}
}
}
}{
"mcpServers": {
"interactive-brokers": {
"command": "npx",
"args": [
"-y",
"interactive-brokers-mcp"
],
"env": {
"IB_FLEX_TOKEN": "<YOUR_IB_FLEX_TOKEN>"
}
}
}
}{
"mcpServers": {
"interactive-brokers": {
"command": "npx",
"args": [
"-y",
"interactive-brokers-mcp"
],
"env": {
"IB_HEADLESS_MODE": "true",
"IB_USERNAME": "<YOUR_IB_USERNAME>",
"IB_PASSWORD_AUTH": "<YOUR_IB_PASSWORD_AUTH>",
"IB_TWO_FA_STRATEGY": "totp",
"IB_TOTP_SECRET": "<YOUR_IB_TOTP_SECRET>"
}
}
}
}