Back to MCP directory
publicPublicdnsLocal runtime

ibkr-mcp-server

一个基于FastAPI的应用,用于通过IBKR API获取投资组合详情

article

README

🚀 IBKR MCP 服务器

本项目是一个基于 FastAPI 的应用程序,通过与 Interactive Brokers (IBKR) API 对接,能够便捷地获取投资组合详情,为投资管理提供有力支持。

🚀 快速开始

本项目是一个基于 FastAPI 的应用程序,通过与 Interactive Brokers (IBKR) API 对接,能够便捷地获取投资组合详情,为投资管理提供有力支持。

✨ 主要特性

  • 基于 FastAPI 构建,具备高性能和良好的可扩展性。
  • 与 Interactive Brokers (IBKR) API 对接,可获取投资组合详情。

📦 安装指南

  1. 克隆仓库
    git clone <repository-url>
    cd ibkr-mcp-server
    
  2. 创建虚拟环境
    python -m venv venv
    source venv/bin/activate  # 在 Windows 上使用 `venv\Scripts\activate`
    
  3. 安装依赖项
    pip install -r requirements.txt
    
  4. 设置环境变量: 创建根目录中的 .env 文件,并添加您的 IBKR API 凭证。
  5. 运行应用程序
    uvicorn app.main:app --reload
    

💻 使用示例

基础用法

一旦服务器启动,您可以通过访问 API 端点来获取投资组合详情。API 文档将在 http://localhost:8000/docs 可用。

📚 详细文档

项目结构

ibkr-mcp-server
├── app
│   ├── __init__.py
│   ├── main.py
│   ├── api
│   │   ├── __init__.py
│   │   └── endpoints
│   │       ├── __init__.py
│   │       └── portfolio.py
│   ├── core
│   │   ├── __init__.py
│   │   └── config.py
│   ├── models
│   │   ├── __init__.py
│   │   └── portfolio.py
│   └── services
│       ├── __init__.py
│       └── ibkr_service.py
├── requirements.txt
├── .env
└── README.md

📄 许可证

该项目在 MIT License 下开源。

help

Runtime guide

cloud

Hosted runtime

Hosted servers run from a provider-managed environment. You usually connect the MCP client to the hosted endpoint or follow the provider's authorization flow, without keeping a local process alive

  1. Open provider connection page
  2. Authorize or copy endpoint
  3. Connect from your MCP client
terminal

Local runtime / other methods

Local servers run on your own machine or infrastructure. You normally copy the server_config into your MCP client, install the required package, and provide env variables from env_schema when needed

  1. Copy server_config
  2. Install required package
  3. Fill env variables and restart client