
该项目提供使用模型上下文协议(MCP)的交互代理商(IB)API接口。
概览
该项目目前处于积极开发阶段。功能可能不完整,且可能出现破坏性更改。 该项目完全基于互动经纪人Web API构建,这是一个有意为之设计选择。虽然TWS API功能强大,但Web API为项目目标提供了更现代和灵活的基础。 简短的回答是,WEB API计划更加全面。我说的更全面是指它将账户管理,特别是报表,整合到同一层面。另外两个重要原因是:1. Web API是独立的。它不需要运行TWS桌面软件或IB Gateway。2. 模型上下文协议(MCP)更容易在HTTPS通信之上构建,而不是TCP/IP套接字。 有三个原因:1. WEB API 处于测试阶段(参见限制)2.TWS 在交易中更快、更可靠。3. TWS 拥有一些 WEB API 没有的交易功能。
概述(AI 翻译)
[!注]
项目状态
该项目目前处于积极开发阶段。功能可能不完整,且可能出现破坏性变更。
动机
该项目完全基于互动经纪人Web API构建,这是一个有意为之设计选择。虽然TWS API功能强大,但Web API为项目目标提供了更现代和灵活的基础。
TWS API MCP 与 WEB API MCP 的区别?
**为什么不使用TWS API?**简短的回答是,WEB API计划更全面。我说的更全面是指它将账户管理,特别是报告,整合到同一层面。另外两个重要原因是:1. Web API是独立的。它不需要运行TWS桌面软件或IB Gateway。2. 模型上下文协议(MCP)更容易在HTTPS通信之上构建,而不是TCP/IP套接字。
如果更全面,为什么不直接用WEB API? 有三个原因:1. WEB API处于测试阶段(参见限制)2.TWS在交易中更快、更可靠。3. TWS拥有一些WEB API没有的交易功能。
本页由 AI 翻译,技术细节请以原文为准。
README
以下为原文 README 节选,完整内容请查看原文。
[!Note]
Project Status
This project is currently under active development. Features may be incomplete, and breaking changes may occur.
Motivation
This project is built exclusively on the Interactive Brokers Web API, and this is a deliberate design choice. While the TWS API is powerful, the Web API provides a more modern and flexible foundation for the goals of this project.
TWS API MCP vs. WEB API MCP?
Why not using the TWS API? The short answer is that the WEB API is planned to be more comprehensive. By more comprehensive I mean, it brings account management, specifically reporting, into the same place. The two other important reasons are: 1. The Web API is standalone. It does not require you to run the TWS desktop software or IB Gateway. 2. Model context protocols (MCPs) are easier to build on top of HTTPS communication rather than TCP/IP sockets.
If it is more comprehensive why not using just the WEB API? Three reasons: 1. WEB API is in beta (see Limitations) 2. TWS is faster and more reliable for trading. 3. TWS has some trading functionalities that the WEB API does not have.
While other projects act as a “bridge” to make the TWS API look like a web API, they introduce an unofficial, third-party dependency. This project avoids that risk by using the official IBKR Web API directly, ensuring better long-term stability and support.
In summary:
- If you need fast and reliable trading go with TWS API
- If you need a more comprehensive and cloud ready solution go with the WEB API
For a more detailed, side-by-side breakdown, please see the TWS vs. Web API Comparison section.
Table of Contents
安装
docker run -i --rm mcp/time