Skip to main content
ClaudeWave

MCP server for exact arithmetic: one safe calculator tool over an AST allowlist, with no unbounded dependencies.

MCP ServersRegistry oficial0 estrellas0 forksPythonMITActualizado today
ClaudeWave Trust Score
77/100
Trusted
Passed
  • Open-source license (MIT)
  • Actively maintained (<30d)
  • Clear description
  • Documented (README)
Flags
  • !README contains suspicious pattern: eval\s*\(
Last scanned: 9/10/2026
Install in Claude Code / Claude Desktop
Method: UVX (Python) · calc-mcp-server
Claude Code CLI
claude mcp add calc -- uvx calc-mcp-server
claude_desktop_config.json (Claude Desktop)
{
  "mcpServers": {
    "calc": {
      "command": "uvx",
      "args": ["calc-mcp-server"]
    }
  }
}
1. Run the command above in your terminal (Claude Code), or paste the JSON config into claude_desktop_config.json (Claude Desktop).
2. Replace any <placeholder> values with your API keys or paths.
3. Restart Claude. The MCP server and its tools appear automatically.
Casos de uso

Resumen de MCP Servers

# Calculator MCP Server

<!-- mcp-name: io.github.slettmayer/calc-mcp-server -->

[![PyPI](https://img.shields.io/pypi/v/calc-mcp-server.svg)](https://pypi.org/project/calc-mcp-server/)
[![Python](https://img.shields.io/pypi/pyversions/calc-mcp-server.svg)](https://pypi.org/project/calc-mcp-server/)
[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)

An MCP server that does arithmetic, exactly — so an LLM does not have to do it mentally.

One tool, `calculate`, evaluating expressions against a hand-rolled AST allowlist. No `eval()`, no
`sympy`, no unbounded dependencies.

```
2 + 3 * (4 - 1) / 2 ** 2   ->  4.25
sqrt(16) + sin(pi/2)       ->  5.0
123456789 * 987654321      ->  121932631112635269
```

## Why this exists

The widely-used `mcp-server-calculator` package is abandoned (last commit May 2025) and declares
`mcp>=1.4.1` with no upper bound. When the MCP Python SDK released v2 and removed
`mcp.server.fastmcp`, every `uvx …@latest` install of it started crashing on import — which took down
the entire MCP proxy hosting it, and every other server alongside it.

No maintained Python replacement exists. The one actively-maintained npm calculator computes in
float64, so `123456789 * 987654321` comes back as `121932631112635260` — off by 9. That is a poor
trait in a tool whose whole purpose is that the model should not be doing the arithmetic itself.

So this server:

- **bounds its one dependency** (`mcp[cli]>=2,<3`) — the failure above cannot recur here;
- **keeps integers exact** at any size, never coercing to float;
- **bounds resource use**, not just code execution — see below.

## Safety

Two problems, and most calculator servers only solve the first.

**Code execution.** Expressions are parsed with `ast.parse` and walked against an explicit allowlist of
node types. `Attribute` is not on it, so `(1).__class__.__bases__` is rejected. A `Call` is only
evaluated when its target is a bare name in the function allowlist, so `__import__('os').system(…)` is
rejected before any argument is even evaluated.

**Resource exhaustion.** An allowlist alone still lets `9**9**9` occupy the process for minutes on
unbounded bignum exponentiation — the incumbent hangs for over five seconds on it. Four caps close
that: expression length (500 chars), nesting depth (32), result size (4300 digits, checked on the
operands *before* exponentiating), and factorial argument (1000).

Full detail in [docs/tech/SAFE-EVALUATION.md](docs/tech/SAFE-EVALUATION.md).

## Install

```bash
uvx calc-mcp-server
```

Pin it. Do not add `@latest` — that is how the package this replaces broke.

## Configure

As a stdio MCP server:

```json
{
  "mcpServers": {
    "calculator": {
      "command": "uvx",
      "args": ["calc-mcp-server"]
    }
  }
}
```

## The `calculate` tool

| Argument | Type | Description |
|---|---|---|
| `expression` | `str` | The expression to evaluate |

Returns the result as a string, or a line starting with `Error: ` explaining why the expression was
rejected. The tool never raises, so a bad expression is an answer the agent can read back rather than a
tool-call failure.

**Operators** — `+` `-` `*` `/` `//` `%` `**`, parentheses, unary `+`/`-`. `^` is accepted as a power
operator, and `×` `·` `÷` `−` are accepted as their ASCII equivalents (speech-to-text produces them).

**Constants** — `pi`, `e`, `tau`.

**Functions** — `abs` `round` `min` `max` `sqrt` `exp` `log` `log2` `log10` `sin` `cos` `tan` `asin`
`acos` `atan` `atan2` `degrees` `radians` `hypot` `floor` `ceil` `factorial` `gcd` `lcm`.

**Results** — integer arithmetic returns an exact integer of any size. Floats are rendered at 12
significant digits, which removes IEEE-754 representation noise (`0.1 + 0.2` reads `0.3`, not
`0.30000000000000004`) while keeping far more precision than a calculator result is used at. A whole
float keeps its `.0`, so `8 / 2` reads `4.0` and stays distinct from the exact integer `4`.

## Development

```bash
uv sync
uv run pytest tests/ -v
uv run ruff check .
uv run ruff format .
```

See [AGENTS.md](AGENTS.md) for the project guide and [docs/](docs/README.md) for the full
documentation set.

## License

MIT — see [LICENSE](LICENSE).

Lo que la gente pregunta sobre calc-mcp-server

¿Qué es slettmayer/calc-mcp-server?

+

slettmayer/calc-mcp-server es mcp servers para el ecosistema de Claude AI. MCP server for exact arithmetic: one safe calculator tool over an AST allowlist, with no unbounded dependencies. Tiene 0 estrellas en GitHub y su última actualización registrada es del 2026-09-09.

¿Cómo se instala calc-mcp-server?

+

Puedes instalar calc-mcp-server clonando el repositorio (https://github.com/slettmayer/calc-mcp-server) o siguiendo las instrucciones del README en GitHub. ClaudeWave también te ofrece bloques de instalación rápida en esta misma página.

¿Es seguro usar slettmayer/calc-mcp-server?

+

Nuestro agente de seguridad ha analizado slettmayer/calc-mcp-server y le ha asignado un Trust Score de 77/100 (tier: Trusted). Revisa el desglose completo de comprobaciones superadas y flags en esta página.

¿Quién mantiene slettmayer/calc-mcp-server?

+

slettmayer/calc-mcp-server es mantenido por slettmayer. La última actividad registrada en GitHub es del 2026-09-09, con 0 issues abiertos.

¿Hay alternativas a calc-mcp-server?

+

Sí. En ClaudeWave puedes explorar mcp servers similares en /categories/mcp, ordenados por popularidad o actividad reciente.

Despliega calc-mcp-server en tu cloud

Lleva este repo a producción en minutos. Cada plataforma genera su propio entorno con variables de entorno editables.

¿Mantienes este repo? Añade un badge a tu README

Pega el badge en tu README de GitHub para mostrar que está auditado por ClaudeWave. Cada badge enlaza de vuelta a esta página y muestra el Trust Score actual.

Featured on ClaudeWave: slettmayer/calc-mcp-server
[![Featured on ClaudeWave](https://claudewave.com/api/badge/slettmayer-calc-mcp-server)](https://claudewave.com/repo/slettmayer-calc-mcp-server)
<a href="https://claudewave.com/repo/slettmayer-calc-mcp-server"><img src="https://claudewave.com/api/badge/slettmayer-calc-mcp-server" alt="Featured on ClaudeWave: slettmayer/calc-mcp-server" width="320" height="64" /></a>

Más MCP Servers

Alternativas a calc-mcp-server