Kaiord

io.github.pablo-albaladejo由 GitHub 账号 pablo-albaladejo 发布v10.5.0更新于 Oct 30, 2026

Convert, validate, and inspect workout files (FIT, TCX, ZWO, Garmin Connect) for AI agents.

已验证Streamable HTTP可网页运行位置与生活文件与存储数据与分析

概览

AI 生成的概览

Kaiord 通过统一的 JSON 格式转换、校验、检查与比对健身训练文件(FIT、TCX、ZWO、GCN、KRD),可作为远程端点或本地 npm 服务器运行。

可以做什么
  • 列出支持的健身数据格式,并在编写文档前读取 KRD 格式规范
  • 在 FIT、TCX、ZWO、GCN 与 KRD 之间转换,FIT 输出以 base64 文本返回
  • 按 schema 校验 KRD JSON,并对 FIT 到 KRD 再到 FIT 的往返转换做容差校验
  • 检查健身文件并给出可读摘要、以 JSON 提取其中的结构化训练,以及比较两个文件的差异
适用场景
适合需要处理骑行、跑步或游泳训练文件的场景:在码表与训练软件格式之间转换、检查生成的训练是否合法,或对比同一训练的两个版本。
运行要求
可使用 kaiord.com 的远程端点,或通过 stdio 运行本地 npm 包 @kaiord/mcp(需要 Node.js)。未声明账号、API 密钥或环境变量。内容以内联方式传入,FIT 需为 base64。
安装前请注意
仅接受结构化训练;在远程端点上,ZWO 输入只做格式良好性检查,不按 XSD 校验。FIT 输出为 base64 文本,大文件不便处理。FIT 转换器尚未实现 training_peaks_tss 时长类型。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Kaiord,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Web executable,通过 Streamable HTTP。 远程服务在工作区中配置后即可从网页运行时运行。

交给智能体安装

把这段提示词粘贴到 Claude Code、Codex、Cursor 等智能体,或 SourceWeft 对话中。智能体会读取该服务器的安装指南,先向你展示发布者、端点和登录方式,经你同意后再把它添加到你的客户端。密钥不会写进任何命令。

阅读 https://sourceweft.com/mcp/io.github.pablo-albaladejo%2Fkaiord/install.md,并按其中说明把这个 MCP 服务器接入我的客户端。修改任何配置之前,先告诉我它的发布者、端点和登录方式,等我确认。不要把 API 密钥写进命令或我会提交的文件;问我密钥应从哪里获取。

查看智能体所依据的安装指南

其他 MCP 客户端

把它添加到你客户端的 mcpServers 配置中。

{
  "mcpServers": {
    "kaiord": {
      "type": "http",
      "url": "https://kaiord.com/mcp"
    }
  }
}

README

Kaiord — Open-Source Health & Fitness Data Framework

kaiord.com | Editor | npm

[License: MIT] [TypeScript]

[CI] [codecov] [npm version] [npm version] [MCP Registry] [Glama MCP server] [Sponsor]

Kaiord is an open-source framework for creating, converting, and managing health & fitness data.

It provides:

  • @kaiord/core: a TypeScript library with format adapters for .fit, .tcx, .zwo, and .krd (Kaiord) files, plus Garmin Connect API integration.
  • @kaiord/cli: a command-line tool to convert, validate, and compare files across formats.
  • @kaiord/mcp: an MCP server exposing Kaiord tools to AI agents (Claude Desktop, Claude Code, etc.). Published in the official MCP registry as io.github.pablo-albaladejo/kaiord.
  • Workout Editor: a web application to create and edit workout files visually.

✨ Features

  • Visual Workout Editor - Create and edit workouts in your browser
  • Unified JSON-based format .krd (Kaiord Representation Definition)
  • Schema validation (Zod)
  • Round-trip safe conversions between FIT / TCX / ZWO / GCN / KRD
  • Hexagonal architecture & fully typed API

Supported FIT Fields

