addLABSCO 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
modeof 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.
Setup effort
Follow the published steps — bun install
USE CASES
Keeping a financial calculation exact
Do the arithmetic in Decimal.js instead of in the model, so rounding happens where you decided it should.
Fixing how many decimal places matter
Set the precision once at the start and let every later calculation inherit it.
Converting a column of angles
Pass the whole array with mode set to degrees and get an array back, rather than looping one value at a time.
Working with hyperbolic functions
Apply the inverse hyperbolic functions to a list of values in one call.
17 tools
Listed in project docs. Your client may show a different list.
subtractmultiplydividesincostanasinacosatansinhcoshtanhasinhacoshatanhset_precisionBEFORE YOU INSTALL
What to know first
Tools you get
17 tools named in the project's documentation.
Requires
bun
INSTALLATION
Connect your client
Server setup
git clone https://github.com/ericvrp/calculator-mcp
cd calculator-mcp
bun installMCP Clients
VS Code — Cline
{
"mcpServers": {
"Calculator": {
"command": "bun",
"args": [
"<YOUR_PATH_TO_CALCULATOR_MCP>/src/index.ts"
],
"type": "stdio",
"timeout": 60,
"disabled": false
}
}
}Cline — Docker
Build the image first
git clone https://github.com/ericvrp/calculator-mcp
cd calculator-mcp
docker build -t calculator-mcp .Then add this to the Cline MCP config
{
"mcpServers": {
"Calculator (docker)": {
"command": "docker",
"args": [
"run",
"--rm",
"-i",
"calculator-mcp"
],
"type": "stdio",
"timeout": 60
}
}
}