Skip to main content
Glama
DannyWolfofTech

late-interest

late-interest

UK statutory late payment interest and fixed compensation for business-to-business invoices, as a TypeScript library, a command-line tool and an MCP server. No network calls, no runtime data fetching; one small dependency pair (@modelcontextprotocol/sdk, zod) used only by the MCP server.

It runs the same tested code and the same verified Bank of England Bank Rate table as the free calculator at claimlateinterest.co.uk, which shows the working step by step and can raise the claim invoice and chase the debt for you.

Not legal advice. This package gives general information about the Late Payment of Commercial Debts (Interest) Act 1998 and does not take your contract or circumstances into account. It assumes a business-to-business debt with no contractual late payment rate. Check the sources below, and take advice if a lot is at stake or the debt is disputed. No warranty (see the MIT licence).

What it calculates

Part

Rule

Source

Interest

8% a year over the Bank of England Bank Rate, simple interest, daily rate = yearly ÷ 365, from the day after the due date

Act s.4, GOV.UK

Which Bank Rate

The rate in force on 30 June (interest starting 1 Jul to 31 Dec) or 31 December (interest starting 1 Jan to 30 Jun) immediately before interest starts, then fixed

Rate of Interest (No. 3) Order 2002, art. 4

Fixed compensation

£40 under £1,000; £70 from £1,000 to £9,999.99; £100 from £10,000. Once per debt

Act s.5A, GOV.UK

Not covered: consumer debts, contractual rates, part-payments, public-authority customers, the 60-day "grossly unfair" cap on payment terms, and extra recovery costs above the fixed sum (s.5A(2A)). Interest and compensation carry no VAT.

Bank Rate data: Bank of England, Open Government Licence v3.0. The table is bundled with each release (currently verified to 24 September 2026; the next Monetary Policy Committee decision is 5 November 2026). The package warns when a result depends on a rate it cannot know yet. The website keeps its table up to date automatically; update this package after a rate change.

Related MCP server: mcp-business-docs

Install and use

npm install late-interest        # library
npx late-interest 2500 --due 2026-06-30 --paid 2026-09-28

Library

import { lateInterest, fixedCompensation, bankRateOn } from "late-interest";

const r = lateInterest({ amount: 2500, dueDate: "2026-06-30", paidDate: "2026-09-28" });
// { daysLate: 90, bankRatePercent: 3.75, statutoryRatePercent: 11.75,
//   interest: 72.43, compensation: 70, total: 142.43, pence: { ... },
//   warnings: [], sources: { ... }, notLegalAdvice: "...", moreInfo: "https://claimlateinterest.co.uk/" }

fixedCompensation("999.99").compensation;  // 40
bankRateOn("2025-12-31").bankRatePercent;  // 3.75

Leave out paidDate for an unpaid invoice and it counts to today (UK time). Amounts may be numbers or strings like "£2,500.00"; totals are also given in whole pence (pence) so you can add them exactly. Bad input throws an Error with a plain message.

CLI

late-interest <amount> --due YYYY-MM-DD [--paid YYYY-MM-DD] [--json]
late-interest compensation <amount> [--json]
late-interest rate <YYYY-MM-DD> [--json]
late-interest history [--since YYYY-MM-DD] [--csv | --json]
late-interest mcp

Exit code 0 on success, 2 for bad input (message on stderr).

MCP server (Claude Desktop, Cursor and other MCP clients)

late-interest mcp (or the late-interest-mcp command) starts an MCP server over stdio. Nothing to install first: npx fetches it.

Claude Desktop: open Settings → Developer → Edit Config (the file is claude_desktop_config.json: ~/Library/Application Support/Claude/ on macOS, %APPDATA%\Claude\ on Windows), add the server, save and restart Claude Desktop:

{
  "mcpServers": {
    "late-interest": {
      "command": "npx",
      "args": ["-y", "late-interest", "mcp"]
    }
  }
}

Needs Node.js 18.17 or later on your PATH. Then ask Claude something like "An invoice for £2,500 was due on 30 June 2026 and paid on 28 September 2026. How much statutory interest and compensation can I claim?"

The same block works in Cursor (~/.cursor/mcp.json) and other MCP clients.

Tools (all read-only, no network): calculate_late_payment_interest, late_payment_fixed_compensation, bank_rate_on_date, bank_rate_history. Every answer includes the sources, the not-legal-advice text and a link back to the site.

How it stays the same as the website

src/core/calc.ts and src/core/baseRates.ts are copies of the calculator and Bank Rate table behind claimlateinterest.co.uk, made by scripts/sync-core.mjs (the only edit is .js on relative imports). The website's own test suite fails if the copies drift, and a new release of this package follows each Bank Rate change.

Develop

npm install
npm test        # builds, then unit tests, CLI tests and an end-to-end MCP test over stdio

Licence

MIT. Source: github.com/DannyWolfofTech/late-interest. Issues: github.com/DannyWolfofTech/late-interest/issues. Website: claimlateinterest.co.uk.

Related MCP Connectors

Related MCP Servers

  • F
    license
    Not graded
    quality
    C
    maintenance
    Enables MCP clients to search and inspect an invoice ledger, generate VAT summaries, run OCR on local documents, and use reusable prompts for chasing overdue invoices and reconciling entries.
    2
    -
  • A
    license
    Not graded
    quality
    B
    maintenance
    Enables AI assistants to call deterministic Singapore legal deadline arithmetic instead of guessing, covering Rules of Court 2021 procedural periods, Limitation Act anniversaries, contractual deemed receipt, and working-day utilities. Each tool returns a full derivation trace and requires an explicit rule id, so the rule choice and holiday data provenance stay visible in the transcript.
    1
    MIT
  • A
    license
    Not graded
    quality
    A
    maintenance
    Enables searching and reading UK legislation as it stands now, as enacted, or on any date, resolving citations to canonical items and provisions, listing amendments and effects, and tracking daily changes via the legislation.gov.uk publication log.
    172 npm
    1
    Apache 2.0