calc-mcp
Enables VS Code with GitHub Copilot to access calculation, encoding, hashing, and validation tools for accurate deterministic operations and data processing.
Provides tools for semantic version comparison, validation, parsing, and range satisfaction checking (e.g., verifying if a version satisfies constraints like ">=1.5.0 <2.0.0").
Provides tools for Unicode character analysis, including retrieving code points, block classifications, and category information for individual characters.
Provides validation tools for XML format data via the format_validate tool.
Provides validation tools for YAML format data via the format_validate tool.
Calc MCP
📖 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@latestWorks 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" ❌ |
|
"Here's a UUID: 550e8400-..." 🤷 fake | Cryptographically random UUID v4/v7 ✅ (random) |
"100 days from now is..." 🤔 guess |
|
"SHA-256 of password123 is..." 💀 hallucinated |
|
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? |
| math |
Convert 255 to binary |
| base |
Is 4539578763621486 a valid card number? |
| luhn |
Text & Encoding
You ask | You get | Tool |
How many characters in "Hello, World! 🌍"? |
| count |
Base64 encode "Hello World" |
| base64 |
Base64 decode "eyJhbGciOiJIUzI1NiJ9" |
| base64 |
URL-encode "hello world" |
| encode |
URL-decode "hello%20world" |
| encode |
HTML-decode |
| encode |
SHA-256 hash of "password123" |
| hash |
HMAC-SHA256 of "message" with key "secret" |
| hash |
Date & Time
You ask | You get | Tool |
What time is it in New York? |
| datetime |
What's 100 days after 2026-02-11? |
| date |
When does "30 9 * * 1-5" run? |
| cron_parse |
Generation
You ask | You get | Tool |
Generate a UUID v7 |
| random |
Generate a readable 20-char password |
| random |
Shuffle ["Alice", "Bob", "Charlie"] |
| random |
Conversion
You ask | You get | Tool |
100 miles in kilometers? |
| convert |
72°F in Celsius? |
| convert |
Convert #FF5733 to RGB |
| color |
Convert rgba(255, 0, 0, 0.5) to 8-digit HEX |
| color |
Analysis & Parsing
You ask | You get | Tool |
Extract numbers from "abc123def456" |
| regex |
Does 1.5.3 satisfy ^1.0.0? |
| semver |
Does 1.8.0 satisfy ">=1.5.0 <2.0.0"? |
| semver |
IP range of 192.168.1.0/24? |
| ip |
Edit distance: "kitten" → "sitting" |
| diff |
Unicode info for "€" |
| char_info |
Is |
| format_validate |
Decode & Parse
You ask | You get | Tool |
Decode this JWT: eyJhbGci... |
| jwt_decode |
| url_parse |
All 21 Tools
Tool | Description |
| Evaluate expressions, statistics |
| Characters (grapheme-aware), words, lines, bytes |
| Current time, timezone conversion, UNIX timestamps |
| UUID v4/v7, ULID, passwords (readable, custom charset), random number, shuffle |
| MD5, SHA-1, SHA-256, SHA-512, CRC32, HMAC |
| Encode / decode |
| URL, HTML entity, Unicode escape |
| Diff, add/subtract, weekday, wareki |
| Test, match, matchAll, replace |
| Number base conversion (2–36) |
| Line diff, Levenshtein distance |
| Validate JSON, CSV, XML, YAML |
| Human-readable cron + next runs (weekday/month names supported) |
| Validate / generate check digits |
| IPv4/IPv6 info, CIDR contains check, range calculation |
| HEX ↔ RGB ↔ HSL (alpha channel supported) |
| 8 categories, 146 unit names: length, weight, temperature, area (tsubo, tatami), volume, speed, data, time |
| Unicode code point, block, category |
| Decode header + payload (no verification) |
| Protocol, host, path, params, hash |
| Compare, validate, parse, range satisfaction |
Install
Claude Code
claude mcp add -s user calc-mcp -- npx --prefix /tmp -y @coo-quack/calc-mcp@latestClaude Desktop / Cursor / Windsurf
Add to your config file:
App | Config path |
Claude Desktop (macOS) |
|
Claude Desktop (Windows) |
|
Cursor |
|
Windsurf |
|
{
"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:latestOr 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 releaseghcr.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@latestPoint 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 # BiomeSecurity
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 MCPNote: Error messages are automatically sanitized to prevent accidental data leakage.
For security issues, please see our Security Policy.
License
MIT
This server cannot be installed
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/coo-quack/calc-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server