Calc Mcp

io.github.coo-quack由 GitHub 账号 coo-quack 发布v2.1.5更新于 Oct 25, 2026

21 MCP tools for math, randomness, dates, encoding, hashing, and more — deterministic and accurate.

发布方自己的服务:calc.engineer

已验证STDIO仅桌面开发者工具数据与分析

概览

AI 生成的概览

本地 stdio MCP 服务器,提供 21 个确定性工具,涵盖数学计算、随机生成、日期时间、编码、哈希、解析与单位换算。

可以做什么
  • 计算数学表达式与统计量、进行进制转换、校验或生成 Luhn 校验位
  • 生成 UUID、ULID、密码、随机数与打乱列表,并计算哈希或 HMAC
  • 进行 Base64、URL、HTML 与 Unicode 编解码,统计字符、单词、行与字节数
  • 处理日期时间:当前时间、时区转换、日期加减、UNIX 时间戳与 cron 执行时间
  • 解析与分析文本:正则测试/匹配/替换、逐行差异、Levenshtein 距离、JSON/CSV/XML/YAML 校验、Unicode 字符信息
  • 换算单位与颜色、查询 IP 与 CIDR 网段、解析 URL、比较语义化版本、解码 JWT 头部与载荷
适用场景
适合需要精确算术、真实随机数、可靠的时区与日期计算,或需要可复现的编码、哈希与解析结果,而不是让模型猜测的场景。也适合希望计算在本地完成、结果确定的日常开发与数据处理任务。
运行要求
以本地进程通过 stdio 运行,可用 npx 从 npm 包启动(需要 Node.js),也可使用已发布的 Docker 镜像。无需账号、API 密钥或环境变量。
安装前请注意
哈希工具提示 MD5 与 SHA-1 已被密码学攻破,不应使用于安全用途。JWT 工具只做解码、不验证签名,其输出不可用于身份认证或授权判断。计算虽在本地进行,但传给工具的内容仍会发送给你所使用的 LLM 服务商,因此不要传入真实密钥或生产凭据。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Calc Mcp,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

Calc MCP

[npm version] [CI] [License: MIT]

[Calc MCP demo]

📖 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

bash
# Claude Codeclaude mcp add -s user calc-mcp -- npx -y @coo-quack/[email protected]
# Or just run itnpx -y @coo-quack/[email protected]

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


Why?

AI aloneWith calc-mcp
"10 + 34 × 341 ÷ 23 = 507.8" ❌514.087 ✅ (math)
"Here's a UUID: 550e8400-..." 🤷 fakeCryptographically random UUID v4/v7 ✅ (random)
"100 days from now is..." 🤔 guess2026-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 askYou getTool
What's 10 + 34 × 341 ÷ 23?514.087math
Convert 255 to binary11111111base
Is 4539578763621486 a valid card number?trueluhn

Text & Encoding

You askYou getTool
How many characters in "Hello, World! 🌍"?15 chars, 18 bytescount
Base64 encode "Hello World"SGVsbG8gV29ybGQ=base64
Base64 decode "eyJhbGciOiJIUzI1NiJ9"{"alg":"HS256"}base64
URL-encode "hello world"hello%20worldencode
URL-decode "hello%20world"hello worldencode
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 askYou getTool
What time is it in New York?2026-02-10T19:00:00-05:00datetime
What's 100 days after 2026-02-11?2026-05-22date
When does "30 9 * * 1-5" run?Mon–Fri at 9:30cron_parse

Generation

You askYou getTool
Generate a UUID v7019c4b54-aad2-7e52-...random
Generate a readable 20-char passwordhT9jZDojX6sHRJt8vaKSrandom
Shuffle ["Alice", "Bob", "Charlie"]["Charlie", "Alice", "Bob"]random

Conversion

You askYou getTool
100 miles in kilometers?160.93 kmconvert
72°F in Celsius?22.22°Cconvert
Convert #FF5733 to RGBrgb(255, 87, 51)color
Convert rgba(255, 0, 0, 0.5) to 8-digit HEX#ff000080color

Analysis & Parsing

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

Decode & Parse

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

All 21 Tools

