OpenFate Bazi

Developer tools

OpenFate Bazi MCP with True Solar Time, Four Pillars, Da Yun, and branch interactions.

Your AI app calls the OpenFate Bazi MCP server, which does the developer tools work and sends the result back to the chat.

About OpenFate Bazi

OpenFate Bazi is a community MCP server from openfate-ai, filed in our directory under developer tools. OpenFate Bazi MCP with True Solar Time, Four Pillars, Da Yun, and branch interactions.

OpenFate Bazi runs on your own machine: your AI app starts it with the command npx -y @openfate/bazi-mcp@0.5.0 and talks to it over standard input and output.

The README for OpenFate Bazi lists tools such as calendarType, isLeapMonth, timezoneId and dstOffset, which your AI app can call once the server is connected.

OpenFate Bazi is listed in the official MCP registry as io.github.openfate-ai/bazi-mcp, version 0.5.0.

At a glance

Publisher
openfate-ai (community)
Runs
Locally on your machine
Install from
Node.js package on npm: @openfate/bazi-mcp
Written in
TypeScript
License
MIT
GitHub stars
166
Official MCP registry
io.github.openfate-ai/bazi-mcp

Tools OpenFate Bazi gives your AI app

  • calendarType
  • isLeapMonth
  • timezoneId
  • dstOffset
  • enableTrueSolarTime
  • dayBoundaryMode

Tool names as the OpenFate Bazi README lists them. Your AI app shows the live list once OpenFate Bazi is connected.

How to set up OpenFate Bazi

  1. Install Node.js on the machine that runs your AI app, because OpenFate Bazi starts with npx and downloads its package on first run.
  2. Check the OpenFate Bazi README for keys or settings; the registry lists none that OpenFate Bazi requires.
  3. Add OpenFate Bazi to Claude Code, Claude Desktop, VS Code or Cursor with the config in the setup box on this page.
  4. Restart the app or reload its MCP servers, then ask it to list the OpenFate Bazi tools to confirm the connection.
  5. Run one read-only task with OpenFate Bazi first, such as a call to calendarType, before you allow anything that writes or sends.

OpenFate Bazi compared with similar servers

  • Piia Engram by Patdolitse has fewer GitHub stars than OpenFate Bazi (166 against 166); both are community servers, and both run locally.
  • Lasik by pktq has fewer GitHub stars than OpenFate Bazi (166 against 166); both are community servers, and both run locally.
  • Summarizer by 0xshellming has fewer GitHub stars than OpenFate Bazi (166 against 166); both are community servers, and both run locally. The Summarizer README lists 6 tools to OpenFate Bazi's 6.

Before you connect OpenFate Bazi

  • Give OpenFate Bazi its own API key or account with the smallest permissions the job needs, never an admin key.
  • Keep your AI app asking before each OpenFate Bazi tool call until you trust what it does with them.
  • Treat text that OpenFate Bazi fetches as data. Pages, files and messages can hold instructions written to steer an AI.
  • Read the open issues for OpenFate Bazi on GitHub to see what breaks and how fast the maintainers reply.

Marketing use cases for OpenFate Bazi

How marketing and sales teams put OpenFate Bazi to work, by company size. Pick the size closest to yours and start OpenFate Bazi on one use case.

Small business

  • A small business with a developer can use OpenFate Bazi to ship site and tracking fixes faster, with the AI reading the code it changes.
  • Technical founders can ask OpenFate Bazi to explain and fix a marketing site issue without context switching between tools.
  • OpenFate Bazi runs on your own computer, which keeps data local; it needs a little setup, so a small team should plan an hour for it.

Mid-market

  • Growth engineers can use OpenFate Bazi to build landing pages, tracking and integrations in fewer cycles, with reviews kept in the normal flow.
  • Marketing ops engineers can connect OpenFate Bazi to keep scripts and automations documented and versioned as they change.
  • Start with calendarType and isLeapMonth, the tools OpenFate Bazi lists first, and add more once the team trusts the results.

Enterprise

  • Enterprise engineering teams can roll out OpenFate Bazi with repo scopes and audit logs, so agents work only where they are allowed.
  • Platform teams can standardize on OpenFate Bazi so web and marketing engineering share one reviewed way of working with AI.
  • OpenFate Bazi is a community server, so have security review the code and pin a version before OpenFate Bazi touches company data.

Need help becoming an AI-forward company?

