Yuanzi Zhiyi Bazi Agent Kit

io.github.yuanzizhiyi由 GitHub 账号 yuanzizhiyi 发布v0.2.1更新于 Oct 24, 2026

Local Bazi charts, Ten Gods and true solar time, with structured facts and PNG images.

已验证STDIO仅桌面

概览

AI 生成的概览

本地、确定性的四柱八字引擎,让助手计算八字命盘、十神与真太阳时,返回结构化事实和 PNG 图片。

可以做什么
根据出生日期、时间和时区在本地计算基础八字命盘,涵盖历法转换、真太阳时、日界、四柱、日主、十神、藏干以及五行计数与占比,并输出稳定的版本化结果结构和可读事实。以 PNG 图片块返回命盘,供支持 MCP 图片的客户端直接显示。获取可选的、按意图提供的托管功能链接,该链接不会接收出生数据。
适用场景
当助手需要在用户本机以可复现方式计算八字命盘事实、而非依赖托管 API 时使用;也适合在结构化结果之外展示或保存命盘图片。
运行要求
通过 npx(包 yuanzi-bazi-agent-kit)或构建后的源码树以本地 stdio 进程运行;需要 Node.js 22.19 或更高版本。首次运行会下载 npm 依赖,之后计算与图片渲染均在本地进行。未声明账号、API 密钥或环境变量。
安装前请注意
命盘图片包含出生与命盘数据,分享时需谨慎。公开核心不包含大运、神煞解读、合婚、AI 解读和报告;capabilities 工具提供托管功能链接,README 称其不会接收出生数据。

安装

在 SourceWeft 中

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

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

[Yuanzi Bazi Agent Kit — MCP · Agent Skill · Local Charts]

[M8ven Score]

Yuanzi Bazi Agent Kit

Yuanzi Zhiyi website · 简体中文

A local-first, deterministic basic Four Pillars (Bazi) engine, CLI, MCP server, and Agent Skill by Yuanzi Zhiyi.

The calculation scope includes: calendar conversion, time-zone and true-solar-time handling, explicit day boundaries, four pillars, day master, ten gods, hidden stems, and unweighted five-element counts, composition shares, and a documented eight-shensha rule set. The stable result schema is yuanzi-basic-bazi/v1.

Chinese documentation

Topics / 主题: 八字排盘 · Bazi / Four Pillars · 真太阳时 / True Solar Time · 历法转换 / Calendar Conversion · MCP · Agent Skill · 本地命盘图片 / Local Chart Images

Example chart

Illustrative chart. Birth date, time and location are hidden; no customer data is used.

[Example chart]

Why this kit exists

Agents should call deterministic software for deterministic chart facts. This kit gives OpenAI, Google, and other MCP-compatible agents the same reviewable calculation core without requiring users to upload identity data or send birth data to a hosted API.

Calculation is local, uses zero telemetry, and makes no network requests. See scope and privacy.

Included

SurfacePurpose
TypeScript APIEmbed the versioned deterministic core
yuanzi-bazi CLIJSON or readable local calculation
stdio MCPTwo schema-first, read-only tools
SKILL.mdAgent workflow and safety boundary

Luck cycles, interpretation of shensha, compatibility, AI readings, reports, and advisor services are not part of the public core.

Install with npm

Version 0.3.0 includes the new chart layout, bundled fonts, and chart structure extension.

Requires Node.js 22.19 or later. Start the local MCP server:

bash

MCP client configuration:

json
{  "mcpServers": {    "yuanzi-bazi": {      "command": "npx",      "args": ["-y", "[email protected]", "mcp"]    }  }}

The first run downloads npm dependencies; chart calculation and image rendering then run locally.

Install from this source tree

Requires Node.js 22.19 or later.

bash
git clone https://github.com/yuanzizhiyi/yuanzi-bazi-agent-kit.gitcd yuanzi-bazi-agent-kitnpm cinpm run buildnpm testnpm link

The source repository is yuanzizhiyi/yuanzi-bazi-agent-kit. The npm package is yuanzi-bazi-agent-kit, version 0.3.0.

Chart images

MCP calculate_basic_bazi_chart returns structuredContent.chart, JSON text, readable facts, and an image/png content block. Clients that support MCP images can display the chart directly. The Skill also saves and displays a PNG by default.

For CLI usage, append --image chart.png to chart --stdin --format json. JSON stays on stdout; a save confirmation goes to stderr. Choose an unused filename in an existing directory. Images contain birth/chart data: share them deliberately. Rendering uses the same paper and pillar design language as the main site, without its advanced calculations. It runs locally with bundled Noto-derived serif and sans-serif fonts and no network calls. The 2160px-wide report includes the highlighted day column, full pillar table, shensha and combinations, directed element relationships and all ten composition bars. See chart structure and rules.

CLI

bash
printf '%s' '{"calendar":{"type":"solar"},"date":{"year":1988,"month":8,"day":9},"time":{"hour":2,"minute":53},"location":{"timezone":"Asia/Shanghai"},"options":{"timeCorrection":"standard","dayBoundary":"ziEarly"}}' \  | yuanzi-bazi chart --stdin --format json

The CLI keeps JSON results on stdout and typed errors on stderr. See the input and output reference.

Local MCP server

The server exposes:

  • calculate_basic_bazi_chart: local deterministic calculation;
  • get_yuanzi_bazi_capabilities: an optional, intent-specific hosted-feature link that never receives birth data.

Configure a local stdio MCP client after building. Replace the absolute path with your installation directory:

json
{  "mcpServers": {    "yuanzi-bazi": {      "command": "node",      "args": ["/absolute/path/yuanzi-bazi-agent-kit/dist/cli.js", "mcp"]    }  }}

For Codex-compatible TOML:

toml
[mcp_servers.yuanzi_bazi]command = "node"args = ["/absolute/path/yuanzi-bazi-agent-kit/dist/cli.js", "mcp"]

Both tools declare read-only, non-destructive, idempotent annotations and explicit input/output schemas. The server uses stdout only for the MCP protocol.

Agent Skill

Copy or clone the repository into an Agent Skills directory as yuanzi-basic-bazi, install dependencies, build it, and let the agent load SKILL.md. The same Skill layout is usable from .agents/skills in supporting clients.

The Skill instructs agents to collect only required chart inputs, preserve unknown hours, surface warnings, and use exactly one contextual hosted hook only after the user asks for a feature outside the public scope.

TypeScript API

ts
import { calculateBasicBazi } from 'yuanzi-bazi-agent-kit';
const chart = calculateBasicBazi({  calendar: { type: 'solar' },  date: { year: 1988, month: 8, day: 9 },  time: { hour: 2, minute: 53 },  location: { timezone: 'Asia/Shanghai' },  options: { timeCorrection: 'standard', dayBoundary: 'ziEarly' },});

Versioning and methodology

Package releases follow semantic versioning. The versioned data contract is independent: compatible additions remain under yuanzi-basic-bazi/v1; incompatible output changes require a new schema identifier.

Method details and validation examples are linked in each result at attribution.methodUrl.

Development

bash
npm testnpm run test:coveragenpm run buildnpm run pack:check

Licensed under MIT. The license does not grant trademark rights; see TRADEMARKS.md.

Contributions are welcome under CONTRIBUTING.md. Report vulnerabilities privately as described in SECURITY.md.

来源:README.md,提交 0a4daf1

工具

0
SourceWeft 尚未在沙箱中启动过该软件包,因此其工具未知。

版本历史

1
  1. v0.2.1最新Sep 16, 2026

评分

已满足适用检查项的 50%

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

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分