
Acb Tax Mcp
io.github.haiiibin由 GitHub 账号 haiiibin 发布v0.5.0更新于 Oct 24, 2026
Canadian ACB and capital gains: average-cost, per-disposition gains, superficial-loss detection.
概览
本地 MCP 服务器,根据交易记录计算加拿大调整后成本基础(ACB)与资本利得,含逐笔处置收益和表面亏损检测。
- 可以做什么
- 根据交易列表或 CSV/JSON 文件计算 ACB 与资本利得,返回持仓、逐笔处置和按年度汇总
- 报告当前持仓与账面成本,并用你提供的市价计算未实现收益
- 生成某一纳税年度的 Schedule 3 式资本利得报告,以及按证券汇总的 Schedule 3 摘要
- 按 30 天规则标记表面亏损,并给出每次事件被拒绝的金额
- 把券商原始活动导出整理为规范交易记录,并说明被跳过行的原因
- 适用场景
- 适合在加拿大非注册(应税)账户持有证券、希望让助手按 CRA 平均成本法和表面亏损规则处理交易记录而非手工表格的场景,例如查询某年度资本利得或准备 Schedule 3 申报。
- 运行要求
- 以 stdio 本地运行;需要 Python 3.10+ 和 MCP Python SDK 2.x,通过 uv tool install 或 pip install 安装(包名 acb-tax-mcp)。未声明任何账户、API 密钥或环境变量。交易需以列表或 CSV/JSON 文件路径提供,并需自行提供每笔交易的汇率,因为它不获取汇率。
安装
在 SourceWeft 中
- 打开 控制台中的 Acb Tax Mcp,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
README
acb-tax-mcp
[CI] [PyPI] [PyPI Downloads] [Python] [Glama] [MCP Registry] [Listed in awesome-mcp-servers] [License: MIT]
An MCP server that computes Canadian adjusted cost base (ACB) and capital gains from your trade history: average-cost tracking, per-disposition gains, and superficial-loss detection, returned as structured JSON.
Ask your assistant "what are my capital gains for 2024?" or "did I trigger any superficial losses?" and it runs the CRA rules over your transactions instead of you wrestling a spreadsheet.
⚠️ This is a calculation aid, not tax advice. Verify every number before you file, and consult a professional for anything non-trivial. See Limitations.
Works with Claude Desktop, Claude Code, Cursor, or any MCP-compatible client.
Features
Implements the CRA average-cost method (all shares of a security pool into one ACB; gains are against the average, not FIFO) and the superficial-loss rule (loss denied and deferred into the ACB of substitute shares bought within 30 days before or after the sale). Commissions and per-trade CAD FX conversion are handled.
Install
No install needed to try it: open the Glama server page and use Try in Browser to call the tools against a sandbox with a couple of sample transactions.
Requires Python 3.10+.
Requires MCP Python SDK 2.x (mcp>=2,<3). SDK 1.x is feature-frozen upstream and no longer supported here; 0.4.0 is the last release that ran on it.
Run from source without installing:
Configure your client
Claude Desktop
In claude_desktop_config.json:
Claude Code
Transactions
Give the tools a list of transactions (or a path to a .csv / .json file).
CSV uses the same column names as a header row. If your broker's export uses different headers ("Trade Date", "Activity Type", "Symbol", "Quantity"...), run it through normalize_broker_csv first.
Want something to try immediately? examples/sample_trades.csv is a ready-made broker-style export with aliased headers, $-formatted numbers, a DRIP row, a dividend row (skipped with a reason), a USD trade with FX, and a superficial-loss scenario. Ask your assistant to clean it with normalize_broker_csv and run calculate_acb on the result.
Usage
- "Calculate the ACB and capital gains for the trades in
~/trades.csv." - "What's my capital-gains report for 2024?"
- "Did any of these sales trigger a superficial loss?"
- "What's my current book cost for XEQT?"
- "Here's my RBC activity export -- clean it up and compute my ACB."
- "XEQT is at $35.20 and VTI at $305.40 USD (1.37 CAD): what are my unrealized gains?"
Example
Superficial loss example
Buy 100 @ $10, sell 100 @ $8 (a $200 loss), then rebuy 100 @ $8 nine days later:
The $200 loss is denied and added to the ACB of the repurchased shares (new ACB per share becomes $10), so it is recovered on a future sale.
Limitations
Read these before relying on the output.
- Average-cost, per identical property. Feed all trades of the same security across your accounts together, since the CRA rule pools identical property at the taxpayer level. The tool pools by the
securitykey you provide. - Superficial losses use the standard least-of-three test with a single forward pass. Deeply chained or overlapping superficial losses can need case-by-case professional judgment.
- Not yet handled: return of capital, reinvested/notional distributions (ETF phantom distributions), stock splits, options, and other corporate actions. These affect ACB and are on the roadmap.
- FX must be supplied per transaction (use the transaction-date rate). The tool does not fetch exchange rates.
- Registered accounts (TFSA/RRSP) do not have capital gains; this tool is for non-registered (taxable) accounts.
- Not tax advice.
Development
License
MIT. See LICENSE.
来源:README.md,提交 3408d12
工具
0版本历史
2- v0.5.0最新Oct 9, 2026
- v0.4.0Sep 16, 2026
评分
已满足适用检查项的 50%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分