acb-tax-mcp
以下摘录自该仓库的 README(片段) · 在 GitHub 读完整 README →
> 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
| Tool | What it does |
|---|---|
| calculate_acb | Full calculation: current holdings (shares, total ACB, ACB per share), every disposition with proceeds/ACB/outlays/gain, per-year summaries, and warnings. |
| acb_summary | Just current holdings and their book cost (handy for unrealized gains against a market price). |
| capital_gains_report | A Schedule-3-style report for one tax year: each disposition plus totals, net capital gain, and taxable gain (50% inclusion). |
| schedule3_summary | One aggregated row per security in the exact Schedule 3 column shape: shares, gross proceeds, ACB, outlays (commissions), gain/loss after the superficial-loss rule, acquisition years, and totals -- the lines you actually transcribe when filing. |
| check_superficial_losses | Flags losses caught by the 30-day rule, with the denied (deferred) amount per event. |
| unrealized_gains | Current holdings' ACB against market prices you supply: per-position and total unrealized gain in dollars and percent (foreign-quoted securities take a price + fx_rate pair). |
| normalize_broker_csv | Turns a raw broker activity export into clean transactions: maps common column aliases ("Trade Date", "Activity Type", "Quantity"...), keeps buy/sell rows (DRIP counts as a buy), cleans "$1,200"/"(9.95)" formats, and reports every skipped row with a reason. |
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).
| Field | Required | Notes |
|---|---|---|
| date | yes | YYYY-MM-DD |
| action | yes | buy or sell |
| security | yes | ticker / symbol (pooled by this key) |
| shares | yes | positive number |