Kairos Lang Mcp

io.github.azathothx由 GitHub 帳號 azathothx 發布v1.1.0更新於 Nov 4, 2026

Evaluate (list/next) and validate Kairos schedule definitions; look up the descriptor reference

已驗證STDIO僅桌面效率與工作流開發者工具

概覽

AI 產生的概覽

Kairos 排程定義語言的 MCP 伺服器:把規則求值成具體日期、驗證定義,並查閱描述符參考頁。

可以做什麼
  • 列出 Kairos 排程定義在指定日期區間內的所有觸發點,附上區間註解與覆蓋摘要
  • 從起始日期起取得接下來 N 個觸發點,可設定搜尋年限
  • 在不求值區間的情況下驗證定義(詞法、語法、靜態規則、前提解析)
  • 查閱 roll、within、nth、segmentBy 等描述符的參考頁,支援日文與英文
  • 以 MCP 資源形式讀取語言概覽與參考頁
適用情境
適合需要把書面排程規則(工作日、假日、第幾個星期幾、往前滾動到上一個工作日)換算成確切日期,或在依賴某條規則前確認寫法正確的情境。
執行需求
透過 npx 以 stdio 在本機執行,需要 Node.js 20 或更新版本。未宣告需要帳號、API 金鑰或環境變數。每個求值工具都必須提供 tz 參數(IANA 時區、固定偏移或 UTC)。
安裝前請注意
診斷訊息以日文回傳,參考頁以日文為準、英文為鏡像。求值有上限(區間最長 10 年、最多 1000 個觸發點、原始碼 64 KB、100 條主體表達式),這些限制用於防範誤操作而非防禦惡意使用。此套件名稱容易與其他同樣使用 Kairos 名稱的 npm 套件混淆。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Kairos Lang Mcp,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

kairos-lang-mcp

決めたら、いつでも。
Write the rule once; list the dates.