We connect MCP servers and AI agents to your CRM, content and data, with the guardrails your team needs.

Contact us

OpenFate Bazi README

From openfate-ai/openfate-mcp on GitHub, shared under its MIT license. Images are left out; the original has them.

README.md

OpenFate Bazi MCP

Eight local BaZi tools for Claude Code, Claude Desktop and Cursor. Calculate the Four Pillars, inspect the solar-time correction or ask which chart fields selected a relationship reading. No OpenFate API key is required.

Download for Claude Desktop · Claude Code setup · Cursor setup · Recreate Ren Tieqiao’s chart · 繁體中文安裝

Two birth times, two rule IDs. Try this request or explore all eight tools. For the 1,112,328 chart samples and 14,460,264 life chapters available offline, visit the OpenFate Bazi Engine.

Install

Claude Desktop. Download the v0.5.0 desktop extension (.mcpb) and open it in a client that supports desktop extensions. The release includes its runtime dependencies. Release notes

Claude Code. With Node.js 20+ and npx on your path, run:

claude mcp add --transport stdio openfate-bazi -- npx -y @openfate/bazi-mcp@0.5.0

Run claude mcp get openfate-bazi to check the connection. Cursor and Cline can launch the same stdio server using the JSON configurations below. Running npx -y @openfate/bazi-mcp@0.5.0 directly starts a process that waits for an MCP client on stdin. Claude Code MCP setup

Try one chart

Paste this into your connected client:

Use read_bazi_relationship for August 15, 1997, female, 08:30 local time, UTC+8, no DST, longitude 120° east. Run it again at 12:30. Show both hour pillars, the rule IDs and the chart evidence for each reading.

Local time Hour pillar Selected rule Evidence in data.chart
08:30 戊辰 day-hour-destruction DESTRUCTION:day:丑|hour:辰
12:30 庚午 day-hour-harm HARM:day:丑|hour:午

Look in data.reading.evidence for the chart pointer. In both examples the relationship ID is at /interactions/1/id. Omit the birth time entirely and the reading reports unknown-hour. Open these two charts in the browser · Chapter rules

Claude Desktop

{
  "mcpServers": {
    "openfate-bazi": {
      "command": "npx",
      "args": ["-y", "@openfate/bazi-mcp"]
    }
  }
}
Claude Desktop cannot find npx on macOS

Run which npx in your terminal and use the returned path for command. This example uses the Homebrew location.

{
  "mcpServers": {
    "openfate-bazi": {
      "command": "/opt/homebrew/bin/npx",
      "args": ["-y", "@openfate/bazi-mcp"]
    }
  }
}

Cursor

Add the entry below to .cursor/mcp.json in your project, or to ~/.cursor/mcp.json to make it available across projects. Keep any existing servers in the file. Cursor MCP configuration

{
  "mcpServers": {
    "openfate-bazi": {
      "command": "npx",
      "args": ["-y", "@openfate/bazi-mcp"]
    }
  }
}

Cline

{
  "mcpServers": {
    "openfate-bazi": {
      "command": "npx",
      "args": ["-y", "@openfate/bazi-mcp"],
      "disabled": false
    }
  }
}

Agent Skill

This repository also includes a portable Agent Skill:

skills/openfate-bazi/SKILL.md

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:

.claude/skills/openfate-bazi/

For Claude custom Skills, zip the openfate-bazi folder with SKILL.md at the folder root and upload it in Claude's Skills settings.

Tools

If your user asks… Call
“What are my four pillars and first luck cycle?” calculate_bazi_chart
“What changed in the reading when I changed the hour?” read_bazi_relationship
“Open the career chapter for this corpus sample.” read_bazi_corpus_chapter
“Which two branches actually clash?” detect_bazi_interactions
“How did 08:30 on the clock become a different solar time?” calculate_true_solar_time
“I have four pillars from a book. Which dates could fit?” reverse_bazi_to_solar_times
“Does this tool change the day at 23:00?” get_openfate_bazi_policy
“Where can I open the chart or continue reading?” get_openfate_bazi_resources
read_bazi_corpus_chapter

Try {"sampleId":"1991-10-18T08:30:00+08:00/female","topic":"work"}. Change the hour to 06:30 and compare both opening paragraphs. Each call returns one full chapter, the chart, evidence paths, edition, license and a link to the same online reader. All text is reproduced locally from corpus v2.1.0. The corpus accepts twelve even-hour slots at :30 per day from 1900-01-01 to 2026-11-22, UTC+8, 120° E.

