Cal MCP logo

Cal MCP

by pwh-pwh

Evaluates mathematical expressions through a Bun-based MCP tool over stdio, with arithmetic support and built-in constants.

Install Cal MCP

Pick your client, then add it in one click or paste the config.

STDIONode.js
~/Library/Application Support/Claude/claude_desktop_config.json
claude_desktop_config.json
{
  "mcpServers": {
    "pwh-pwh-cal-mcp": {
      "command": "bunx",
      "args": [
        "cal-mcp"
      ]
    }
  }
}

Settings → Developer → Edit Config, merge this into mcpServers, then fully quit and reopen Claude Desktop.

Install not yet sandbox-tested— we haven't run this command through our automated sandbox yet. Not a red flag; we're working through the catalog.

Overview

pwh-pwh/cal-mcp provides a single MCP tool for evaluating mathematical expressions with Bun, FastMCP, and expr-eval. The `cal` tool accepts an expression string through the `exp` parameter and returns the calculated result over stdio. Built-in values include `E`, `PI`, `true`, and `false`. Reach for it when an MCP client needs straightforward arithmetic or expression evaluation without a separate calculator service.

Use cases

  • Evaluate arithmetic expressions in an MCP client
  • Calculate values using E and PI
  • Check results for compound mathematical expressions
  • Add local calculator functionality to an agent workflow

Key features

  • MCP tool named `cal`
  • Expression input through the `exp` string parameter
  • Arithmetic evaluation with expr-eval
  • Built-in E, PI, true, and false values
  • Bun runtime support
  • stdio transport

Security & health

What it can reach and how reliably it runs — from our own checks, not the maintainer’s claims.

ActiveLast checked 1d ago

Recent health check succeeded.

16/20 checks healthy over the last 78d

Supply-chain signal

No high-severity advisories surfaced by our automated scan.

Critical 0High 0Medium 0Low 0

Scanned 7d ago via OSV.dev · cal-mcp (npm)

Adoption & maintenance

Factual signals from GitHub, npm, and our automated checks — not a rating.

GitHub stars13Stargazers on the source repository.
npm downloads107Package downloads in the last 30 days.
Last commit2d agoMost recent push to the default branch.
Directory activity4 viewsConfig copies, upvotes, and views on AllMCPs.

How Cal MCP works

What pwh-pwh/cal-mcp does

pwh-pwh/cal-mcp exposes mathematical expression evaluation as an MCP tool named cal. The tool accepts one string argument, exp, containing an expression such as 2 + 2, 2 + 3 * PI, or E ^ 2 + 1. Results are returned as calculated values, represented as strings in the usage examples.

Expressions can use basic arithmetic and the built-in constants E and PI, corresponding to the Bun environment's mathematical constants. Boolean literals true and false are also available. Invalid expressions can produce errors, so callers should send valid syntax.

How it works

The service is built with the FastMCP framework and uses the expr-eval library to parse and evaluate incoming expressions. Communication takes place through standard input and output, making it suitable for MCP clients that launch local stdio servers.

A typical interaction sends an expression to cal and receives its result. For example, 2 + 2 evaluates to 4, while PI * 2 evaluates to approximately 6.283185307179586. The project uses Zod for parameter validation and runs under the Bun runtime.

A hosted deployment is available through Fronteir AI, in addition to the local stdio setup.

Setup and configuration

Bun is required to run the project. For a local installation, clone the repository, enter its directory, and install dependencies with:

bash
bun install

Start the server with:

bash
bun run index.ts

The process then communicates over stdio. An MCP client configuration can launch the package with bunx:

config.json
{
  "cal-mcp": {
    "name": "计算",
    "description": "",
    "isActive": true,
    "command": "bunx",
    "args": ["cal-mcp"]
  }
}

Claude Desktop users can install it through Smithery with:

Terminal
npx -y @smithery/cli install @pwh-pwh/cal-mcp --client claude

Tools and capabilities

  • cal: evaluates a mathematical expression supplied through the exp string parameter.
  • Basic arithmetic expression support.
  • Built-in E and PI constants.
  • Boolean true and false values.
  • Local MCP communication through stdio.

The dependency set includes FastMCP for the MCP service, expr-eval for expression processing, and Zod for validating tool input.

Reviews

No reviews yet — be the first to share how it worked for you.

Frequently Asked Questions about Cal MCP

pwh-pwh/cal-mcp is an MCP server that connects an MCP client to a Bun-based mathematical expression evaluator. Its main tool, cal, accepts an exp string and returns the calculated result using expr-eval. It supports arithmetic expressions and the E, PI, true, and false constants over stdio.

Install it through Smithery for Claude Desktop or clone the repository and run `bun install`. Start a local instance with `bun run index.ts`; the server communicates through stdio.

The server provides the `cal` tool. Pass a mathematical expression as the `exp` string parameter, and it returns the evaluated result.

It supports `E`, `PI`, `true`, and `false`. `E` and `PI` correspond to the Bun environment's mathematical constants.

Yes. The local server communicates through standard input and output, and it must be launched with a Bun-compatible command.

Related MCP servers

Add a badge to your READMEShow it’s listed — live SVG, Markdown or HTML.

AllMCPs Directory Badge

Full Badge Customizer

Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.

Badge Style:
Live Dynamic SVG PreviewCal MCP AllMCPs Directory Badge
Markdown (GitHub README)
[![AllMCPs](https://allmcps.com/api/badge/pwh-pwh-cal-mcp?style=directory)](https://allmcps.com/mcp/pwh-pwh-cal-mcp)
HTML Embed
<a href="https://allmcps.com/mcp/pwh-pwh-cal-mcp"><img src="https://allmcps.com/api/badge/pwh-pwh-cal-mcp?style=directory" alt="Cal MCP on AllMCPs" /></a>