Content
# Cal Server
[](https://archestra.ai/mcp-catalog/pwh-pwh__cal-mcp)
[](https://smithery.ai/server/@pwh-pwh/cal-mcp)
<a href="https://glama.ai/mcp/servers/@pwh-pwh/cal-mcp">
<img width="380" height="200" src="https://glama.ai/mcp/servers/@pwh-pwh/cal-mcp/badge" alt="Cal Server MCP server" />
</a>
## Project Introduction
`Cal Server` is a simple mathematical expression calculation service built on the `FastMCP` framework, running in the Bun runtime environment. It utilizes the `expr-eval` library to parse and compute mathematical expressions input by users, interacting with the outside world through standard input and output (stdio). This project aims to provide a lightweight and efficient calculation tool that supports basic mathematical operations and built-in constants.
## Features
- **Expression Calculation**: Supports user input of mathematical expressions and returns the calculation results.
- **Built-in Constants**:
- `E`: `Math.E` in the Bun environment.
- `PI`: `Math.PI` in the Bun environment.
- `true`: Logical true value.
- `false`: Logical false value.
- **Tool Name**: `cal`.
- **Parameters**: Accepts a string type mathematical expression (`exp`).
## Dependencies
- `fastmcp`: Used for building MCP services.
- `expr-eval`: Used for parsing and calculating mathematical expressions.
- `zod`: Used for parameter validation.
## Prerequisites
- Ensure that the [Bun](https://bun.sh/) runtime is installed (latest version recommended).
## Installation
### Installing via Smithery
To install cal-mcp for Claude Desktop automatically via [Smithery](https://smithery.ai/server/@pwh-pwh/cal-mcp):
```bash
npx -y @smithery/cli install @pwh-pwh/cal-mcp --client claude
```
### MCP Client Configuration
```json
"cal-mcp": {
"name": "Calculation",
"description": "",
"isActive": true,
"command": "bunx",
"args": [
"cal-mcp"
]
}
```
### Manual Installation
1. Clone the project repository:
```bash
git clone <repository-url>
```
2. Navigate to the project directory and install dependencies:
```bash
bun install
```
## Usage
1. Start the service:
```bash
bun run index.ts
```
The service will run through standard input and output (stdio).
2. Input a mathematical expression:
- Example input: `2 + 3 * PI`
- Output: Calculation result (in string format).
3. Supported expression examples:
- Basic operations: `2 + 2` → `4`
- Using constants: `PI * 2` → `6.283185307179586`
- Complex expressions: `E ^ 2 + 1` → `8.38905609893065`
## Notes
- The input expression must be a valid mathematical expression; otherwise, it may throw an error.
- The service currently only supports interaction via `stdio`.
- The project uses the Bun runtime, so ensure commands are compatible with Bun.
Connection Info
You Might Also Like
Time
Obtaining current time information and converting time between different...
bytebot
Bytebot is a self-hosted AI desktop agent that automates computer tasks...
inbox-zero
The world's best AI personal assistant for email. Open source app to help...
DesktopCommanderMCP
This is MCP server for Claude that gives it terminal control, file system...
ClaudeComputerCommander
This is an MCP server that provides terminal control, file system search,...
astron-rpa
Agent-ready RPA suite with out-of-the-box automation tools. Built for...