read_bazi_relationship

Returns the calculated chart and a Traditional Chinese relationship chapter in data.reading. The response includes ruleId, rulesVersion, and evidence pointers relative to data.chart. Omit the hour to receive the explicit unknown-hour status. This tool uses the same deterministic chapter function as the npm SDK and the browser comparison.

Try {"year":1997,"month":8,"day":15,"hour":8,"minute":30,"gender":"female","timezone":8,"dstOffset":0,"longitude":120}. Change only the hour to 12 to compare a day–hour destruction with a day–hour harm.

When both timezone forms are supplied, an explicit numeric timezone and DST offset take precedence. Omit the DST offset to let the IANA zone resolve the historical clock. The response reports the basis actually used.

calculate_bazi_chart

Calculates a deterministic Bazi chart.

Inputs:

  • year
  • month
  • day
  • hour
  • minute
  • second
  • gender
  • calendarType
  • isLeapMonth
  • longitude
  • timezone
  • timezoneId
  • dstOffset
  • enableTrueSolarTime
  • dayBoundaryMode

The 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_interactions

Detects 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:

  • clash
  • six-combination
  • central-branch half-trine (COMBINATION_HALF)
  • trine
  • directional
  • punishment
  • destruction
  • harm

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_time

Calculates 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_times

Ren Tieqiao recorded his own Four Pillars in his commentary on Di Tian Sui. Paste this request into Claude or Cursor after connecting the server.

Use reverse_bazi_to_solar_times to find dates from 1900 through 2026 for 癸巳 戊午 丙午 壬辰. Use ZI_HOUR_23. For each distinct date, use calculate_bazi_chart for a male chart at 08:30 civil time, longitude 120° east, UTC+8, no DST, with True Solar Time enabled. Show the date and the four recalculated pillars.

The reverse lookup uses clock time and finds two dates. At 08:30, both charts still read 癸巳 戊午 丙午 壬辰 after solar-time correction. June 24, 1953 · June 9, 2013 · The two charts in Ren’s commentary

get_openfate_bazi_policy

Returns OpenFate calculation policy:

  • True Solar Time is preferred when location data is available.
  • Default day-boundary mode is ZI_HOUR_23.
  • DST should be passed as dstOffset when birth certificate time includes daylight saving.
  • Da Yun onset uses DAYUN_SECOND_V2; exact dates require a calculated timing receipt.
  • Reverse lookup should be treated as a candidate search.
  • Branch interactions preserve raw pillar occurrences, not weighted or automatically transformed outcomes.
get_openfate_bazi_resources

Returns canonical OpenFate links for charting, readings, compatibility, wealth, true solar time, and llms.txt.

Output Shape

Responses use machine-friendly English keys:

{
  "data": {
    "chart": {},
    "policy": {}
  },
  "attribution": {
    "brand": "OpenFate.ai",
    "url": "https://openfate.ai",
    "engine": "@openfate/bazi-engine",
    "trueSolarTimeEngine": "@openfate/true-solar-time"
  }
}

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.

Development

To build a desktop extension from a source checkout, install dependencies and run npm run mcpb:pack. The artifact is written to release/openfate-bazi-mcp-v<version>.mcpb. Maintainers publishing a local bundle to Smithery can use npm run smithery:publish after smithery auth login.

npm install
npm run build
npm run smoke

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.

Engine compatibility

Version 0.5 uses @openfate/bazi-engine@2.2.0. The stdio smoke test calls the installed server, compares its chapter and chart with the SDK, and checks unknown birth times and historical DST. Test cases

Privacy

Chart calculations run in the local MCP subprocess. The host client receives the tool arguments and results and handles the conversation under its own settings.

OpenFate Links

License

MIT

繁體中文(台灣)

8 個本機八字工具,把排盤、真太陽時換算和感情解讀接進 Claude 或 Cursor。輸入出生年月日時,工具會交回四柱;問起運日期,回傳結果也保留取節與折算依據。使用這套工具無需 OpenFate API 金鑰。

任鐵樵在《滴天髓闡微》留下自己的四柱。裝好後,可以直接問 Claude 或 Cursor,哪些現代日期排得出這張盤。複製四柱反查範例

