# IBKR (Interactive Brokers) MCP

> IBKR (Interactive Brokers) gives your AI agent direct access to manage your brokerage account. You can execute trades, modify open orders, and cancel positions instantly through natural conversation. It also fetches real-time market snapshots for specific contracts, tracks portfolio balances by currency, and generates deep financial reports using pre-configured Flex Queries.

## Overview
- **Category:** money-moves
- **Price:** Free
- **Tags:** trading, brokerage, portfolio-management, market-data, investing, financial-api

## Description

Connect your Interactive Brokers account via this MCP to automate the tedious parts of trading and finance management. Instead of logging into several separate web portals just to check a balance or submit an order modification, your agent handles it all. You can use natural language commands to place new orders, modify existing ones, or cancel anything instantly. Need to know what's happening right now? Fetch real-time snapshots for specific contracts to inform your decisions before you trade. The system also keeps track of your entire financial picture, letting you monitor cash balances and view comprehensive account summaries. If deep analysis is required, the agent can generate Flex Query reports that pull together complex data points for auditing or reporting. All this functionality lives under one roof on Vinkius, meaning you connect once from any compatible client and get immediate access to your entire brokerage workflow.

## Tools

### get_account_summary
Retrieves the current status of your brokerage account, including equity values and cash balances.

### cancel_order
Sends a request to cancel an existing order ID on your account.

### get_flex_statement
Pulls and retrieves a specific, pre-generated financial report (Flex Query).

### get_market_data_snapshot
Fetches the current trading price data for a specified contract.

### modify_order
Changes parameters of an existing, open order, like adjusting quantity or price.

### place_order
Submits a brand new trade order based on the defined specifications.

### get_portfolio_ledger
Retrieves a comprehensive list of all transactions and balances for your account history.

### send_flex_request
Initiates the process to generate a complex financial report, providing a reference code.

### tickle_session
Keeps your API connection active and prevents session timeouts while working with your account.

## Prompt Examples

**Prompt:** 
```
Get a market data snapshot for ConId 265598.
```

**Response:** 
```
I've retrieved the market data for ConId 265598 (AAPL). The last price is $185.92 with a daily change of +1.2%.
```

**Prompt:** 
```
Show me the account summary for account U1234567.
```

**Response:** 
```
For account U1234567, your Net Liquidation Value is $50,230.45, with a Total Cash Balance of $12,400.10 and Maintenance Margin of $15,000.00.
```

**Prompt:** 
```
Cancel order 1001 for account U1234567.
```

**Response:** 
```
I have successfully sent a cancellation request for order ID 1001 on account U1234567. The status is now 'Cancelled'.
```

## Capabilities

### Manage Trades
Place new orders, modify existing ones, or cancel positions using natural language commands.

### Check Account Status
Retrieve the current account summary, including total cash balances and margin metrics for immediate financial oversight.

### Fetch Market Data
Get real-time price snapshots for specific contracts to base trading decisions on live data.

### Generate Reports
Programmatically request and retrieve deep financial analysis using pre-configured Flex Query reports.

### Monitor Ledgers
View detailed portfolio ledgers to track every transaction against your account history.

## Use Cases

### Quickly reacting to market dips
A day trader sees a dip and needs to act fast. Instead of checking the manual, they tell their agent: 'Check the current snapshot for AAPL' (`get_market_data_snapshot`), then immediately follow up with 'Place a market buy order for 100 shares' (`place_order`). The whole sequence happens in seconds.

### Preparing end-of-quarter compliance reports
A financial analyst needs to audit the last quarter’s performance. They tell their agent: 'Generate a Flex Query report for Q2' (`send_flex_request`), wait for the reference, and then retrieve the finalized data using `get_flex_statement`.

### Adjusting an open trade due to news
A portfolio manager spots unexpected volatility. They ask their agent to 'Modify order ID 500,' changing the limit price from $180 to $175 using `modify_order`, preventing a bad execution.

### Investigating an unusual transaction
An account holder notices a discrepancy. They ask their agent to 'Show me the detailed ledger for last week,' using `get_portfolio_ledger` to pinpoint exactly when and why the funds moved.

## Benefits

- Never switch between tabs again. Instead of manually navigating to place an order, you tell your agent to 'place a limit sell on XYZ,' and the `place_order` tool handles the entire execution.
- Get instant visibility into your funds by using `get_account_summary`. You immediately know your net liquidation value and total cash balance without checking multiple statements.
- Need deep financial auditing? Instead of downloading massive data files, use `send_flex_request` to build a report reference code, then pull the results with `get_flex_statement` for focused analysis.
- Stay informed on live price changes. The `get_market_data_snapshot` tool gives you immediate pricing intelligence on specific contracts before you commit to a trade.
- Keep your work flowing without interruption. The built-in session maintenance tools ensure that your connection remains active so your agent can execute complex workflows consistently.

## How It Works

The bottom line is that your AI client talks directly to your broker account, executing complex financial tasks without you touching a single dashboard.

1. Subscribe to this MCP and provide your IBKR Client Portal API URL, along with any required Flex Web Service Token.
2. Your AI client uses the credentials to maintain an active connection session with the brokerage portal.
3. You simply tell your agent what you need—like 'Get the market data for AAPL' or 'Cancel order 1001'—and it executes the action.

## Frequently Asked Questions

**Can I use IBKR (Interactive Brokers) MCP to get historical data?**
No, this MCP focuses on real-time and generated reports. While you can pull detailed portfolio ledgers with `get_portfolio_ledger`, it doesn't function as a historical archive search tool.

**What is the difference between placing an order and modifying one using IBKR (Interactive Brokers) MCP?**
Placing an order uses `place_order` to submit something brand new. Modifying an order requires you to use `modify_order` and specify an existing, open order ID.

**Do I need a special token for IBKR (Interactive Brokers) MCP?**
Yes, depending on your account setup, the process may require an optional Flex Web Service Token to generate advanced reports via `send_flex_request`.

**How do I check my current cash balance with IBKR (Interactive Brokers) MCP?**
You simply ask your agent to retrieve the account summary. The `get_account_summary` tool provides an immediate overview of all available funds and margin metrics.

**Does this MCP support multiple currencies for tracking?**
Yes, the system is designed to monitor cash balances by currency, giving you a comprehensive view of your total assets across different denominations.