Labsco
MCP SERVER

Calculator MCP Server

by ericvrp

Exact decimal arithmetic and trigonometry as tools, with the precision set once per session.

Time, Dates & Calculation
Summary
The point is Decimal.js, not the arithmetic.

A model doing floating-point arithmetic in its head gets the twelfth digit wrong. This hands the sum to Decimal.js and lets you fix how many places matter with `set_precision`, which holds for everything that follows. The trigonometric tools take and return arrays, so converting a list of angles is one call rather than one per value.

What it is

A TypeScript server built on Decimal.js. The arithmetic tools take an array of at least two numbers and return one result; the trigonometric tools take an array of values and return an array, so a whole column converts in a single call.

What you get
  • Arithmetic over an array of numbers, with division by zero handled — `add`, `subtract`, `multiply`, `divide`
  • Trigonometry with a `mode` of radians or degrees — `sin`, `cos`, `tan`
  • Inverse and hyperbolic functions over arrays of values — `asin`, `acos`, `atan`, `sinh`, `cosh`, `tanh`, `asinh`, `acosh`, `atanh`
  • Decimal precision configured once and applied to every subsequent calculation — `set_precision`
Requirements

No account and no key. Runs under Bun — `bun install`, then `bun start` — with the client pointed at `src/index.ts`. There is also a Docker path: `docker build -t calculator-mcp .`, then run the `calculator-mcp` image with `--rm` and `-i`.