by openfate-ai
OpenFate Bazi MCP server with deterministic Four Pillars calculation, True Solar Time, branch interactions, and reverse Bazi lookup.
# Add to your Claude Code skills
git clone https://github.com/openfate-ai/openfate-mcpGuides for using mcp servers skills like openfate-mcp.
openfate-mcp is an open-source mcp servers skill for AI coding assistants such as Claude Code, Codex CLI, and ChatGPT, built by openfate-ai. OpenFate Bazi MCP server with deterministic Four Pillars calculation, True Solar Time, branch interactions, and reverse Bazi lookup. It has 166 GitHub stars.
openfate-mcp's catalog security scan is still queued. You can run an instant dependency and prompt-injection check now with the "Scan for vulnerabilities" button above.
Clone the repository with "git clone https://github.com/openfate-ai/openfate-mcp" and add it to your Claude Code skills directory (see the Installation section above).
openfate-mcp is primarily written in TypeScript. It is open-source under openfate-ai on GitHub, so you can review or fork the full source.
Yes. AgentsLLM lists many other MCP Servers skills you can browse and compare side by side. Open the MCP Servers category from the badge at the top of this page, or use the Related Skills and comparison links further down to weigh openfate-mcp against similar tools.
No comments yet. Be the first to share your thoughts!
Top skills in this category by stars
Unlocks once the catalog security scan passes (runs nightly).
The deep catalog scan for this skill is still queued. Run an instant dependency check now instead.
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 · 繁體中文安裝
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.
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/[email protected]
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/[email protected] directly starts a process that waits for an MCP client on stdin. Claude Code MCP setup
Paste this into your connected client:
Use
read_bazi_relationshipfor 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
{
"mcpServers": {
"openfate-bazi": {
"command": "npx",
"args": ["-y", "@openfate/bazi-mcp"]
}
}
}
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"]
}
}
}
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"]
}
}
}
{
"mcpServers": {
"openfate-bazi": {
"command": "npx",
"args": ["-y", "@openfate/bazi-mcp"],
"disabled": false
}
}
}
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.
| 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_chapterTry {"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_relationshipReturns 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_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 chartin