# IBKR MCP for AI Agents AI Agent Connect

> IBKR (Interactive Brokers) MCP connects your brokerage account to your AI agent. It lets you execute trades, monitor portfolio balances, and fetch real-time market data using the Client Portal API. You can manage orders, check equity, and pull custom Flex Query reports directly through your favorite AI client.

## Overview
- **Category:** money-moves
- **Price:** Free
- **Endpoint:** https://edge.vinkius.com/vk_preview_xp4s1NSzeXGqzXShxPUtPXD75cMRT4iS4I9xpM5k/ai-agent-connect
- **Tags:** trading, brokerage, portfolio-management, market-data, investing, financial-api

## Description

Connecting your brokerage account to an AI agent changes how you handle market volatility. Instead of jumping between multiple tabs to check your margin, monitor cash balances, or place manual orders, you can just ask your agent to do it for you. It handles the heavy lifting of navigating the Interactive Brokers platform so you can stay focused on your strategy. You can pull specific market snapshots to help with your next move or grab detailed financial reports for your end-of-month auditing. If you're looking for a way to bring these capabilities into a unified workspace, Vinkius makes it easy to get this Connector connected to your existing setup. Whether you're looking to automate repetitive order modifications or just want a quick summary of your portfolio's health, this connection gives your agent the direct access it needs to act on your behalf. It takes the friction out of professional trading by turning complex account management into simple conversations.

## Tools

### get_account_summary
See your current net liquidation value, cash balance, and margin metrics. It gives you a high-level look at your account health.

### cancel_order
Stop an existing order immediately. This is useful when you need to pull out of a position fast.

### get_flex_statement
Retrieve a pre-configured Flex Query report. Use this to get detailed data for auditing or deep analysis.

### get_market_data_snapshot
Get a real-time snapshot for specific contracts. It helps you see the latest prices before making a move.

### modify_order
Update the details of an active order. You can change quantities or prices without starting over.

### place_order
Submit new orders using a JSON array of order objects. This lets your agent execute trades based on your instructions.

### get_portfolio_ledger
View your portfolio ledger to see all your recent transactions. It's the best way to track your history.

### send_flex_request
Generate a new Flex Query report and get a reference code. This is the first step for pulling custom data.

### tickle_session
Keep your API session active. It ensures your agent doesn't lose connection during long tasks.

## Prompt Examples

**Prompt:** 
```
Check my current margin and net liquidation value.
```

**Response:** 
```
I've pulled your account summary. Your Net Liquidation Value is **$50,230.45**, with a Total Cash Balance of **$12,400.10** and a Maintenance Margin of **$15,000.00**.
```

**Prompt:** 
```
Get the market price for ConId 265598.
```

**Response:** 
```
The current market snapshot for ConId 265598 (AAPL) shows a last price of **$185.92**, with a daily change of **+1.2%**.
```

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

**Response:** 
```
I've sent the cancellation request for order 1001 on account U1234567. The status has been updated to **'Cancelled'**.
```

## Capabilities

### Place new orders
Send a JSON array of order objects to your brokerage account to execute trades.

### Cancel existing orders
Stop an active order immediately using its specific ID.

### Modify current orders
Update the details of an order that is already in the system.

### Fetch market snapshots
Get real-time price data for specific contracts to inform your next move.

### Pull portfolio ledgers
View your full history of transactions and holdings in one place.

### Request Flex reports
Generate custom reports for deep financial analysis and auditing.

### Check account summaries
See your net liquidation value and margin metrics at a glance.

## Use Cases

### Quick Order Adjustment
An active trader needs to change the quantity on a pending buy order. They tell the agent to use modify_order to update the trade instantly.

### End of Month Audit
A financial analyst needs a specific report of all trades. They ask the agent to use send_flex_request followed by get_flex_statement to get the data.

### Real-time Monitoring
A developer wants to see the current price of a stock. They ask the agent to use get_market_data_snapshot for a specific ConId.

### Portfolio Health Check
A user wants to know how much margin they have left. They ask the agent to use get_account_summary to see their current balances.

## Benefits

- Execute trades faster by using place_order to submit new positions with simple commands.
- Monitor your risk in real time by checking get_account_summary to see your margin and equity.
- Simplify your research by grabbing get_market_data_snapshot for specific contracts instantly.
- Automate your reporting by using send_flex_request and get_flex_statement for custom data.
- Keep your workflow fluid with tickle_session to maintain a constant connection to your account.

## How It Works

The bottom line is you get a direct bridge between your brokerage account and your AI agent for faster execution and better monitoring.

1. Subscribe to this Connector on the Vinkius Marketplace.
2. Provide your IBKR Client Portal API URL and your Flex Web Service Token.
3. Start asking your AI client to manage trades or fetch data.

## Frequently Asked Questions

**How does the IBKR MCP help with my trading?**
It lets your AI agent execute trades and monitor your account directly. You can place, modify, or cancel orders without leaving your chat window.

**Can I use the IBKR MCP to see my portfolio history?**
Yes, it can pull your full portfolio ledger. This makes it easy to see every transaction and your current holdings in one place.

**Does the IBKR MCP support custom reports?**
It supports Flex Query reports. You can ask your agent to generate a report and then pull the data for your analysis.

**How do I keep my IBKR session active?**
The Connector includes a tool to keep your session alive. This prevents your agent from getting disconnected while it's working on complex tasks.

**Is the IBKR MCP safe for my account?**
It uses the official Client Portal API. You just need to provide your own URL and tokens to keep your connection secure.

**Can I use this to check real-time prices?**
Yes, you can fetch market data snapshots for specific contracts. This helps you make informed decisions based on current prices.

**How do I prevent my IBKR API session from timing out?**
You can use the `tickle_session` tool. It is designed to maintain the Client Portal API session by sending a heartbeat, preventing timeouts due to inactivity.

**Can I retrieve historical trade reports through this server?**
Yes. First, use `send_flex_request` with your Flex Query ID to generate a report. Then, use the returned Reference Code with `get_flex_statement` to download the data.

**How do I check my current buying power and margin requirements?**
Use the `get_account_summary` tool with your Account ID. It returns a comprehensive summary of equity, margin, and other key financial metrics for the specified account.