gnomon-mcp
以下摘录自该仓库的 README(片段) · 在 GitHub 读完整 README →
> The pointer on a sundial that turns shadow into time.
A small MCP server for the boring-but-essential utilities every model needs: dates, calendars, arithmetic, unit conversion. Use it so your assistant stops "next-token guessing" math and date math.
Why
LLMs are bad at arithmetic and date math by default. They produce plausible answers that are often wrong by a small amount — exactly the kind of mistake that's hard to notice in a long response. gnomon-mcp exposes deterministic Python implementations through MCP so your model can compute instead of guess.
When an agent should reach for gnomon
Anywhere the next plausible token is not the right answer. Concretely:
- **Math that matters** — anything beyond trivial mental arithmetic, anything with a decimal point, anything that compounds. Call calc.
- **"What day is it" / "how long until" / "how long since"** — the model's training cutoff is not today. Call now for a snapshot; calendar with until/since/diff for elapsed time; parse for natural-language dates ("next thursday").
- **Date arithmetic across month/year boundaries** — adding 30 days, finding a quarter-end, counting business days. Models routinely off-by-one these. Call calendar with add / business_days.
- **Unit conversion** — call calc_convert. Never eyeball "kg → lb" or "°C → °F".
- **Table-row workloads** — when the same kind of computation needs to run on every row of a table, both batch tools (calendar, calc) take a list and return a list in order. One call, N results.
The rule of thumb: if you'd ask a colleague to "just double-check that number," call gnomon instead.
How this compares to other MCP servers
Time and math already have several MCP servers — the official Time reference (timezone-only), mcp-time and mcp-datetime (date formatting / timezone), calculator-server (math + units, no dates), and bundles like agent-utils-mcp (regex / hashing / JWT). gnomon's lane is narrower:
- **Batch-first.** calendar(ops) and calc(expressions) take lists; one tool call covers a whole table column instead of N calls.
- **A real now().** One call returns 18 fields — ISO week, quarter, fiscal year, day-of-year, is_weekend, … — instead of just {iso, tz}.
- **Dates *and* math *and* units in one wiring.** No need to compose three separate servers.
- **Natural-language dates baked in** ("next thursday", "in 3 hours") without a separate NLP server.
If you only need timezone conversion, the official Time server is enough. If you want a broad utility bundle (regex, hashing, encoding, JWT), agent-utils-mcp is a better fit. gnomon is for the boring date-arithmetic-and-arithmetic core, batched.
Tools
Calendar
Two tools:
- **now(tz?)** — standalone. Returns a rich dict snapshot of the current moment. One call gets you everything about "right now".
- **calendar(ops)** — batch dispatcher. Each item picks its own op. Designed for table-row workloads (e.g. one call computes time-elapsed for every row).
**now(tz?)** returns:
**calendar(ops)** operations:
| Op | Params | Returns |
|---|---|---|
| diff | start, end, unit | end - start — time elapsed between two known dates |
| until | target, unit, tz? | target - now — time left to a future point (negative if past) |
| since | source, unit, tz? | now - source — time elapsed since a past point (negative if future) |
| add | date, n, unit | ISO of date + n units (seconds\|...\|weeks, plus months\|years calendar-aware) |
| weekday | date | "Monday".."Sunday" |