Whether a discount bond's accretion is capital gain or ordinary income

One command on the Municipal bonds server, callable over MCP as calculate_muni_discount, filed in the registry as Market discount and de minimis. Every result carries the method it used, the rule pack it was pinned to, what is still missing and whether coverage was complete, for a licensed professional to review.

What it needs, and why

Every input is checked before anything is calculated. Nothing is required to start, and a field left blank means do not apply this rather than zero.

InputWhat it asks forWhy it mattersIf you omit it
purchase_pricePurchase priceDiscount and premium are both measured from what was paid against the redemption price.defaults to 950
redemption_priceRedemption price at maturityThe other end of that measurement, which is not assumed to be par.defaults to 1000
years_to_maturityComplete years to maturityThe de minimis threshold and the amortization schedule are both a function of the remaining term.defaults to 10

Requests it answers

  • “Is my discount bond's accretion ordinary income?”
  • “Where is the de minimis line on a discount bond?”

An agent with these skills loaded picks the command from phrasing like that, asks for whatever input is missing, and reports the figures with the method that produced them.

Run it

scripts/mcp_server.sh --server muni

The same command is exposed by taxagent-muni, so Claude, Claude Code, Codex, Cursor and any other MCP client can call it directly. Analysis only. No tool in this server places orders, modifies custodian records or files returns. This server holds no client data: every figure arrives in the call and nothing is stored. Results are estimates over those figures, not a return and not tax advice. Whether a bond is a private activity bond, and what any state charges, are supplied by the caller rather than looked up.

Scripted cases that exercise it

3 of the 71 console cases call this command on a real server over JSON-RPC and assert the outcome. Every one runs on every build, and all of them are listed on the case inventory.

CaseWhat it asksWhat it showsOutcome
muni-discount-is-ordinaryBought below par, taxed at the top rateA $50 discount against a $25 threshold: accrued market discount is ordinary income on disposition. The interest stays exempt; the discount does not.completed
muni-discount-de-minimisA smaller discount stays capital$20 against the same $25 threshold is treated as zero, so the gain on redemption is capital. The margin is what a buyer can act on.completed
muni-discount-short-maturityThe same discount on a two-year bondThe threshold is a quarter point per year, so two years allows only $5. Maturity drives this more than price does.completed

Limits it inherits from taxagent-muni

  • Whether a bond is a private activity bond. That is a fact about the issue, and it decides whether the interest is an AMT preference.
  • Any state's treatment of its own or another state's bonds. The holder's state rate is supplied by the caller, not looked up.
  • Credit risk, call features, duration and liquidity, none of which a yield comparison sees.
  • Original issue discount accrual schedules, and the constant-yield premium schedule the statute requires: amortization is shown straight-line, which reaches the same place at maturity.
  • The effect of exempt interest on how much Social Security is taxable, which is real and is why 'tax-free' overstates it.

The server, its other 3 commands and what it deliberately leaves alone are on the Municipal bonds page.