Skip to main content
Glama
finance-mcp

finance-mcp

Does your AI agent still do loan, VAT and cost-split arithmetic in its head? finance-mcp is a small MCP server that gives it exact decimal tools instead: loan payments and schedules, NPV, IRR, future value, VAT, and splitting a sum to the cent. No network, no files, zero dependencies.

finance-mcp

Exact money arithmetic for AI agents, checked through the real protocol.

CI License: MIT Python 3.10+ Dependencies: 0

Real output on made-up numbers, made with readme-shots.


Why

Language models are good at deciding that a loan payment or a VAT split is needed and unreliable at computing it: a rounding slip of one cent, a balloon with the wrong sign, a split of 100.00 into three parts that adds up to 99.99. These tools do the arithmetic with Decimal, return amounts as strings so no digit is lost, and say so plainly when an argument is wrong so the model can correct it.

Related MCP server: Polymath MegaBlaster MCP

Quick start

pip install git+https://github.com/purkat0301-sys/finance-mcp

Add it to an MCP client (stdio), for example in a client's mcpServers config (examples/mcp-config.json):

{ "mcpServers": { "finance": { "command": "finance-mcp" } } }

Try a tool without any client:

finance-mcp tools
finance-mcp call vat '{"amount":"119.00","rate_pct":19,"mode":"gross"}'
finance-mcp call allocate '{"amount":"100.00","weights":[1,1,1]}'

Tools

Tool

What it does

pmt

Level payment for a loan (rate, periods, payments per year, optional balloon, payment at start or end).

loan_schedule

Schedule in whole cents: rounded payment, rounded interest each period, last payment clears the balance. Totals plus the first max_rows rows.

fv

Future value of regular payments and a starting amount.

npv

Net present value; the first flow is discounted one period like spreadsheet NPV, or set first_flow_at_time_zero.

irr

Internal rate of return, searched from -99.99% to 1,000,000%; with several roots, the one nearest the guess.

allocate

Split an amount by weights so the parts add up exactly (largest remainder, ties to the earlier weight).

vat

Net, VAT and gross from a net or a gross amount, VAT rounded half away from zero.

Every tool is read-only and offline. Bad arguments come back as a tool error with a message (for example "periods must be between 1 and 1200"), not a protocol error. Numbers can be JSON numbers or strings; use strings for exact digits. Limits: 1,200 periods, 1,000 cash flows, magnitudes up to 1e15.

What was measured

docs/EVAL.md has the numbers. Every call goes through the server over stdio using the official MCP Python SDK as the client.

  • 6,000 calls to pmt, fv, npv, irr and vat compared with LibreOffice Calc formulas: 0 differences, after two bugs the first run found (a balloon with the wrong sign, and an IRR search range that stopped at 1,000%).

  • 1,000 loan schedules (233,544 cells) compared with a LibreOffice sheet using the same rounding recurrence: 0 cells differ. The recurrence is my design choice, so this checks the arithmetic, not that your lender rounds the same way.

  • 20,000 allocations checked with exact fractions: the parts always add up to the amount and stay within a cent of their exact share.

  • The SDK client validates all 7 input schemas and gets tool errors for 7 of 7 bad calls.

  • The harness is not blind: a flipped balloon sign, half-even VAT rounding and an allocation without its remainder step were each caught. 55 unit tests, on Python 3.10 to 3.13.

Limits

  • Arithmetic only: no day counts (actual/365, 30/360), fees, variable rates, tax rules or currencies. Check a lender's conventions before relying on a schedule.

  • The server speaks the handshake-era MCP versions (2024-11-05 to 2025-11-25) over stdio. The newer discover-based era is not implemented; the official SDK falls back correctly, other clients are untested.

  • It does not verify that a model passes the right numbers.

Compared with other options

  • A spreadsheet or a Python REPL tool gives the same answers if the model writes the right formula; this exposes a fixed set so there is nothing to get wrong. Not run as an alternative.

  • A GitHub search on 2026-11-29 for MCP loan and finance calculators found one small project; I did not run it and make no claim about it.

