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.
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.
- `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
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.
