calc-mcp

calc-mcp

21 tools for things AI is bad at — deterministic math, cryptographic randomness, date arithmetic, hashing, encoding, unit conversion, and more.

Category
访问服务器

README

Calc MCP

npm version CI License: MIT <br /> <br /> <img width="100%" alt="Calc MCP demo" src="https://i.imgur.com/DcOhAD4.png" /> <br /> <br /> 📖 Documentation — Full tool reference, examples, and install guides.

21 tools for things AI is not good at — deterministic math, cryptographic randomness, accurate date arithmetic, encoding, hashing, and more.

LLMs hallucinate calculations, can't generate true random numbers, and struggle with timezones. This MCP server fixes that.

Quick Start

# Claude Code
claude mcp add -s user calc-mcp -- npx --prefix /tmp -y @coo-quack/calc-mcp@latest

# Or just run it
npx --prefix /tmp -y @coo-quack/calc-mcp@latest

Works with Claude Desktop, VS Code Copilot, Cursor, Windsurf, and any MCP client — setup guides below.


Why?

AI alone With calc-mcp
"10 + 34 × 341 ÷ 23 = 507.8" ❌ 514.087 ✅ (math)
"Here's a UUID: 550e8400-..." 🤷 fake Cryptographically random UUID v4/v7 ✅ (random)
"100 days from now is..." 🤔 guess 2026-05-22 ✅ (date)
"SHA-256 of password123 is..." 💀 hallucinated {"hash": "ef92b778bafe..."} ✅ (hash)
  • Deterministic — Same input, same correct output, every time
  • Secure — Sandboxed math, ReDoS protection, weak hash warnings
  • Private — All computation runs locally, no data sent to external services
  • No server config — Install once via npx; MCP client setup required
  • No API key — No account or API key required for calc-mcp itself; requires Node.js

Examples

Ask in natural language — your AI assistant selects the appropriate tool.

Math & Numbers

You ask You get Tool
What's 10 + 34 × 341 ÷ 23? 514.087 math
Convert 255 to binary 11111111 base
Is 4539578763621486 a valid card number? true luhn

Text & Encoding

You ask You get Tool
How many characters in "Hello, World! 🌍"? 15 chars, 18 bytes count
Base64 encode "Hello World" SGVsbG8gV29ybGQ= base64
Base64 decode "eyJhbGciOiJIUzI1NiJ9" {"alg":"HS256"} base64
URL-encode "hello world" hello%20world encode
URL-decode "hello%20world" hello world encode
HTML-decode &lt;script&gt; <script> encode
SHA-256 hash of "password123" {"hash": "ef92b778bafe..."} hash
HMAC-SHA256 of "message" with key "secret" {"hash": "8b5f48702995..."} hash

Date & Time

You ask You get Tool
What time is it in New York? 2026-02-10T19:00:00-05:00 datetime
What's 100 days after 2026-02-11? 2026-05-22 date
When does "30 9 * * 1-5" run? Mon–Fri at 9:30 cron_parse

Generation

You ask You get Tool
Generate a UUID v7 019c4b54-aad2-7e52-... random
Generate a readable 20-char password hT9jZDojX6sHRJt8vaKS random
Shuffle ["Alice", "Bob", "Charlie"] ["Charlie", "Alice", "Bob"] random

Conversion

You ask You get Tool
100 miles in kilometers? 160.93 km convert
72°F in Celsius? 22.22°C convert
Convert #FF5733 to RGB rgb(255, 87, 51) color
Convert rgba(255, 0, 0, 0.5) to 8-digit HEX #ff000080 color

Analysis & Parsing

You ask You get Tool
Extract numbers from "abc123def456" 123, 456 regex
Does 1.5.3 satisfy ^1.0.0? true semver
Does 1.8.0 satisfy ">=1.5.0 <2.0.0"? true semver
IP range of 192.168.1.0/24? 192.168.1.1 – .254 (254 hosts) ip
Edit distance: "kitten" → "sitting" 3 diff
Unicode info for "€" U+20AC, Currency Symbols char_info
Is {"name":"test"} valid JSON? valid, object format_validate

Decode & Parse

You ask You get Tool
Decode this JWT: eyJhbGci... { alg: "HS256", name: "John Doe" } jwt_decode
Parse https://example.com/search?q=hello host: example.com, q: "hello" url_parse