可以先讀 1997 年 8 月 15 日的 08:30 和 12:30 兩張盤。前一篇問約好買菜卻沒買成,在哪一步漏了交接。後一篇問替對方做了哪個決定,讓原本的一番好意變了味。用瀏覽器打開兩篇,再用下面的工具輸入同一組資料,就能核對結果。雙盤對照 · 命例教材 · 逐年命盤資料

安裝

Claude Desktop 可直接下載 v0.5.0 桌面擴充套件,在支援 MCPB 的客戶端開啟。安裝包已包含所需依賴。

Claude Code 使用 Node.js 20 以上的環境,確認終端機找得到 npx,再執行:

claude mcp add --transport stdio openfate-bazi -- npx -y @openfate/bazi-mcp@0.5.0

用 claude mcp get openfate-bazi 查看連線狀態。Cursor 或 Cline 可使用下方 JSON 設定。若直接執行 npx -y @openfate/bazi-mcp@0.5.0,程式會等待客戶端從標準輸入送來請求。Claude Code 安裝說明

裝好後,把這句貼進對話

請用 read_bazi_relationship 比較兩張盤。1997 年 8 月 15 日,女,東經 120°、UTC+8、無夏令時間。第一張用 08:30,第二張用 12:30。請列出兩個時柱、各自選中的規則,以及命盤中對應的地支關係。

民用時刻 時柱 工具回傳的規則 正文從哪件事談起
08:30 戊辰 day-hour-destruction 兩人說好輪流買菜,哪一步交接漏了?
12:30 庚午 day-hour-harm 菜買好了,但邀朋友來吃飯這件事,對方想自己決定嗎?

兩次回傳的 data.reading.evidence 都可對回 data.chart。想改這段文字,打開同一份解讀規則。想批次讀各年份的 13 章生活解讀,可到引擎專案下載 111 萬筆排盤樣本、1,446 萬章生活解讀的開放資料集。

Claude Desktop 設定

{
  "mcpServers": {
    "openfate-bazi": {
      "command": "npx",
      "args": ["-y", "@openfate/bazi-mcp"]
    }
  }
}
macOS 找不到 npx 時,如何指定執行檔?

先在終端機執行 which npx,將結果填入 command。以下以 Homebrew 的安裝路徑為例。

{
  "mcpServers": {
    "openfate-bazi": {
      "command": "/opt/homebrew/bin/npx",
      "args": ["-y", "@openfate/bazi-mcp"]
    }
  }
}

Cursor 設定

將下方設定併入專案的 .cursor/mcp.json。若要在不同專案使用,可放在 ~/.cursor/mcp.json。Cursor 設定檔位置

{
  "mcpServers": {
    "openfate-bazi": {
      "command": "npx",
      "args": ["-y", "@openfate/bazi-mcp"]
    }
  }
}

Cline 設定

{
  "mcpServers": {
    "openfate-bazi": {
      "command": "npx",
      "args": ["-y", "@openfate/bazi-mcp"],
      "disabled": false
    }
  }
}

Agent Skill

這個 repository 也包含一個可攜式 Agent Skill:

skills/openfate-bazi/SKILL.md

當你希望 Claude、Claude Code、Codex、OpenClaw-style agent,或其他支援 SKILL.md 的工具記住如何正確使用 OpenFate Bazi MCP 時,可以使用這個 Skill。

如果要在 Claude Code workspace 使用,請把整個 skill folder 複製到:

.claude/skills/openfate-bazi/

如果要做 Claude custom Skill,請把 openfate-bazi folder 壓成 zip,確保 SKILL.md 位於 folder root,再到 Claude 的 Skills 設定中上傳。

工具列表

你想查什麼 工具
四柱、十神、九步大運與起運依據 calculate_bazi_chart
感情章的正文、規則與命盤引用 read_bazi_relationship
按公開樣本 ID 查 13 章之一,逐段對照盤面 read_bazi_corpus_chapter
哪兩柱相沖,加入流年後多出哪些關係 detect_bazi_interactions
出生鐘點換成真太陽時的結果 calculate_true_solar_time
古書只留四柱,哪些公曆日期可能符合 reverse_bazi_to_solar_times
換日或起運採用的設定 get_openfate_bazi_policy
線上排盤與延伸閱讀入口 get_openfate_bazi_resources
read_bazi_corpus_chapter