Workout Metadata
  • Sub-sport categorization: Detailed sport types (trail running, indoor cycling, lap swimming, etc.)
  • Pool dimensions: Pool length and unit for swimming workouts
Workout Steps
  • Coaching notes: Instructional text for each step (max 256 characters)
  • Swimming equipment: Fins, kickboard, paddles, pull buoy, snorkel
Duration Types
  • Time & distance: Standard interval durations
  • Calorie-based: Steps ending after burning specified calories
  • Power-based: Steps ending based on power thresholds (watts)
  • Heart rate conditionals: Steps ending based on HR thresholds (bpm)
  • Repeat conditionals: Repeat blocks until time/distance/calories/HR/power targets reached

Known Limitations

  • Training Stress Score (TSS): The training_peaks_tss duration type is not yet implemented in the FIT converter. This is a TrainingPeaks-specific metric that requires additional mapping logic. Contributions welcome!

🔒 Local-first architecture

Kaiord is local-first: your data lives on your device, because there is no Kaiord server to send it to. There are no accounts and no backend.

  • Storage is your browser's IndexedDB. The Workout Editor persists every workout, template, profile, and setting in a local Dexie.js / IndexedDB database (new KaiordDatabase() in dexie-database.ts), and the UI reads it reactively through useLiveQuery. Nothing is written to a remote database — see the "Persisted data → Dexie" rule in State Management.
  • Conversions run entirely on your machine. FIT / TCX / ZWO / GCN ↔ KRD conversion happens in-process — client-side in the editor (import-workout-formats.ts, export-workout-formats.ts) or locally in the @kaiord/cli. Files never leave your device to be converted.
  • Sync is opt-in and goes to your cloud. Data leaves the device only if you connect Google Drive. The cloud-sync adapter uses the Google Identity Services drive.appdata scope, so synced data lands in your own Drive's app folder; the access token lives only in memory for the session and is never persisted by Kaiord.
  • Integrations use your logged-in session — no credential proxy. Garmin, WHOOP, and Train2Go connect through browser-extension "bridges" (garmin-bridge, whoop-bridge, train2go-bridge) that piggyback on your existing browser session. Per openspec/specs/adapter-contracts/spec.md, a bridge "SHALL NOT store, transmit, or manage user credentials"; authentication is "delegated entirely to the browser's cookie jar." No third-party server proxies your credentials or your data.
  • Works offline. Because all logic and storage are client-side, the editor keeps working with no network connection once loaded.

📚 Documentation

Comprehensive documentation is available in the /docs directory:

  • Getting Started - Installation, basic usage, and quick examples for both library and CLI
  • Architecture - Hexagonal architecture, ports & adapters pattern, and design principles
  • Testing - Testing strategy, TDD workflow, and coverage requirements
  • Deployment - CI/CD pipeline, GitHub Pages deployment, and npm publishing
  • Contributing - Contribution guidelines, development workflow, and code standards
  • KRD Format - Complete specification of the Kaiord Representation Definition format
  • AI Agents - Guidance for AI-assisted development

🧩 Tech Stack

LayerTooling
CoreTypeScript, tsdown, Zod
CLIyargs
Web AppReact, Zustand, Tailwind, Radix UI
TestingVitest, Playwright
Package managerpnpm

🏗 Monorepo Layout

