io.github.coo-quack/calc-mcp

编码与调试

by coo-quack

提供21个MCP工具,涵盖数学、随机数、日期、编码、哈希等能力,结果稳定且准确。

什么是 io.github.coo-quack/calc-mcp

提供21个MCP工具,涵盖数学、随机数、日期、编码、哈希等能力,结果稳定且准确。

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

bash
# 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 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 --prefix /tmp -y @coo-quack/calc-mcp@latest

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": ["--prefix", "/tmp", "-y", "@coo-quack/calc-mcp@latest"]
    }
  }
}

VS Code (GitHub Copilot)

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

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

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 --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

bash
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:

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

常见问题

io.github.coo-quack/calc-mcp 是什么?

提供21个MCP工具,涵盖数学、随机数、日期、编码、哈希等能力,结果稳定且准确。

相关 Skills

前端设计

by anthropics

Universal
热门

面向组件、页面、海报和 Web 应用开发,按鲜明视觉方向生成可直接落地的前端代码与高质感 UI,适合做 landing page、Dashboard 或美化现有界面,避开千篇一律的 AI 审美。

想把页面做得既能上线又有设计感,就用前端设计:组件到整站都能产出,难得的是能避开千篇一律的 AI 味。

编码与调试
未扫描111.8k

网页构建器

by anthropics

Universal
热门

面向复杂 claude.ai HTML artifact 开发,快速初始化 React + Tailwind CSS + shadcn/ui 项目并打包为单文件 HTML,适合需要状态管理、路由或多组件交互的页面。

在 claude.ai 里做复杂网页 Artifact 很省心,多组件、状态和路由都能顺手搭起来,React、Tailwind 与 shadcn/ui 组合效率高、成品也更精致。

编码与调试
未扫描111.8k

网页应用测试

by anthropics

Universal
热门

用 Playwright 为本地 Web 应用编写自动化测试,支持启动开发服务器、校验前端交互、排查 UI 异常、抓取截图与浏览器日志,适合调试动态页面和回归验证。

借助 Playwright 一站式验证本地 Web 应用前端功能,调 UI 时还能同步查看日志和截图,定位问题更快。

编码与调试
未扫描111.8k

相关 MCP Server

GitHub

编辑精选

by GitHub

热门

GitHub 是 MCP 官方参考服务器,让 Claude 直接读写你的代码仓库和 Issues。

这个参考服务器解决了开发者想让 AI 安全访问 GitHub 数据的问题,适合需要自动化代码审查或 Issue 管理的团队。但注意它只是参考实现,生产环境得自己加固安全。

编码与调试
83.1k

by Context7

热门

Context7 是实时拉取最新文档和代码示例的智能助手,让你告别过时资料。

它能解决开发者查找文档时信息滞后的问题,特别适合快速上手新库或跟进更新。不过,依赖外部源可能导致偶尔的数据延迟,建议结合官方文档使用。

编码与调试
51.8k

by tldraw

热门

tldraw 是让 AI 助手直接在无限画布上绘图和协作的 MCP 服务器。

这解决了 AI 只能输出文本、无法视觉化协作的痛点——想象让 Claude 帮你画流程图或白板讨论。最适合需要快速原型设计或头脑风暴的开发者。不过,目前它只是个基础连接器,你得自己搭建画布应用才能发挥全部潜力。

编码与调试
46.2k

评论