例如問:「幫我比較 1991-10-18 的 06:30 和 08:30 女盤,分別讀工作章,列出文字不同的第一段及其盤面依據。」使用 {"sampleId":"1991-10-18T08:30:00+08:00/female","topic":"work"},再把日期裡的時刻改成 06:30。回傳的 chapter.parts[].ref 可在同一筆的 data.chart 找到。讀者也能用 readerUrl 在瀏覽器打開同一章。線上命盤庫

read_bazi_relationship

接受和排盤工具相同的出生輸入。感情章在 data.reading,其中的 evidence 記錄原始值與它在 data.chart 的位置。省略出生時辰時,回傳 unknown-hour。同時提供 IANA 時區名稱與數字時區時,明確填入的數字時區及夏令時間偏移優先;偏移資料填不齊時,依 IANA 時區換算。可從 timezoneBasis 查閱實際採用的設定。

calculate_bazi_chart

計算確定性的八字命盤。

輸入欄位:

  • year
  • month
  • day
  • hour
  • minute
  • second
  • gender
  • calendarType
  • isLeapMonth
  • longitude
  • timezone
  • timezoneId
  • dstOffset
  • enableTrueSolarTime
  • dayBoundaryMode

MCP 固定使用 DAYUN_SECOND_V2,呼叫端不能暗中切換起運規則。精確出生時間還要搭配 timezone 或 timezoneId,並且只有 chart.daYun.timing.status 為 CALCULATED、版本為 DAYUN_SECOND_V2 時才能呈現精確起運時間。UNAVAILABLE 會說明原因,原有起運欄位只作 明確標記的舊版 fallback。若要校正真太陽時,還應提供 longitude。

detect_bazi_interactions

偵測本命盤及選填流年、大運地支的原始關係。

輸入欄位為 yearBranch、monthBranch、dayBranch,以及選填的 hourBranch、annualBranch、dayunBranch。出生時辰未知時省略 hourBranch,不會補入假設時柱。原有只傳流年的呼叫方式仍可使用。

支援類型:

  • 沖
  • 六合
  • 含旺支的半合(COMBINATION_HALF)
  • 三合
  • 三會
  • 刑
  • 破
  • 害

同一地支出現在不同柱位時,每個關係都會保留。例如申、寅、申、申會回傳三組不同柱位的寅申沖。流年與大運分別使用 annual、dayun 角色,即使地支相同,也不會與本命柱位合併。

半合口徑涵蓋申子、子辰、寅午、午戌、亥卯、卯未、巳酉、酉丑八組,每組都含子午卯酉其中一個旺支。申辰等兩端支不屬於此半合類型。三合齊全時,原始資料仍保留其中的半合關係。

每個關係包含穩定的 id,以及逐項對應的 branches、pillars。targetElement 只表示關係指向的五行,不代表已經合化。合類的 transformationStatus 為 NOT_EVALUATED,表示尚未評估合化,並非已成化或已判定不能化;其他關係使用 NOT_APPLICABLE。這些資料不是可直接累加的評分,也不會自動解沖;成立程度與解讀須由獨立分析層處理。

為相容既有 API,完整 TRINE、DIRECTIONAL 關係仍保留舊欄位 resultElement,值與 targetElement 相同,也僅表示五行指向。六合與半合不回傳 resultElement。

calculate_true_solar_time

直接計算真太陽時。

當使用者問「為什麼 OpenFate 算出的時柱跟一般排盤網站不同」時,可以用這個工具說明差異。

reverse_bazi_to_solar_times

要重排任鐵樵自記的八字,可以把這句貼進已連上工具的對話。

請用 reverse_bazi_to_solar_times 查 1900 到 2026 年有哪些日期符合「癸巳 戊午 丙午 壬辰」,採子初換日(ZI_HOUR_23)。每個日期取上午 8 點半,再用 calculate_bazi_chart 排男命,東經 120°、UTC+8、無夏令時間,開啟真太陽時。列出日期和重排後的四柱。

工具先按鐘錶時間找出兩個日期。各取上午 8 點半重排,換算真太陽時後,四柱仍是癸巳、戊午、丙午、壬辰。1953 年 6 月 24 日 · 2013 年 6 月 9 日 · 對讀任氏兩張命例

get_openfate_bazi_policy

