Labsco
MCP SERVER

Arithmetic MCP Server

by YuheiNakasaka

Four arithmetic tools, so the model computes instead of estimating.

Time, Dates & Calculation
Summary
Division by zero errors out, which is the whole design in miniature.

A model asked to divide by zero will often produce something confident and wrong; a tool refuses. That is the difference this makes on every operation, not just the pathological one. It is also about as small as an MCP server gets, which makes it a readable first example if you are writing one.

What it is

A minimal server exposing the four basic arithmetic operations as tools. It exists because a language model producing digits is not the same as a calculator producing a result.

What you get
  • `add` — adds two numbers
  • `subtract` — subtracts one number from another
  • `multiply` — multiplies two numbers
  • `divide` — divides two numbers, returning an error on division by zero rather than a wrong answer
Requirements

The project arithmetic-server, version 1.0.0, built from source: clone it, `npm install`, `npm run build`, then launch `index.js` with node from the client config. TypeScript with the MCP SDK and Zod for validation. No account, no key, no network access.