
gnomon
io.github.lihtness由 GitHub 帳號 lihtness 發布v0.1.2更新於 Oct 24, 2026
Deterministic batch tools so LLM agents stop guessing dates and math.
概覽
本機 MCP 伺服器,為助理提供確定性的日期、行事曆、算術與單位換算工具,讓模型實際計算而非猜測。
- 可以做什麼
- 取得目前時刻的詳細快照,可指定時區,包含 ISO 週、季度與是否週末等欄位。批次執行行事曆操作:差值、距今、自某日、加減、星期、工作日計數、自然語言日期解析與格式化。一次呼叫計算一組數學與統計運算式,結果依序回傳。在長度、質量、溫度等單位之間換算數值。
- 適用情境
- 適合助理需要跨月或跨年做日期運算、回答距某日期還有多久或已過多久、解析「下週四」這類說法,或處理較複雜的數學與單位換算時。批次工具適合需要對表格每一列執行同類計算的情境。
- 執行需求
- 以本機 stdio 程序在使用者電腦上執行,通常用 uvx 隨需啟動或從 PyPI 安裝。未宣告帳號、API 金鑰、環境變數或請求標頭。需要 Python 執行環境以及 uv 或 pip 工具。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 gnomon,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
gnomon-mcp
[PyPI] [Python] [License: MIT] [MCP Registry]
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
nowfor a snapshot;calendarwithuntil/since/difffor elapsed time;parsefor 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
calendarwithadd/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)andcalc(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:
Units for diff/until/since: seconds, minutes, hours, days, weeks.
Example — compute several things in one call:
Calculator
Examples:
Future tools (sketches)
The same logic — if the model is likely to bluff it, expose a deterministic version — points at several more primitives worth building. None of these are implemented yet; they are candidates, listed roughly in order of bang-for-buck:
- Text measurement —
count(text, unit)for chars / words / lines / sentences / LLM tokens. Agents constantly miscount "how long is this" and "will this fit in the context window." - Regex match / replace —
regex_find(pattern, text)andregex_sub(pattern, repl, text). Models hallucinate which substrings match a regex; a real engine ends the argument. - Structured-data extraction —
jq(path, json)/jsonpath(path, json). Reading values out of a nested blob by path, without typos. - Hashing & encoding —
hash(text, algo)(sha256, md5, blake2),encode(text, scheme)/decode(text, scheme)(base64, hex, url, jwt-payload). All things models confidently invent wrong. - Decimal money math —
money(expr)evaluated under Python'sDecimalwith explicit rounding.calcis float-based and quietly unsafe for currency. - Holiday-aware business days — extend
calendar.business_dayswith acountry(orcalendar) parameter so US/UK/IN holidays are excluded. The current implementation only knows weekends. - Cron describe / next-fire —
cron_describe("0 9 * * 1-5")→ human English;cron_next(expr, n)→ next N firing times. Models routinely misread cron fields. - Token counting for a target model —
count_tokens(text, model)via tiktoken / Anthropic tokenizer. Lets an agent budget its own prompts and outputs instead of guessing.
If you want one of these, open an issue (or a PR — each is a small self-contained module that fits the existing tools/ layout).
Install
Recommended: no install — run on demand via uv:
Or install globally:
Wire it into your agent
All recipes assume uvx gnomon-mcp. If you prefer a pinned install, swap the command for gnomon-mcp (with no uvx).
Claude Code
Or edit ~/.claude.json / a project .mcp.json:
Claude Desktop
claude_desktop_config.json:
Cursor
~/.cursor/mcp.json (or .cursor/mcp.json in a project):
Continue
~/.continue/config.yaml:
Any other client (generic stdio)
Spawn uvx gnomon-mcp as a subprocess and speak MCP over stdin/stdout. That is the entire integration.
Hosted / remote (HTTP transport)
For team-shared instances or agents that can't spawn a local subprocess:
Then point your MCP client at http://<host>:8000/mcp (or /sse for the SSE transport).
Tell your agent to actually use it
The MCP tool descriptions are intentionally terse to keep persistent context cost minimal (~150 tokens for all four tools). The richer "when to reach for gnomon" guidance lives in a Claude Code skill that loads on demand.
Option A — Claude Code plugin (one command, recommended)
The plugin wires both the MCP server and the skill in one shot. Inside Claude Code:
That registers gnomon as an MCP server (auto-starts via uvx) and installs the on-demand skill. Skill body loads only when the task triggers it — persistent context stays ~150 tokens for the four tool descriptions plus ~40 tokens for the skill's name + summary.
Option B — manual skill install (no plugin)
If you've already wired the MCP server with claude mcp add gnomon -- uvx gnomon-mcp and only want the skill:
Option C — paste into your system prompt (non-Claude-Code agents)
For agents without skill support, paste this short version into your system prompt or CLAUDE.md:
Development
License
MIT
來源:README.md,提交 dbc546a
工具
0版本歷史
1- v0.1.2最新Sep 16, 2026
評分
已滿足適用檢查項的 50%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分