Develop

python -m pip install -r requirements-dev.txt -e .
python -m pytest

eval/ needs the mcp SDK and LibreOffice and is not run in CI. Dependencies are pinned in requirements-dev.txt, and the workflow actions are pinned to commit SHAs. Plan: ROADMAP.md. Changes: CHANGELOG.md.

License

MIT, see LICENSE.

Available Tools

7 tools
allocateA
Read-onlyIdempotent

Split an amount in proportion to weights so that the parts add up to the amount to the cent (largest-remainder rounding). Use it for splitting costs, fees or discounts across lines.

Inputs: amount (required), weights (required), decimals.

fvB
Read-onlyIdempotent

Future value of regular payments plus a present amount at a fixed rate. Payments and present value are positive amounts you put in; the result is what it grows to.

Inputs: periods (required), type, payment, present_value, +2 more.

irrA
Read-onlyIdempotent

Internal rate of return of periodic cash flows (first flow at time 0). Needs at least one positive and one negative flow.

Inputs: cash_flows (required), guess.

loan_scheduleB
Read-onlyIdempotent

Amortisation schedule in whole cents: rounded payment, rounded interest each period, the last payment clears the balance. Returns totals and the first max_rows rows.

Inputs: periods (required), principal (required), payment, max_rows, +2 more.

npvA
Read-onlyIdempotent

Net present value of a list of cash flows at a discount rate. By default the first flow is discounted one period, as spreadsheet NPV does; set first_flow_at_time_zero to leave it undiscounted.

Inputs: rate_pct (required), cash_flows (required), first_flow_at_time_zero.

pmtA
Read-onlyIdempotent

Level payment for a loan: the amount to pay each period so that the principal is repaid with interest over the given number of periods. Exact decimal arithmetic.

Inputs: periods (required), principal (required), type, future_value, +2 more.

vatA
Read-onlyIdempotent

Split an amount into net, VAT and gross at a rate, rounding VAT half away from zero. mode 'net': the amount excludes VAT; 'gross': it includes VAT.

Inputs: amount (required), rate_pct (required), mode, decimals.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.7/5.0

    Scored across 7 tools

    Disambiguation4/5

    Each tool maps to a distinct financial computation: npv vs irr (valuation vs rate), fv vs pmt (growth vs loan payment), and allocate/vat are clearly separate operations. The only mild overlap is pmt vs loan_schedule, though the descriptions make clear one returns a single payment and the other a full amortisation table.

    Naming Consistency5/5

    All names are short lowercase domain terms, with snake_case used only for the one multi-word tool (loan_schedule). This is a predictable, consistent convention (abbreviation or snake_case for compounds) with no style mixing.

    Tool Count5/5

    Seven tools is a tight, well-scoped set for a finance calculator; each one covers a distinct and non-redundant computation, with no filler or wrapper tools.

    Completeness4/5

    The core time-value-of-money surface is well covered (npv, irr, fv, pmt, loan_schedule) plus allocation and VAT, so common workflows have no dead ends. Gaps are minor: no date-based XNPV/XIRR and no nominal/effective rate conversion, but agents can work around these.

    Maintenance

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      B
      quality
      B
      maintenance
      Enables AI agents to perform accurate local computations including arbitrary-precision math, date handling, unit conversion, subnet calculations, encoding, hashing, and text analysis, all without network calls or API keys.
      27
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables AI agents to perform exact-decimal double-entry accounting by calling tools that compute money, validate and post entries, verify equations, and produce deterministic audit hashes and citation-grounded artifacts.
      261 npm
      1
      MIT
    • A
      license
      A
      quality
      B
      maintenance
      Enables LLM agents to perform precise decimal-only calculations across tax, payroll, finance, statistics, engineering, and other domains, returning calculation traces and verifiable receipts. It supports batched and pipelined tool calls with policy-aware, date-sensitive computations.
      286
      30 PyPI
      8
      MIT