# calculator-mcp-server

calculator-mcp-server evaluates expressions, simplifies algebra and takes symbolic derivatives through one calculate tool built on math.js. Useful when an agent has to verify a number rather than guess it.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed, Gemini CLI · 4412 installs · ★ 3 repo stars
- Author: cyanheads
- License: Apache-2.0 · policy=link-only · description only; the file stays with the author
- Source: https://github.com/cyanheads/calculator-mcp-server
- Updated: 2026-10-08
- Security check: automated, 2026-11-16 (text) — no signs of malicious code found.
- HTML: https://affpapa.org/en/nevibecode/mcp/calculator-mcp-server

## What it does

One tool, `calculate`, sits on top of math.js. It handles arithmetic, trigonometry, logarithms, matrices, complex numbers, units and combinatorics. The `operation` field picks between `evaluate` (the default), `simplify` and `derivative`; a derivative call needs `variable` filled in or the request fails.

Results arrive in one of three numeric types: plain `number`, `BigNumber` with 64 significant digits, or `Fraction` for exact rationals. `precision` covers 1 to 16 significant digits. Operations are read-only and stateless, so no auth is involved. The server speaks stdio or Streamable HTTP.

Know the defaults before wiring it in. Expressions cap at 1000 characters, and `CALC_MAX_EXPRESSION_LENGTH` raises the ceiling to 10,000. Fraction mode answers `fraction_unsupported` when no exact rational exists, as with `sqrt(2)` or `pi`. A `simplify` call that gets nowhere returns `unchanged: true`, so the agent can tell the expression stayed as it was.

## Requirements
- Remote server: `https://calculator-mcp-server--cyanheads.run.tools`

## Install

### Claude Code (native platform)

**Platform CLI: remote server**
```bash
claude mcp add --transport http calculator-mcp-server https://calculator-mcp-server--cyanheads.run.tools
```

### Codex

**Platform CLI: remote server**
```bash
codex mcp add calculator-mcp-server --url https://calculator-mcp-server--cyanheads.run.tools
```

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "calculator-mcp-server": {
            "url": "https://calculator-mcp-server--cyanheads.run.tools"
        }
    }
}
```

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "calculator-mcp-server": {
            "type": "http",
            "url": "https://calculator-mcp-server--cyanheads.run.tools"
        }
    }
}
```

### Gemini CLI

**Platform CLI: remote server**
```bash
gemini mcp add -t http calculator-mcp-server https://calculator-mcp-server--cyanheads.run.tools
```

## When to use it
- verify a numeric result instead of trusting the model's arithmetic
- simplify `2x + 3x` down to `5 * x`
- get a symbolic derivative with respect to `x`
- switch to exact fractions when floats drift
- evaluate a matrix or complex number inside an agent step

## Example prompts
- Evaluate `sqrt(2) * 10^6` to 12 significant digits.
- Simplify `2x + 3x` and tell me whether it stayed unchanged.
- Take the derivative of `x^3 + 2x` with respect to `x`.

## Similar
- [calculator](https://affpapa.org/en/nevibecode/skills/calculator.md) — skill · 1 install
- [SageMath](https://affpapa.org/en/nevibecode/mcp/sagemath.md) — MCP server · ★ 22 repo stars
- [Math-MCP](https://affpapa.org/en/nevibecode/mcp/math-mcp.md) — MCP server · 5958 installs
- [onehq-comissions-calculator](https://affpapa.org/en/nevibecode/mcp/onehq-comissions-calculator.md) — MCP server · 1274 installs
- [Music Royalties Calculator](https://affpapa.org/en/nevibecode/mcp/music-royalties-calculator.md) — MCP server · 186 installs
- [amazon-fba-calculator](https://affpapa.org/en/nevibecode/skills/amazon-fba-calculator.md) — skill · 1300 installs

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