An MCP server for Kairos, the schedule definition language (https://kairos-lang.org). It lets an AI client evaluate a schedule definition deterministically — every firing in a range, or the next N — validate a definition, and read the descriptor reference.

The server is a thin wrapper over the reference implementation's CLI: the tools return exactly what kairos list --json / kairos next --json print (the CliReport, schema at https://kairos-lang.org/schema/cli-report.schema.json). Points are epoch milliseconds and are the identity; dates are one-to-one civil labels. Out-of-coverage intervals come back as annotations, never as silently dropped points.

日本語: README.ja.md

Install

Listed in the official MCP Registry as io.github.azathothx/kairos-lang-mcp (https://registry.modelcontextprotocol.io — clients that read the registry can install it by that name).

Node.js 20 or later. The server speaks MCP over stdio.

sh
npx -y kairos-lang-mcp          # start on stdio (what an MCP client runs for you)npx -y kairos-lang-mcp --version

Claude Code

sh
claude mcp add kairos-lang -- npx -y kairos-lang-mcp

Claude Desktop (claude_desktop_config.json) and other stdio clients:

json
{  "mcpServers": {    "kairos-lang": { "command": "npx", "args": ["-y", "kairos-lang-mcp"] }  }}

Tools

toolinputoutput
kairos_listsource, from, to, tz, supply?, explain?CliReport for [from, to) — all firings, interval annotations, coverage summary
kairos_nextsource, tz, from? (default: today in tz), n? (default 1), horizonYears? (default 10), supply?, explain?CliReport for the next n firings; found < requested means fewer than n exist within the horizon (the CLI's exit code 2)
kairos_validatesource, tz, supply?{ok, version, diagnostics: [{kind, message}], expressions} — lexing, syntax, static rules and premise resolution, without evaluating a range
kairos_referenceword, lang?the reference page for one descriptor (roll, within, nth, segmentBy, …; README lists them)

Resources: kairos://llms.txt (the language overview for AI readers) and kairos://reference/{ja|en}/{word} (the same pages as kairos_reference).

tz is required

The CLI defaults to the machine's time zone; an AI caller has no machine, so every evaluating tool takes tz (an IANA name such as Asia/Tokyo; the same values as a premise tz:, so the canonical fixed offset +09:00 and UTC are accepted too). It decides how labels and the [from, to) endpoints are read. If the definition's premise declares tz:, evaluation uses that zone — tz still labels the output.

Recommended practice: define your premise once and keep it. A premise names the calendar system, the zone, the week start and the holiday tables:

text
premise JP {  calendar-system: Gregorian; tz: "Asia/Tokyo"; wkst: Mon  national = [2026-01-01, 2026-01-12, 2026-02-11, 2026-02-23, 2026-03-20, 2026-04-29, 2026-05-03..2026-05-06,              2026-07-20, 2026-08-11, 2026-09-21..2026-09-23, 2026-10-12, 2026-11-03, 2026-11-23] covering: 2026..2026  satSun = everyDay |> filter(d => weekday(d) == Sat or weekday(d) == Sun)  bizDay = everyDay \ (satSun | national)}
@JPeveryDay |> within(month) |> last |> roll(Preceding, on: bizDay)

Keeping that text next to your schedules turns tacit knowledge ("our business days") into explicit knowledge that every call reuses — and the covering: clause makes the table's expiry visible in the output (runwayDays) instead of letting it rot silently.

Supply

supply resolves external(kind: dates | instants) bindings with a static bundle, exactly like the CLI's --supply: { "binding" | "Premise.binding": { "dates": ["YYYY-MM-DD", …] | "instants": [ms, …], "covering": "2026-01-01..2026-12-31", "asof": "2026-10-01" } } — schema at https://kairos-lang.org/schema/supply.schema.json.

Errors

Errors are returned as data, not as protocol errors, so the model can read and fix them. kairos_list / kairos_next: {command, version, error: {kind: "usage" | "supply" | "static", message}} with isError: true. kairos_validate: {ok: false, version, diagnostics: [{kind, message}]} (a finding, not an error — no isError). kairos_reference: {error: {kind: "usage", message}, words} with isError: true for an unknown descriptor. usage is the shape of the call (bad zone, non-existent date, window over 10 years, source over 64 KB, more than 100 body expressions), supply a violation of the supply contract, static anything the language reports about the definition (lexing, syntax, static rules, evaluation). Diagnostics are in Japanese — the reference implementation's canonical output language; the report itself is language-neutral JSON (the same as the CLI's --json). The spec in English (https://kairos-lang.org/en/spec/) defines what each diagnostic means.

A malformed argument (missing, wrongly typed, from not YYYY-MM-DD) is rejected by the input schema before the tool runs and comes back as the MCP protocol error -32602. Unknown arguments are ignored.

Limits

Evaluation window at most 10 years; n at most 1000; horizonYears at most 10; source at most 64 KB; at most 100 body expressions per source. These guard against accidents, not against adversaries.

Name

This package is kairos-lang-mcp — the MCP server for the schedule definition language at https://kairos-lang.org. It is unrelated to other npm packages that carry the name Kairos (such as kairos-mcp or kairos-mcp-server), which serve other projects that happen to share the word.

Versioning

The server's version tracks kairos-lang (same number, same contract); it depends on kairos-lang for evaluation and on @modelcontextprotocol/sdk for the protocol.

License

Apache-2.0. The bundled reference pages and llms.txt are copies from the same repository as of this package's release; the latest are at https://kairos-lang.org/llms.txt and https://kairos-lang.org/en/reference/ .

來源:mcp/README.md,提交 26357d7

工具

4

kairos_list

Evaluate a Kairos definition over a range

All firings of each body expression in [from, to) (to is exclusive), with interval annotations and the coverage summary — the same CliReport as 'kairos list --json' (schema: https://kairos-lang.org/schema/cli-report.schema.json). tz is required: the IANA zone (or a fixed offset in the canonical form "±HH:MM", or "UTC" — the same values as a premise tz:) that labels and the [from, to) endpoints are read in (there is no "machine time zone" for an AI caller). If the definition declares tz: in its premise, evaluation uses that zone; tz here still decides the labels. Recommended practice: define your premise once (calendar-system, tz, wkst, holiday tables) and keep it — it turns tacit knowledge into explicit knowledge, and every call reuses the same text. Window at most 10 years. Diagnostics (errors, annotation texts) are in Japanese — the reference implementation's canonical output language; lang: "en" only switches the framing. Errors come back as {command, version, error: {kind: usage|supply|static, message}} with isError. A malformed argument (missing or wrongly typed) is rejected by the input schema before the tool runs, as MCP error -32602; unknown arguments are ignored.

輸入參數to必填tz必填from必填source必填supplyexplain

kairos_next

Next N firings of a Kairos definition

The next n firings at or after from (default: today in tz), searching up to horizonYears (default 10) — the same CliReport as 'kairos next --json' (schema: https://kairos-lang.org/schema/cli-report.schema.json); found < requested means fewer than n firings exist within the horizon (the CLI's exit code 2). For files with a single body expression. tz is required: the IANA zone (or a fixed offset in the canonical form "±HH:MM", or "UTC" — the same values as a premise tz:) that labels and the [from, to) endpoints are read in (there is no "machine time zone" for an AI caller). If the definition declares tz: in its premise, evaluation uses that zone; tz here still decides the labels. Recommended practice: define your premise once (calendar-system, tz, wkst, holiday tables) and keep it — it turns tacit knowledge into explicit knowledge, and every call reuses the same text. Diagnostics (errors, annotation texts) are in Japanese — the reference implementation's canonical output language; lang: "en" only switches the framing. Errors come back as {command, version, error: {kind: usage|supply|static, message}} with isError. A malformed argument (missing or wrongly typed) is rejected by the input schema before the tool runs, as MCP error -32602; unknown arguments are ignored.

輸入參數ntz必填fromsource必填supplyexplainhorizonYears

kairos_validate

Validate a Kairos definition without evaluating it

Checks lexing, syntax, static rules and premise resolution (and the shape of supply if given) by evaluating the empty window [today, today) in tz. Returns {ok, version, diagnostics: [{kind, message}]}. Coverage-related signals (annotations, runway) only appear with a real range in kairos_list. tz is required: the IANA zone (or a fixed offset in the canonical form "±HH:MM", or "UTC" — the same values as a premise tz:) that labels and the [from, to) endpoints are read in (there is no "machine time zone" for an AI caller). If the definition declares tz: in its premise, evaluation uses that zone; tz here still decides the labels. Recommended practice: define your premise once (calendar-system, tz, wkst, holiday tables) and keep it — it turns tacit knowledge into explicit knowledge, and every call reuses the same text. Diagnostics (errors, annotation texts) are in Japanese — the reference implementation's canonical output language; lang: "en" only switches the framing. Errors come back as {command, version, error: {kind: usage|supply|static, message}} with isError. A malformed argument (missing or wrongly typed) is rejected by the input schema before the tool runs, as MCP error -32602; unknown arguments are ignored.

輸入參數tz必填source必填supply

kairos_reference

Read the Kairos descriptor reference

The reference page for one descriptor (e.g. "roll", "within", "nth", "segmentBy"; "README" lists them; "combinators", "sugar-definition", "table-literal" are the shared pages). Japanese is canonical; lang: "en" returns the English mirror. Unknown words return the list of available words.

輸入參數langword必填

版本歷史

4
  1. v1.1.0最新Nov 4, 2026
  2. v1.0.12Oct 26, 2026
  3. v1.0.11Oct 19, 2026
  4. v1.0.10Oct 16, 2026

評分

已滿足適用檢查項的 90%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分
  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具必需15 分
  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分