# OpenFate Bazi MCP

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.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed · ★ 160
- Author: openfate-ai
- License: MIT · policy=link-only · description only; the file stays with the author
- Source: https://github.com/openfate-ai/openfate-mcp
- Updated: 2026-09-20
- HTML: https://affpapa.org/en/nevibecode/mcp/openfate-bazi-mcp

## What it 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.

## Requirements
- Needs: Node.js (commands run via npx)

## Install

### Claude Code (native platform)

**Platform CLI**
```bash
claude mcp add bazi-mcp -- npx -y @openfate/bazi-mcp
```

### Codex

**Platform CLI**
```bash
codex mcp add openfate-bazi-mcp -- npx -y @openfate/bazi-mcp
```

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "openfate-bazi-mcp": {
            "command": "npx",
            "args": [
                "-y",
                "@openfate/bazi-mcp"
            ]
        }
    }
}
```

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "openfate-bazi-mcp": {
            "type": "stdio",
            "command": "npx",
            "args": [
                "-y",
                "@openfate/bazi-mcp"
            ]
        }
    }
}
```

### Gemini CLI

**Platform CLI**
```bash
gemini mcp add openfate-bazi-mcp npx -y @openfate/bazi-mcp
```

## When to use it
- 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
- 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.

## Similar
- [REA](https://affpapa.org/en/nevibecode/mcp/rea.md) — MCP server · ★ 386989
- [GitHub](https://affpapa.org/en/nevibecode/mcp/github.md) — MCP server · ★ 33918
- [Netdata](https://affpapa.org/en/nevibecode/mcp/netdata.md) — MCP server · ★ 81115
- [browser-use](https://affpapa.org/en/nevibecode/mcp/browser-use.md) — MCP server · ★ 119160
- [Codebase Memory](https://affpapa.org/en/nevibecode/mcp/codebase-memory.md) — MCP server · ★ 47392
- [mcp-server](https://affpapa.org/en/nevibecode/mcp/mcp-server.md) — MCP server · ★ 43872

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
