Canary MCP

io.github.osauer由 GitHub 账号 osauer 发布v3.35.0更新于 Nov 7, 2026

Read-only IBKR MCP: account, positions, brief, regime, stress, reporting, Edge, and risk.

已验证STDIO仅桌面金融数据与分析

概览

AI 生成的概览

只读的 MCP 服务器,让助手查看 Interactive Brokers 账户:持仓、敞口、风险检查、市场状态、压力测试与交易结果。

可以做什么
  • 读取账户信息、持仓以及按标的汇总的敞口
  • 按你设定的限额执行纪律检查,并指出哪些持仓越限
  • 查看每日简报,了解变化与需要关注的事项
  • 查看市场状态、组合压力测试,以及历史交易后价格走势的 Edge 读数
  • 生成账户报告,并提示缺失或过期的数据
  • 任何版本都不向助手提供下单或预览工具
适用场景
适合让 AI 助手回答关于 IBKR 账户与风险状况的问题,例如今天需要关注什么、哪些限额被突破,同时不赋予它任何交易能力。
运行要求
需在本机与已开启 API 套接字访问的 IB Gateway 10.37+ 或 TWS 一同运行,支持 macOS 或 Linux(arm64 或 amd64,Windows 仅可通过 WSL)。需要 IBKR Pro 账户,模拟盘或实盘均可。以签名二进制或 Claude Desktop 的 MCP Bundle 安装;其他宿主需以二进制绝对路径加 mcp 参数启动。
安装前请注意
服务器会读取真实的券商账户数据,返回内容应视为敏感信息。标准版本不含下单路径,MCP 服务器也不提供下单或预览工具,但另有一个可执行已授权订单的交易版本,除非确有需要,不要安装。通过 OpenD 支持 moomoo/Futu 属实验性功能,测试有限,其敞口数字不覆盖整个账户。与 Interactive Brokers 无关联,所显示内容不构成投资建议。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Canary MCP,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

Canary

[ci] [release] [license]

繁體中文:網站及入門指南 · 简体中文:网站及入门指南

A risk desk for your Interactive Brokers account. It reads your account for you and your AI agent, checks it against your limits, and, in the trading build, places the trades you authorise.

Canary runs beside your IB Gateway or TWS and nothing runs on a server of mine. It tells you what needs attention today. It runs twenty discipline checks against limits you set and names the ones your positions breach. It shows exposure by underlying. Canary Edge shows what the price did 1, 5 and 20 sessions after your past stock and ETF trades, from your broker statements, where a decision repeated often enough to count. The same readings come as text, as JSON, in a paired phone app, and as MCP tools for Claude Desktop, Claude Code, Cursor or Zed.

It comes in two builds. The standard binary reads; it has no compiled order path. The trading binary, a separate download, also executes orders, and only the ones you authorised: a transaction you confirmed, or a close or reduction the daemon runs under a bucket you listed in your written policy, a list that ships empty. Every order is pinned to one account, client ID and mode, consumes a preview token for that exact draft, is journaled with its origin before it is sent, and passes the risk policy's order limits, the mandate gate and the freeze. An agent trades only through the gated CLI. The MCP server has no order or preview tool in any build. Canary never decides a trade on its own.

Documentation · Install · First session · Agentic trading · Canary Edge · MCP tools · Safety · Privacy

Start

You need IB Gateway 10.37+ or TWS with API socket access enabled, an IBKR Pro account, and macOS or Linux on arm64 or amd64. Paper and live both work. There is no Windows build; use WSL.

Terminal, and every MCP host. One signed binary in ~/.local/bin:

sh
curl -fsSL https://raw.githubusercontent.com/osauer/canary/main/install.sh | shcanary status    # show which Gateway and account Canary reachedcanary brief     # review what changed and what needs attention

The install guide shows how to inspect the script first and covers every other installation path.

Claude Desktop. Download the MCP Bundle, canary.mcpb, open it with Claude Desktop, then quit and relaunch Claude. The walkthrough covers the first connection.

Any other MCP host. Install the binary as above, then point the host at its absolute path; which canary prints it.

json
{  "mcpServers": {    "canary": {      "command": "/ABSOLUTE/PATH/TO/canary",      "args": ["mcp"]    }  }}

A first question that works in any host:

What needs attention today, and which data is missing or stale?

[Canary Edge, rendered from synthetic data: a decision review, its coverage, and price outcomes]

Canary Edge in the paired app, rendered from synthetic data: what the price did after past decisions, and how much evidence supports each row.

Ways in

You want to…Start withWhat you get
Ask an agent about the accountThe MCP Bundle, or canary mcp from any local framework that can launch a stdio MCP serverRead-only tools; the MCP server has no order or preview tool
Work in a terminal or scriptcanary brief, canary positions --by underlying, and --jsonEvery reading as text or JSON, from the same source as the app and the MCP tools
Check the desk from a phonecanary app, then canary app pairA paired web app on your phone; local by default, remote access optional
Read Canary from your own Go programgithub.com/osauer/canary/v2, the daemon clientThe daemon's read methods over its local socket; its one submit method is served by a trading daemon only
Build directly on the TWS protocolgithub.com/osauer/canary/v2/pkg/ibkrA low-level transport; it carries no policy, authorisation or journal, those stay in your program

MCP hosts

Ask plain questions rather than naming tools. The host guide covers Claude Code, Cursor, Zed, continuously running agents, logs, and connection checks. The generated MCP reference lists every tool and its schema.

Terminal and paired app

Every data command supports --json:

sh
canary accountcanary positions --by underlyingcanary edgecanary rulescanary regime --explaincanary stress --details

