timecalc
timecalc gives AI agents and humans a small, reliable calculator for date, time-zone, and duration arithmetic. It runs as both a Model Context Protocol (MCP) server and a command-line tool, with both interfaces backed by the same Temporal evaluator.
Why an MCP date calculator?
Date math is deceptively difficult. Month lengths vary, leap years matter, daylight-saving transitions make “one day” different from “24 hours,” and an answer involving “today” is meaningless without a clock and time zone. Language models should not have to approximate those rules or generate ad hoc date code.
The timecalc MCP server lets an agent translate a user's request into one constrained expression and delegate the calculation to Bun's implementation of JavaScript Temporal. The result is typed and machine-readable. Expressions are inspectable, and calculations can be replayed with the same explicit context. The evaluator never uses JavaScript eval and does not parse natural-language dates itself.
At a glance:
- One MCP tool:
evaluate_date_expression
- Four Temporal types:
PlainDate, Instant, ZonedDateTime, and Duration
- Explicit semantics: calendar dates, absolute instants, zoned times, and durations remain distinct
- Current-time support: deterministic context injection or an opt-in host clock and time zone
- Same behavior everywhere: MCP and CLI share the parser, evaluator, errors, and serialization
- Portable releases: standalone executables do not require Bun at runtime
Guide to this README
Quick start
There are three ways to install timecalc. All of them deliver the same standalone executable; none require Bun.
| Method | Best for | Requires |
|---|
| Release binary | Fastest startup; any MCP client or shell use | curl and tar (or unzip) |
npm / npx | MCP clients whose config expects an npx command | Node.js 20+ and npm |
| Claude Code plugin | Claude Code; installs the MCP server and the Agent Skill together | Claude Code, Node.js 20+ and npm |
Install a release binary (recommended)
On Linux, macOS, or Windows with a POSIX shell such as Git Bash, install the latest release with:
curl -fsSL https://raw.githubusercontent.com/timescale/timecalc-mcp/main/install.sh | sh
The installer detects the operating system and architecture, downloads the matching asset from the latest GitHub release, verifies it against the release's SHA256SUMS, and installs timecalc into $HOME/.local/bin or $HOME/bin. On macOS it also applies a local ad-hoc signature with Bun's recommended JIT entitlements and removes the download quarantine attribute after checksum verification. It never requires Bun. Override the destination or install a specific release when needed:
curl -fsSL https://raw.githubusercontent.com/timescale/timecalc-mcp/main/install.sh \
| TIMECALC_INSTALL_DIR="$HOME/.local/bin" TIMECALC_VERSION=v0.4.0 sh
Ensure the selected installation directory is on PATH. To inspect the installer before running it, download install.sh and execute it locally with sh install.sh.
For manual installation, download the archive for your platform:
| Platform | Release asset |
|---|
| Linux AMD64 | timecalc-v<version>-linux-amd64.tar.gz |
| Linux ARM64 | timecalc-v<version>-linux-arm64.tar.gz |
| macOS AMD64 (Intel) | timecalc-v<version>-darwin-amd64.tar.gz |
| macOS ARM64 (Apple Silicon) | timecalc-v<version>-darwin-arm64.tar.gz |
| Windows AMD64 | timecalc-v<version>-windows-amd64.zip |
| Windows ARM64 | timecalc-v<version>-windows-arm64.zip |
Each archive contains timecalc (or timecalc.exe), LICENSE, and NOTICE. The executable includes Bun and all runtime dependencies, so Bun does not need to be installed.
Download SHA256SUMS from the same release and verify the archive before extracting it. For example, on Linux:
ARCHIVE=timecalc-vX.Y.Z-linux-amd64.tar.gz # replace X.Y.Z
grep -F "$ARCHIVE" SHA256SUMS | sha256sum -c -
On Linux or macOS, extract the archive and install the executable: