# pwh-pwh/cal-mcp [Health: Active]

**Category:** 🛠️ Other Tools and Integrations  
**Repository:** https://github.com/pwh-pwh/cal-mcp  
**GitHub Stars:** 13  
**npm Downloads (last month):** 107  
**Views:** 4  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/pwh-pwh-cal-mcp

## Description
An MCP server for Mathematical expression calculation

## Claude Desktop Quick Installation
Install path detected from listing signals. Uses `bunx` (confidence: high):

```json
"mcpServers": {
  "cal-mcp": {
    "command": "bunx",
    "args": ["cal-mcp"]
  }
}
```

## Documentation

## 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`:

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

Claude Desktop users can install it through Smithery with:

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

_Full upstream README: https://allmcps.com/mcp/pwh-pwh-cal-mcp/readme_