Run canary status first for connection problems and canary data health for missing or stale data. canary --help and the CLI reference list every command and flag.

For the paired app, run canary app on the machine that owns the Gateway or TWS session, then run canary app pair and scan the QR code. The app guide covers pairing, remote access, and push notifications.

Experimental: moomoo and Futu through OpenD

Canary can also read a Futu or moomoo account through OpenD, Futu's local gateway, while OpenD is running and logged in. This support is experimental. Reading balances and holdings, order and fill history, and converting to the base currency have been tested only against a stand-in for OpenD written for Canary's tests, so check what Canary shows against your broker. Canary cannot place, change or cancel orders through OpenD: it refuses the request and sends nothing to your broker.

Add this to ~/.config/ibkr/config.toml:

toml
[broker]kind = "opend"

With one real account on your login, Canary uses it. With several, it picks none: canary status lists them, and you set account under [opend] to its id. A simulated account is never picked: to use one, set account to its id.

With this setting, Canary shows account balances and stock and ETF positions, and quotes for the Hong Kong and US markets where your OpenD login has the quote rights; no other market's quotes have been read. A holding in a market without a quote right shows the price OpenD reports with the holding, not a market quote. Options, futures and anything else in the account appear in a separate list at the value OpenD reports, unconverted and not checked by Canary. Canary's exposure figures and checks against your limits do not count them, so those figures do not cover your whole account. Holdings outside the account's base currency are converted at a rate worked out from OpenD's own account totals, not a quoted rate; where that is not possible they are not measured, and the checks against your limits report that they cannot judge them. Many features are not available, among them daily P&L, the regime, portfolio stress, Edge, statement reporting, the market overview, the market tape and technical analysis; canary status lists most of them. Canary with moomoo and Futu has the details.

Each daemon serves one broker. To run OpenD beside IBKR, start a second daemon with its own XDG_CONFIG_HOME, XDG_STATE_HOME, XDG_CACHE_HOME, XDG_RUNTIME_DIR and CANARY_SOCKET. The configuration reference lists every key.

Go wire-protocol library

[pkg/ibkr coverage]

pkg/ibkr is a clean-room Go library for the TWS wire protocol. It transports broker requests only. Its API reference is on pkg.go.dev, and its statement coverage is updated on each push to main as a line-by-line report.

go install github.com/osauer/canary/v2/cmd/canary@latest installs the v2 CLI, not the current v3 release; use the installer for the binary. Start with the package documentation and the wire protocol page.

Safety and privacy

The standard binary has no compiled order path, and the installer, updater and MCP Bundle never install the trading binary. The trading binary executes what you authorised and nothing else. The daemon checks every order at preview, at admission and at the final send: account, client ID and mode pins, the preview token for that draft, the journal entry written before the send, the risk policy's order limits, the mandate gate and the freeze. Gated orders has the detail.

Canary has no telemetry and does not send account IDs, balances, quantities, or P/L to the maintainer. PRIVACY.md is the data map. SECURITY.md covers the threat model and signed releases.

Documentation and legal

Canary is an independent third-party client for Interactive Brokers' publicly documented TWS API. It is not built, endorsed, sponsored, or supported by Interactive Brokers Group, Inc. or its affiliates. pkg/ibkr redistributes no Interactive Brokers code, libraries, jars, or market data. Canary's OpenD client is likewise independent and is not built, endorsed, sponsored, or supported by Futu or its affiliates; pkg/futu includes protocol definitions from Futu's public client under the Apache License 2.0, as its notice sets out. Nothing here is investment advice.

Canary is a private project of Oliver Sauer.

MIT. See LICENSE.

来源:README.md,提交 e3994f3

工具

0
SourceWeft 尚未在沙箱中启动过该软件包,因此其工具未知。

版本历史

37
  1. v3.35.0最新Nov 7, 2026
  2. v3.34.1Nov 5, 2026
  3. v3.33.1Nov 4, 2026
  4. v3.33.0Nov 3, 2026
  5. v3.32.1Oct 31, 2026
  6. v3.32.0Oct 30, 2026
  7. v3.31.0Oct 30, 2026
  8. v3.30.0Oct 29, 2026
  9. v3.27.1Oct 23, 2026
  10. v3.26.3Oct 21, 2026
  11. v3.26.2Oct 20, 2026
  12. v3.26.1Oct 20, 2026
  13. v3.25.4Oct 20, 2026
  14. v3.25.3Oct 19, 2026
  15. v3.25.1Oct 19, 2026
  16. v3.24.2Oct 18, 2026
  17. v3.22.2Oct 18, 2026
  18. v3.21.1Oct 11, 2026
  19. v3.20.1Oct 10, 2026
  20. v3.19.2Oct 8, 2026
  21. v3.19.0Oct 7, 2026
  22. v3.18.1Oct 6, 2026
  23. v3.17.0Oct 4, 2026
  24. v3.16.1Oct 3, 2026
  25. v3.16.0Oct 2, 2026
  26. v3.15.0Oct 1, 2026
  27. v3.14.0Sep 30, 2026
  28. v3.13.0Sep 27, 2026
  29. v3.12.1Sep 24, 2026
  30. v3.12.0Sep 23, 2026
  31. v3.11.0Sep 23, 2026
  32. v3.10.0Sep 22, 2026
  33. v3.9.2Sep 20, 2026
  34. v3.9.0Sep 20, 2026
  35. v3.8.0Sep 19, 2026
  36. v3.7.0Sep 18, 2026
  37. v3.6.0Sep 16, 2026

评分

已满足适用检查项的 50%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分