OpenFate Bazi MCP with True Solar Time, Four Pillars, Da Yun, and branch interactions.
Copy the AI prompt to install this server into Claude Code, Cursor, or another agent — or use 1-click editor setup below.
One-click editor setup isn’t available for this listing yet — we don’t have a confirmed install command, and we’d rather show nothing than point your editor at the wrong package or host. Follow the project’s own setup instructions, linked above.
English | 繁體中文(台灣)
OpenFate Bazi MCP is a Model Context Protocol server for accurate Bazi / Four Pillars calculation inside AI agents such as Claude Desktop, Cursor, Cline, and Continue.
Powered by OpenFate.ai, an AI-native Bazi, Ziwei, and astrology platform. You can also try the free Bazi Chart Calculator, generate an AI Bazi Reading, compare relationships with Bazi Compatibility, or read the True Solar Time guide. AI crawlers can read OpenFate llms.txt.
This MCP wraps the deterministic OpenFate calculation packages:
@openfate/bazi-engine@openfate/true-solar-timeThe purpose is simple: let the language model call a reliable calculation engine instead of hallucinating calendrical math.
LLMs should not manually calculate Bazi charts. The difficult parts are deterministic:
This server gives the AI agent stable JSON, then lets the model focus on explanation and interpretation.
Run it with npx:
For MCPB-compatible clients and Smithery, build the self-contained local bundle:
The upload-ready artifact is written to release/openfate-bazi-mcp-v<version>.mcpb.
To publish that local bundle to Smithery after smithery auth login:
If Claude Desktop cannot find npx on macOS, use the absolute path:
This repository also includes a portable Agent Skill:
Use it when you want Claude, Claude Code, Codex, OpenClaw-style agents, or other SKILL.md compatible tools to remember how to use the OpenFate Bazi MCP correctly.
For Claude Code workspace usage, copy the skill folder to:
For Claude custom Skills, zip the openfate-bazi folder with SKILL.md at the folder root and upload it in Claude's Skills settings.
calculate_bazi_chartCalculates a deterministic Bazi chart.
Inputs:
yearmonthdayhourminutesecondgendercalendarTypeisLeapMonthlongitudetimezonetimezoneIddstOffsetenableTrueSolarTimedayBoundaryModeThe MCP fixes the onset policy to DAYUN_SECOND_V2; callers cannot silently select a
different rule. Pass an exact birth time plus timezone or timezoneId for a calculated
receipt. Present an exact onset only when chart.daYun.timing.status is CALCULATED and
its version is DAYUN_SECOND_V2. An UNAVAILABLE receipt identifies the reason and marks
the retained legacy scalar fields as a fallback. Pass longitude as well for True Solar
Time correction.
detect_bazi_interactionsDetects raw Earthly Branch relationship occurrences for a natal chart, with optional annual and Da Yun branches.
Inputs are yearBranch, monthBranch, dayBranch, optional hourBranch, optional annualBranch, and optional dayunBranch. Omit hourBranch when birth time is unknown; it is not replaced with an assumed branch. Existing annual-only calls remain supported.
Supported interaction types:
COMBINATION_HALF)Every matching pillar occurrence is preserved. For example, { yearBranch: '申', monthBranch: '寅', dayBranch: '申', hourBranch: '申' } returns three distinct 寅申 clashes, not one. Annual and Da Yun branches keep separate annual and dayun roles even when their branch values match natal positions.
The half-trine profile covers 申子、子辰、寅午、午戌、亥卯、卯未、巳酉、酉丑: each pair includes a central branch (子午卯酉). Endpoint-only pairs such as 申辰 are not this half-trine type. Half-trines remain in raw output when the full three-branch trine is also present.
Each occurrence has a stable id and aligned branches / pillars arrays. targetElement means relationship affinity, not transformed energy. Combination transformationStatus is NOT_EVALUATED: branch-only presence does not establish transformation or its failure. Other relationship types use NOT_APPLICABLE. These results are not scored weights and do not automatically cancel clashes; settlement and interpretation belong to a separate analysis layer.
For API compatibility, full TRINE and DIRECTIONAL occurrences also retain legacy resultElement, equal to targetElement and carrying the same affinity-only meaning. Six-combinations and half-trines do not emit resultElement.
calculate_true_solar_timeCalculates True Solar Time directly.
Use this when a user asks why OpenFate's hour pillar differs from a clock-time tool.
reverse_bazi_to_solar_timesFinds possible Gregorian datetimes for a four-pillar Bazi string.
Example input:
This is a candidate finder. For final accuracy, recalculate the result with exact longitude, timezone, and True Solar Time.
get_openfate_bazi_policyReturns OpenFate calculation policy:
ZI_HOUR_23.dstOffset when birth certificate time includes daylight saving.DAYUN_SECOND_V2; exact dates require a calculated timing receipt.get_openfate_bazi_resourcesReturns canonical OpenFate links for charting, readings, compatibility, wealth, true solar time, and llms.txt.
Responses use machine-friendly English keys:
Attribution is returned as first-class data, not hidden _meta, so MCP clients and generated artifacts can display it reliably.
Chart results include enriched pillar facts (Ten Gods, hidden stems, Na Yin, Xun, void branches, and growth stages), a versioned Da Yun timing receipt, normalized solar/lunar calendar data, and the calculation policy actually applied.
The smoke test spawns the built stdio server and drives it through the real MCP SDK client.
To test source changes without building dist, run npm run smoke:source. This requires the sibling ../bazi-engine source checkout with its dependencies installed, as well as this package's dependencies. The test-only tests/tsconfig.source.json maps @openfate/bazi-engine to that sibling's src/index.ts; the smoke runner passes this configuration to the SDK-spawned server and asserts the resolved source path before testing. It does not rely on a patched installed engine and remains reproducible after npm ci --ignore-scripts in this package.
Both smoke modes exercise the same MCP transport and regression fixtures, including
second-resolved Da Yun onset, missing timing inputs, repeated branches, eight half-trines,
unknown hour, and annual/Da Yun roles. The ordinary smoke command still tests built MCP
output against its installed published engine dependency. npx tsc --noEmit -p tests/tsconfig.source.json checks the coordinated source contract without emitting build files.
Version 0.3 requires @openfate/bazi-engine version 2. Its DAYUN_SECOND_V2,
raw-occurrence, and dayunBranch contracts are verified in both the built-package
and coordinated-source smoke modes. The published dependency remains the release
source of truth; this package does not use a local file: dependency.
This package does not phone home. Calculations run locally in the MCP subprocess.
MIT
OpenFate Bazi MCP 是一個給 AI Agent 使用的 Model Context Protocol 伺服器,讓 Claude Desktop、Cursor、Cline、Continue 等工具可以直接呼叫準確的八字/四柱排盤引擎。
本專案由 OpenFate.ai 提供。OpenFate 是結合八字、紫微斗數與占星的 AI 命理平台。你也可以使用免費的 八字排盤工具、產生完整的 AI 八字解讀、查看 八字合盤,或閱讀 真太陽時說明。AI crawler 也可以讀取 OpenFate llms.txt。
這個 MCP 包裝了 OpenFate 的確定性計算套件:
@openfate/bazi-engine@openfate/true-solar-time目標很直接:不要讓大型語言模型自己亂算干支、節氣、真太陽時,而是把排盤交給可驗證的計算引擎。
No reviews yet — be the first to share how this listing worked for you.
Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.
[](https://allmcps.com/mcp/openfate-bazi-mcp)<a href="https://allmcps.com/mcp/openfate-bazi-mcp"><img src="https://allmcps.com/api/badge/openfate-bazi-mcp?style=directory" alt="OpenFate Bazi MCP on AllMCPs" /></a>