All 21 Tools

Tool Description
math Evaluate expressions, statistics
count Characters (grapheme-aware), words, lines, bytes
datetime Current time, timezone conversion, UNIX timestamps
random UUID v4/v7, ULID, passwords (readable, custom charset), random number, shuffle
hash MD5, SHA-1, SHA-256, SHA-512, CRC32, HMAC
base64 Encode / decode
encode URL, HTML entity, Unicode escape
date Diff, add/subtract, weekday, wareki
regex Test, match, matchAll, replace
base Number base conversion (2–36)
diff Line diff, Levenshtein distance
format_validate Validate JSON, CSV, XML, YAML
cron_parse Human-readable cron + next runs (weekday/month names supported)
luhn Validate / generate check digits
ip IPv4/IPv6 info, CIDR contains check, range calculation
color HEX ↔ RGB ↔ HSL (alpha channel supported)
convert 8 categories, 146 unit names: length, weight, temperature, area (tsubo, tatami), volume, speed, data, time
char_info Unicode code point, block, category
jwt_decode Decode header + payload (no verification)
url_parse Protocol, host, path, params, hash
semver Compare, validate, parse, range satisfaction

Install

Claude Code

claude mcp add -s user calc-mcp -- npx --prefix /tmp -y @coo-quack/calc-mcp@latest

Claude Desktop / Cursor / Windsurf

Add to your config file:

App Config path
Claude Desktop (macOS) ~/Library/Application Support/Claude/claude_desktop_config.json
Claude Desktop (Windows) %APPDATA%\Claude\claude_desktop_config.json
Cursor ~/.cursor/mcp.json
Windsurf ~/.codeium/windsurf/mcp_config.json
{
  "mcpServers": {
    "calc-mcp": {
      "command": "npx",
      "args": ["--prefix", "/tmp", "-y", "@coo-quack/calc-mcp@latest"]
    }
  }
}

VS Code (GitHub Copilot)

Add to .vscode/mcp.json in your workspace:

{
  "servers": {
    "calc-mcp": {
      "command": "npx",
      "args": ["--prefix", "/tmp", "-y", "@coo-quack/calc-mcp@latest"]
    }
  }
}

Docker Image

Calc MCP is available as a Docker image from GitHub Container Registry:

docker run --rm -i ghcr.io/coo-quack/calc-mcp:latest

Or use in MCP client config:

{
  "mcpServers": {
    "calc-mcp": {
      "command": "docker",
      "args": ["run", "--rm", "-i", "ghcr.io/coo-quack/calc-mcp:latest"]
    }
  }
}

Available tags:

  • ghcr.io/coo-quack/calc-mcp:latest — Latest release
  • ghcr.io/coo-quack/calc-mcp:X.Y.Z — Specific version (replace X.Y.Z with the desired version)

Other MCP Clients

Calc MCP works with any MCP-compatible client. Run the server via stdio:

npx --prefix /tmp -y @coo-quack/calc-mcp@latest

Point your client's MCP config to the command above. The server communicates over stdio using the standard Model Context Protocol.

Development

bun install
bun run dev       # Start dev server
bun test          # Run tests
bun run lint      # Biome
bun run format    # Biome

Security

calc-mcp processes all data locally and does not:

  • ❌ Send data to external servers
  • ❌ Log data to files or remote services
  • ❌ Store processed data persistently

For detailed security information, see SECURITY.md.

Safe Usage with LLMs

calc-mcp itself is local-only. However, when used via an LLM, your inputs are sent to the LLM provider (Anthropic, OpenAI, etc.).

  • DO: Use test/sample data when possible
  • DO: Use local-only LLMs for sensitive operations
  • DON'T: Pass production secrets to MCP tools (they will be sent to your LLM provider)

Example:

# ❌ Unsafe: Any secret passed to MCP tool is sent to your LLM provider
# Tool: hash
# Input: { "input": "sk-1234567890abcdef", "algorithm": "sha256" }

# ✅ Safe: Use test data only (for learning/development)
# Tool: hash
# Input: { "input": "test-value-123", "algorithm": "sha256" }

# ✅ For production secrets: Use local-only LLMs or process outside MCP

Note: Error messages are automatically sanitized to prevent accidental data leakage.

For security issues, please see our Security Policy.

License

MIT

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选