kaiord/├─ packages/│  ├─ core/                → domain types, schemas, ports & use cases│  ├─ fit/                 → Garmin FIT format adapter│  ├─ tcx/                 → Training Center XML adapter│  ├─ zwo/                 → Zwift ZWO format adapter│  ├─ garmin/              → Garmin Connect API adapter│  ├─ cli/                 → command-line interface│  ├─ mcp/                 → MCP server for AI/LLM integration│  └─ workout-spa-editor/  → web application (https://kaiord.com/app/)├─ docs/   → documentation├─ LICENSE├─ README.md└─ pnpm-workspace.yaml

🚀 Quick Start

Try the Web App

Launch Workout Editor →

Create and edit workouts visually in your browser. No installation required.

Use the Library

bash
pnpm installpnpm -r buildpnpm -r test
# Example usagepnpm kaiord --help

For detailed installation instructions and usage examples, see the Getting Started Guide.


🚀 CI/CD Pipeline

Kaiord uses GitHub Actions for continuous integration and deployment:

  • Automated Testing: Multi-version testing on Node.js 22.x (Maintenance LTS) and 24.x (Active LTS)
  • Code Quality: ESLint, Prettier, and TypeScript strict mode validation
  • Release Automation: Changesets for version management and npm publishing
  • Security: Weekly dependency vulnerability audits, CodeQL static analysis, and automated dependency updates

For complete CI/CD documentation, deployment guides, and npm publishing instructions, see Deployment.

Mechanical invariant guards

Beyond linting, the repo enforces its architecture and conventions with 60+ purpose-built guard scripts under scripts/, each with its own co-located test suite. They run on every commit (husky pre-commit) and in CI (pnpm test:scripts), and cover, among others:

  • Hexagonal architecture — layer purity, adapter isolation, and the packages/core/src/ directory allowlist (check-architecture.mjs)
  • Package dependency graph — every @kaiord/* dependency must match the spec table (check-package-deps.mjs)
  • Test conventions — should -prefixed titles and Arrange/Act/Assert structure on every test (check-test-title-should.mjs, check-test-aaa.mjs)
  • Privacy — no runtime values interpolated into toasts or console logs (check-no-pii-leakage.mjs)
  • State discipline — no Zustand store writes persistence directly (check-no-zustand-writethrough.mjs)
  • Spec hygiene — OpenSpec format, archive dates, and auto-generated indexes stay in sync (check-spec-format.mjs, check-archive-*.mjs)

If a rule matters here, a script enforces it — documentation describes the rules, but the guards are what make them true.

Contributing

To contribute to Kaiord:

  1. Fork and clone the repository
  2. Create a feature branch: git checkout -b feature/my-feature
  3. Make your changes following the code style guidelines
  4. Add a changeset: pnpm exec changeset (for version-worthy changes)
  5. Test locally: pnpm -r test and pnpm -r build
  6. Submit a PR: All checks must pass before merging

For detailed contribution guidelines, development workflow, and code standards, see Contributing.


📚 References & Resources

Format Specifications


❤️ Support

If you find Kaiord useful, consider supporting its development:

Your support helps maintain and improve Kaiord for the fitness community!

Built by Pablo Albaladejo


📜 License

MIT © 2025 Pablo Albaladejo See LICENSE for details.

来源:README.md,提交 9aa0caf

工具

8

kaiord_get_format_spec

Get the KRD format specification. Call this before creating or editing KRD documents.

无需输入参数。

kaiord_list_formats

List all supported fitness data formats with capabilities

无需输入参数。

kaiord_convert

Convert between fitness data formats (FIT, TCX, ZWO, GCN, KRD). FIT output is returned as base64 text unless output_file is given. On the remote endpoint, ZWO input is checked for well-formedness only, not against the XSD, and only structured workouts are accepted.

输入参数ftpinput_formatinput_contentoutput_format必填

kaiord_validate

Validate a KRD JSON document against the schema On the remote endpoint, ZWO input is checked for well-formedness only, not against the XSD, and only structured workouts are accepted.

输入参数input_content

kaiord_round_trip_validate

Validate round-trip FIT conversion (FIT → KRD → FIT) and report tolerance violations

输入参数input_content

kaiord_inspect

Inspect a fitness file and return a human-readable summary

输入参数input_formatinput_content

kaiord_extract_workout

Extract the structured workout from a fitness file as JSON

输入参数input_formatinput_content

kaiord_diff

Compare two fitness files and show differences

输入参数format1format2content1content2

版本历史

3
  1. v10.5.0最新Oct 30, 2026
  2. v10.4.0Oct 29, 2026
  3. v10.0.0Sep 16, 2026

评分

已满足适用检查项的 100%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通必需25 分
  • 已声明认证方式必需10 分
  • 已列出工具必需15 分
  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分