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 分