ToolDescription
mathEvaluate expressions, statistics
countCharacters (grapheme-aware), words, lines, bytes
datetimeCurrent time, timezone conversion, UNIX timestamps
randomUUID v4/v7, ULID, passwords (readable, custom charset), random number, shuffle
hashMD5, SHA-1, SHA-256, SHA-512, CRC32, HMAC
base64Encode / decode
encodeURL, HTML entity, Unicode escape
dateDiff, add/subtract, weekday, wareki
regexTest, match, matchAll, replace
baseNumber base conversion (2–36)
diffLine diff, Levenshtein distance
format_validateValidate JSON, CSV, XML, YAML
cron_parseHuman-readable cron + next runs (weekday/month names supported)
luhnValidate / generate check digits
ipIPv4/IPv6 info, CIDR contains check, range calculation
colorHEX ↔ RGB ↔ HSL (alpha channel supported)
convert8 categories, 146 unit names: length, weight, temperature, area (tsubo, tatami), volume, speed, data, time
char_infoUnicode code point, block, category
jwt_decodeDecode header + payload (no verification)
url_parseProtocol, host, path, params, hash
semverCompare, validate, parse, range satisfaction

Install

Claude Code

bash
claude mcp add -s user calc-mcp -- npx -y @coo-quack/[email protected]

Claude Code plugin

Also available as a plugin from the coo-quack marketplace:

/plugin marketplace add coo-quack/claude-code-marketplace/plugin install calc-mcp@coo-quack

See the installation guide for details.

Claude Desktop / Cursor / Windsurf

Add to your config file:

AppConfig 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
json
{  "mcpServers": {    "calc-mcp": {      "command": "npx",      "args": ["-y", "@coo-quack/[email protected]"]    }  }}

VS Code (GitHub Copilot)

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

json
{  "servers": {    "calc-mcp": {      "command": "npx",      "args": ["-y", "@coo-quack/[email protected]"]    }  }}

Docker Image

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

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

Or use in MCP client config:

json
{  "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:

bash
npx -y @coo-quack/[email protected]

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

Development

bash
bun installbun run dev       # Start dev serverbun test          # Run testsbun run lint      # Biomebun 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:

bash
# ❌ 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

来源:README.md,提交 5b71335

工具

21

random

Generate random values: UUID, ULID, secure password (with fine-grained options), random number, or shuffle a list

输入参数maxmintype必填itemslengthcharsetnumberssymbolsreadableuppercaseuuidVersionexcludeChars

hash

Compute hash or HMAC of a string using MD5, SHA1, SHA256, SHA512, or CRC32. WARNING: MD5 and SHA1 are cryptographically broken and MUST NOT be used for security (use SHA-256 or SHA-512 instead).

输入参数keyinput必填actionalgorithm必填

base64

Encode or decode Base64 strings

输入参数input必填action必填

encode

Encode or decode strings using URL, HTML, or Unicode encoding

输入参数type必填input必填action必填

datetime

Get current datetime, convert timezones, format dates, and convert UNIX timestamps

输入参数action必填formatdatetimetimezonetimestamptoTimezonefromTimezone

count

Count characters (grapheme clusters), words, lines, and bytes in text

输入参数text必填encoding

math

Evaluate math expressions or compute statistics on numbers

输入参数actionvaluesexpression

date

Date calculations: diff between dates, add to date, weekday, and Japanese wareki conversion

输入参数date必填unitdate2action必填amount

regex

Test, match, matchAll, or replace using regular expressions

输入参数text必填flagsaction必填pattern必填replacement

base

Convert numbers between bases (2-36), supports large numbers via BigInt

输入参数to必填from必填value必填

diff

Compare two texts: line-by-line diff (Myers algorithm, falls back to full replacement if edit distance exceeds 1000) or Levenshtein distance

输入参数text1必填text2必填action

format_validate

Validate and parse JSON, CSV, XML, or YAML strings

输入参数input必填format必填

cron_parse

Parse cron expression and return next N execution times

输入参数counttimezoneexpression必填

luhn

Validate or generate check digits using the Luhn algorithm

输入参数actionnumber必填

ip

IP address info, CIDR contains check, and range calculation

输入参数ipcidraction必填target

color

Convert colors between HEX, RGB, and HSL formats

输入参数tocolor必填

convert

Convert between units: length, weight, temperature, area, volume, speed, data, time

输入参数to必填from必填value必填category

char_info

Get Unicode information about characters (code point, block, category)

输入参数char必填

jwt_decode

Decode JWT token header and payload for inspection only. WARNING: this tool does NOT verify the signature; never trust the payload for authentication or authorization without separate signature verification using the issuer's verification key (shared secret or public key, depending on alg).

输入参数token必填

url_parse

Parse a URL into its components (protocol, host, path, params, etc.)

输入参数url必填

semver

Semantic versioning: compare, validate, and check range satisfaction

输入参数rangeaction必填version必填version2

版本历史

5
  1. v2.1.5最新Oct 25, 2026
  2. v2.1.4Oct 13, 2026
  3. v2.1.3Oct 11, 2026
  4. v2.1.2Sep 26, 2026
  5. v2.1.1Sep 16, 2026

评分

已满足适用检查项的 90%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分
  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具必需15 分
  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分

其他 Calc 集成