npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@colgonics/finance-calc-mcp

v1.0.0

Published

Local MCP server for basic arithmetic and common finance calculations (loans, interest, depreciation, dividend MTM). Uses decimal.js for precision-safe money math — no float drift.

Readme

finance-calc-mcp (Node.js)

A local MCP server that provides basic arithmetic plus common finance calculations. Same calculations as the Python version, in Node. Uses decimal.js throughout — no floating-point errors in money math.

Install

cd finance-calc-mcp
npm install

That's it. No build step (this is plain ES modules, no TypeScript).

Verify it works:

npm test

You should see "All tests passed." Optionally, sanity-check the live MCP server against itself by running node probe.js, which spawns the server as a subprocess and exercises a couple of tools.

Wire into Claude Desktop

Edit claude_desktop_config.json:

  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json

Add:

{
  "mcpServers": {
    "finance-calc": {
      "command": "node",
      "args": ["C:/absolute/path/to/finance-calc-mcp/src/index.js"]
    }
  }
}

Restart Claude Desktop. The 17 finance tools should show up.

Use from your own Node.js code

You don't need Claude in the loop — you can call the server directly from any Node program using the MCP client SDK. See probe.js for a working example. The pattern:

import { Client } from "@modelcontextprotocol/sdk/client/index.js";
import { StdioClientTransport } from "@modelcontextprotocol/sdk/client/stdio.js";

const transport = new StdioClientTransport({
  command: "node",
  args: ["./src/index.js"],
});
const client = new Client({ name: "my-app", version: "1.0.0" }, { capabilities: {} });
await client.connect(transport);

const result = await client.callTool({
  name: "loan_payment",
  arguments: { principal: 200000, annual_rate_pct: 6.0, term_months: 360 },
});
console.log(result.content[0].text);  // "1199.10"

await client.close();

Tools

Basic: add, subtract, multiply, divide, power

Loans:

  • loan_payment(principal, annual_rate_pct, term_months)
  • loan_amortization_summary(...)
  • loan_remaining_balance(..., payments_made)

Interest:

  • simple_interest(principal, annual_rate_pct, years)
  • compound_interest(principal, annual_rate_pct, years, compounds_per_year=12)
  • daily_interest_accrual(principal, annual_rate_pct, days, day_count_basis=360) — A/360 or A/365

Depreciation:

  • depreciation_straight_line(cost, salvage_value, useful_life_years)
  • depreciation_declining_balance(cost, salvage_value, useful_life_years, factor=2.0) — full year-by-year schedule

Tip: tip(bill, tip_pct=18, split_n=1)

Dividend MTM: dividend_mark_to_market(shares, dividend_per_share, cost_basis_per_share, current_price_per_share, dividends_received=0)

PV/FV:

  • present_value(future_amount, annual_rate_pct, years, compounds_per_year=1)
  • future_value(present_amount, annual_rate_pct, years, compounds_per_year=1)

Why Decimal not float

Money math in floats has well-known precision bugs (0.1 + 0.2 ≠ 0.3). Every calculation in this server runs through decimal.js with 28 digits of precision and explicit rounding at the boundary. Inputs come in as floats over the JSON wire — they're converted to Decimal on the way in so nothing accumulates float drift downstream.