OpenFate Bazi MCP — Claude Code MCP server: install
An MCP server for Bazi chart calculations, True Solar Time, and branch interactions. It helps agents return structured results for birth data and related date searches.
claude mcp add bazi-mcp -- npx -y @openfate/bazi-mcpWhat OpenFate Bazi MCP does
OpenFate Bazi MCP gives an agent tools for Bazi chart calculation, True Solar Time, reverse date lookup, and Earthly Branch relationship detection. Its exposed tools include calculate_bazi_chart, calculate_true_solar_time, reverse_bazi_to_solar_times, and detect_bazi_interactions, along with policy and resource lookups.
The server uses @openfate/bazi-engine and @openfate/true-solar-time, then returns machine-readable JSON. Branch relationships remain separate occurrences, while reverse lookup produces candidate Gregorian datetimes that need a later recalculation. An exact birth time plus timezone or timezoneId is needed for a calculated result, and longitude is required for the True Solar Time correction. Without those values, the calculation does not include that full correction.
What it helps with
- calculate a Bazi chart from birth details
- apply longitude and timezone corrections
- detect Earthly Branch relationships in a natal chart
- search for Gregorian dates matching four pillars
- retrieve the Da Yun and day-boundary policy
Example prompts for the agent
- Calculate a Bazi chart from this exact birth time, timezone, and longitude.
- Explain why the hour pillar changes when True Solar Time is applied.
- Detect the branch relationships in this chart and keep annual and Da Yun branches separate.
How to install OpenFate Bazi MCP
Platform CLI
claude mcp add bazi-mcp -- npx -y @openfate/bazi-mcpPlatform CLI
codex mcp add openfate-bazi-mcp -- npx -y @openfate/bazi-mcpConfig file
{
"mcpServers": {
"openfate-bazi-mcp": {
"command": "npx",
"args": [
"-y",
"@openfate/bazi-mcp"
]
}
}
}Config file
{
"servers": {
"openfate-bazi-mcp": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"@openfate/bazi-mcp"
]
}
}
}Platform CLI
gemini mcp add openfate-bazi-mcp npx -y @openfate/bazi-mcpStep by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more
Questions about OpenFate Bazi MCP
How do I install OpenFate Bazi MCP in Claude Code?
Run claude mcp add bazi-mcp -- npx -y @openfate/bazi-mcp. The server can then be used from Claude Code.
What does OpenFate Bazi MCP do?
It calculates Bazi charts and True Solar Time, searches for possible Gregorian datetimes from four pillars, and detects Earthly Branch relationships. Results are returned to the agent as JSON.
What data is needed for a True Solar Time calculation?
Provide the exact birth time and either timezone or timezoneId; include longitude for the True Solar Time correction. Pass dstOffset when the recorded birth time includes daylight saving.