回傳 OpenFate 的計算口徑:

  • 有出生地資料時,優先使用真太陽時。
  • 預設換日規則是 ZI_HOUR_23。
  • 如果出生證明時間包含夏令時間,應傳入 dstOffset。
  • 大運起運固定採用 DAYUN_SECOND_V2;只有計算成功的 timing receipt 才是精確起運時間。
  • 八字反查只能當候選搜尋,不能取代精準排盤。
  • 地支互動保留原始柱位關係,不代表加權分數或自動合化結果。
get_openfate_bazi_resources

回傳 OpenFate 的官方連結,包括排盤、解讀、合盤、財富、真太陽時與 llms.txt。

回傳格式

回傳資料使用穩定、適合機器讀取的英文 key:

{
  "data": {
    "chart": {},
    "policy": {}
  },
  "attribution": {
    "brand": "OpenFate.ai",
    "url": "https://openfate.ai",
    "engine": "@openfate/bazi-engine",
    "trueSolarTimeEngine": "@openfate/true-solar-time"
  }
}

署名資訊會以一般資料欄位回傳,而不是藏在 _meta,方便 MCP client 或 AI 產生的圖表正確顯示來源。

排盤結果同時包含十神、藏干、納音、旬空、十二長生等柱位資料、版本化大運起運 receipt、標準化陽曆/農曆日期,以及實際採用的計算口徑。

開發

若要從原始碼製作桌面擴充套件,請先安裝依賴,再執行 npm run mcpb:pack。成品位於 release/openfate-bazi-mcp-v<version>.mcpb。維護者可於 Smithery 登入後使用 npm run smithery:publish。

npm install
npm run build
npm run smoke

smoke 測試會啟動編譯後的 stdio server,並透過真正的 MCP SDK client 呼叫工具。

不編譯 dist 時可執行 npm run smoke:source 驗證原始碼。須具備相鄰的 ../bazi-engine 原始碼工作目錄,且引擎與本套件都已安裝依賴。測試專用的 tests/tsconfig.source.json 將 @openfate/bazi-engine 指向該引擎的 src/index.ts;測試執行器會把設定傳給 MCP SDK 啟動的伺服器,並先驗證實際解析的原始碼路徑。這個模式不依賴修改過的已安裝引擎,在本套件重新執行 npm ci --ignore-scripts 後仍可重現。

兩種 smoke 模式使用相同 MCP 傳輸與回歸案例,涵蓋秒級起運、缺少起運輸入、重複地支、八組半合、未知時辰,以及流年/大運角色。一般 smoke 仍驗證編譯後 MCP 與已安裝的 npm 公開引擎。npx tsc --noEmit -p tests/tsconfig.source.json 可檢查協調中的原始碼契約,不產生編譯檔案。

引擎相容性

0.5 版使用 @openfate/bazi-engine@2.2.0。測試會啟動 stdio 伺服器,比對 MCP 與 SDK 回傳的命盤和解讀,並涵蓋出生時辰不詳及歷史夏令時間。測試命例

隱私

排盤在本機 MCP 程序中執行。你選用的 AI 客戶端會收到工具輸入與結果,並依該客戶端的設定處理對話。

OpenFate 連結

授權

MIT

Questions about OpenFate Bazi

What is the OpenFate Bazi MCP server?

OpenFate Bazi MCP with True Solar Time, Four Pillars, Da Yun, and branch interactions. OpenFate Bazi is maintained by openfate-ai on GitHub at openfate-ai/openfate-mcp, and works with AI apps that support the Model Context Protocol, such as Claude, Cursor and VS Code.

How do I install the OpenFate Bazi MCP server?

Add OpenFate Bazi to your AI app's MCP config with the command npx -y @openfate/bazi-mcp@0.5.0. In Claude Code, run claude mcp add --transport stdio openfate -- npx -y @openfate/bazi-mcp@0.5.0. To run OpenFate Bazi this way you need Node.js installed.

Does OpenFate Bazi need an API key?

The registry lists no required keys for OpenFate Bazi. Check the OpenFate Bazi README for optional settings, and expect a remote server to ask you to sign in the first time you connect.

Is OpenFate Bazi an official MCP server?

No. OpenFate Bazi is a community server maintained by openfate-ai. Community servers can be excellent; read the code and the open issues before you give OpenFate Bazi access to company data.

What license is OpenFate Bazi under?

OpenFate Bazi is released under the MIT license, according to its GitHub repository. The license covers the code of OpenFate Bazi; the service it connects to has its own terms.