
hellek1/ib-mcp
Developer toolsこのページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。 原文を見る
モデル コンテキスト プロトコル (MCP) サーバは ib async + FastMCP 経由でインタラクティブなブローカーデータを公開
概要
軽量モデルコンテキストプロトコル(MCP)サーバーは、非同期の ib async ライブラリと FastMCP を使用して、読み取り専用のインタラクティブブローカーデータ(コントラクト、履歴データ、基本、ニュース、ポートフォリオ、アカウント)を公開しています。 財務データをLMワークフローや自動運転エージェントに供給し、取引を無効にしておくのに最適です。 このディレクトリには、 ib async ライブラリをラップする MCP (Model Context Protocol) サーバが含まれているため、LLM はインタラクティブ・ブローカーのデータとやり取りすることができます。 MCP サーバーでは、LMM のインタラクションに関する次のツールを提供しています。 - : 入札記号とオプションの交換/通貨で契約の詳細を調べる - : 入札記号を契約IDに変換(契約) - : 設定可能な期間、バーサイズ、データ型で過去の市場データを取得 - : リストオプションチェーンパラメータ(有効期限とストライキ)をアンダーリングし、ストライク範囲のフィルタリングとペジネーション - : バッチ入札/ask/last/close、オプションリストのIV/deltaをモデル化します。 デフォルトでは、フロゼンデータ(OPRAなし...
概要(AI 翻訳)
読み取り専用のインタラクティブブローカーデータ(コントラクト、履歴データ、基本情報、ニュース、ポートフォリオ、アカウント)を非同期[[T0]ライブラリと[FastMCPを介して公開する軽量モデルコンテキストプロトコル(MCP)サーバー。 財務データをLMワークフローや自動運転エージェントに供給し、取引を無効にしておくのに最適です。
概要
このディレクトリには、 ib async ライブラリをラップする MCP (Model Context Protocol) サーバが含まれているため、LLM はインタラクティブ・ブローカーのデータとやり取りすることができます。
##特徴
MCP サーバーでは、LMM のインタラクションに関する次のツールを提供しています。
##1. 契約検索と変換
- lookup contract: 入札記号とオプションの交換/通貨で契約の詳細を見る
- ticker to conid: 入札記号を契約 ID に変換 (conid)
##2. 市場データ -get historical data: 設定可能な期間、バーサイズ、データ型で履歴市場データを取得
##3. オプション -get option chain: リストオプションチェーンパラメータ(有効期限とストライキ)をアンダーリングし、ストライキレンジフィルタリングとパジネーション
このページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。
README
以下は原文 README の抜粋です。原文を見る。
IB Async MCP Server
Lightweight Model Context Protocol (MCP) server exposing read-only Interactive Brokers data (contracts, historical data, fundamentals, news, portfolio, account) via the asynchronous ib_async library and FastMCP. Ideal for feeding financial data into LLM workflows and autonomous agents while keeping trading disabled.
Overview
This directory contains an MCP (Model Context Protocol) server that wraps the ib_async library to allow LLMs to interact with Interactive Brokers data.
Features
The MCP server provides the following tools for LLM interaction:
1. Contract Lookup and Conversion
- lookup_contract: Look up contract details by ticker symbol and optional exchange/currency
- ticker_to_conid: Convert ticker symbol to contract ID (conid)
2. Market Data
- get_historical_data: Retrieve historical market data with configurable duration, bar size, and data type
3. Options
- get_option_chain: List option-chain parameters (expirations and strikes) for an underlying, with strike-range filtering and pagination
- get_option_quotes: Batch bid/ask/last/close and model IV/delta for a list of option strikes; defaults to delayed-frozen data (no OPRA subscription required)
- get_index_quote: Spot quote (last/close/bid/ask) for an index, useful for strike-from-spot calculations
4. News
- get_news: Retrieve current news articles for a contract
- get_historical_news: Retrieve historical news articles within a date range
5. Fundamental Data
- get_fundamental_data: Retrieve fundamental data including financial summaries, ownership, financial statements, and more
6. Portfolio and Account Information
- get_portfolio: Retrieve portfolio positions and details
- get_account_summary: Retrieve account summary information
- get_positions: Retrieve current positions with contract metadata, including option expiry/strike/right/multiplier fields
Prerequisites
-
Interactive Brokers Account: You need an active IB account
-
IB Gateway or TWS: Download and install either:
- IB Gateway (Stable) - Recommended for API-only use
- IB Gateway (Latest) - Latest features
- Trader Workstation (TWS) - Full trading platform
-
API Configuration:
- Enable API access in TWS/Gateway:
Configure → API → Settingsand check “Enable ActiveX and Socket Clients” - Set appropriate port (default: 7497 for TWS, 4001 for Gateway)
- Add
127.0.0.1to trusted IPs if connecting locally
- Enable API access in TWS/Gateway:
Installation
From source (development)
インストール
docker run --rm --add-host host.docker.internal:host-gateway -e IB_HOST=host.docker.internal -e IB_PORT=7497 -e IB_CLIENT_ID=1 ghcr.io/hellek1/ib-mcp:latest設定
{
"mcpServers": {
"ib-async": {
"command": "docker",
"args": [
"run",
"--rm",
"--add-host","host.docker.internal:host-gateway",
"-e","IB_HOST=host.docker.internal",
"-e","IB_PORT=7497",
"-e","IB_CLIENT_ID=1",
"ghcr.io/hellek1/ib-mcp:latest"
]
}
}
}