# cantian-ai/bazi-mcp [Health: Active]

**Category:** 🔮 Spirituality & Esoterica  
**Repository:** https://github.com/cantian-ai/bazi-mcp  
**GitHub Stars:** 436  
**npm Downloads (last month):** 1241  
**Views:** 4  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/cantian-ai-bazi-mcp

## Description
Provides comprehensive and accurate Bazi (Chinese Astrology) charting and analysis

## Tools
Capabilities this server exposes over MCP:

- **getBaziDetail** — 根据时间（公历或农历）、性别来获取八字信息。solarDatetime和lunarDatetime必须传且只传其中一个。
- **getSolarTimes** — 根据八字获取公历时间列表。返回的时间格式为：YYYY-MM-DD hh:mm:ss。例如时间1998年7月31日下午2点整表示为：1998-07-31 14:00:00
- **getChineseCalendar** — 获取指定公历时间（默认今天）的黄历信息。

## Claude Desktop Quick Installation
Install path detected from listing signals. Uses `npx` (confidence: high):

```json
"mcpServers": {
  "bazi-mcp": {
    "command": "npx",
    "args": ["bazi-mcp"]
  }
}
```

## Documentation

## What cantian-ai/bazi-mcp MCP server does

cantian-ai/bazi-mcp MCP server exposes Bazi calculation and calendar functions to MCP-compatible AI applications. Bazi, also known as the Four Pillars system, uses birth date and time information to produce a structured chart. The server is listed in the Spirituality & Esoterica category and is intended for applications involving Chinese astrology, metaphysics, chart interpretation, and related research.

The main charting operation accepts either a solar-calendar datetime or a lunar datetime. It returns the four pillars and associated details, including heavenly stems, earthly branches, elemental attributes, yin-yang classifications, hidden stems, ten gods, na yin, empty branches, star positions, and self-seated states. Results can also include the fetal origin, fetal breath, life palace, body palace, auxiliary stars, major fortune periods, and pillar relationships such as combinations or partial combinations.

## How it works

The server can run through stdio or Streamable HTTP. For stdio, an MCP client launches the package with `npx bazi-mcp`. The README gives Claude Desktop as an example client and also documents an npm start command for Streamable HTTP.

`getBaziDetail` calculates a chart from an ISO solar datetime, a lunar datetime, or both according to the request. Gender is optional, with numeric values for female and male and male as the default. The `eightCharProviderSect` option controls how the late-night period from 23:00 to 23:59 is assigned to the current or following day.

`getSolarTimes` takes a space-separated Bazi string and returns possible solar-calendar datetimes. This supports workflows that start with known pillars and need candidate dates. `getChineseCalendar` returns Chinese calendar information for a supplied solar datetime, or for the current day when no date is specified.

## Setup and configuration

cantian-ai/bazi-mcp MCP server requires Node.js 22 or newer. A stdio configuration can use the following structure:

```json
{
  "mcpServers": {
    "Bazi": {
      "command": "npx",
      "args": ["bazi-mcp"]
    }
  }
}
```

The repository also documents installation through Smithery for Claude Desktop. That installation uses the Smithery CLI and targets the `@cantian-ai/bazi-mcp` package.

## Tools and capabilities

- **getBaziDetail**: Calculates detailed Bazi results from solar or lunar datetime input.
- **getSolarTimes**: Returns possible solar datetimes for a supplied Bazi.
- **getChineseCalendar**: Retrieves Chinese calendar information for a selected solar date or the default current date.

The returned chart data is structured for downstream agent analysis rather than limited to a single formatted interpretation. Developers can use the fields to build prompts, display chart components, or implement application-specific Bazi analysis.

## Limitations and notes

Applications should validate datetime formats before calling the tools.

_Full upstream README: https://allmcps.com/mcp/cantian-ai-bazi-mcp/readme_

