Content
# Bazi MCP (八字 MCP) by Cantian AI
[](https://smithery.ai/server/@cantian-ai/bazi-mcp)
[](https://mseep.ai/app/453ac410-d93a-45fb-8563-7d3cccfbe956)
Unlock precise Bazi insights with the **Bazi MCP**, the first AI-powered Bazi calculator. Built to address inaccuracies in existing AI fortune-telling tools like GPT and DeepSeek, our MCP delivers reliable Bazi data for personality analysis, destiny forecasting, and more.
### Why Bazi MCP?
- **Accurate Bazi Calculations**: Provide insightful Bazi information.
- **AI Agent Integration**: Empowers AI agents with precise Bazi data.
- **Community-Driven**: Join enthusiasts to advance Chinese metaphysics.
Originating from the popular [_Chinese Bazi Fortune Teller_](https://chatgpt.com/g/g-67c3f7b74d148191a2167f44fd13412d-chinese-bazi-fortune-teller-can-tian-ba-zi-suan-ming-jing-zhun-pai-pan-jie-du) GPTs in the GPT Store, this project is now integrated with **Cantian AI** ([cantian.ai](https://cantian.ai)). We invite Bazi practitioners and AI enthusiasts to collaborate, share insights, and contribute to our open-source community.
### Get Involved
- **Contact**: [support@cantian.ai](mailto:support@cantian.ai)
## English
**BaZi MCP** is the first MCP launched by Santian AI aimed at the field of metaphysics. It addresses the common charting errors found in fortune-telling tools like GPT and DeepSeek, providing accurate BaZi data to assist in applications such as personality analysis and fate prediction.
### Bazi MCP Highlights
- **Precise Charting**: Provides comprehensive Bazi (八字) charting information.
- **AI Empowerment**: Offers reliable Bazi services for AI entities.
- **Community Co-Creation**: Invites enthusiasts of fortune-telling to participate in communication and development.
The project originated from the popular GPT Store application [_Chinese Bazi Fortune Teller_](https://chatgpt.com/g/g-67c3f7b74d148191a2167f44fd13412d-chinese-bazi-fortune-teller-can-tian-ba-zi-suan-ming-jing-zhun-pai-pan-jie-du) and has now been integrated into the **Cantian AI** platform ([cantian.ai](https://cantian.ai)). We sincerely invite researchers in fortune-telling and AI developers to join us in promoting the inheritance and innovation of Chinese traditional culture.
### Contact Us
- **Email**: [support@cantian.ai](mailto:support@cantian.ai)
- **WeChat**:
<img src="https://github.com/user-attachments/assets/7790b64e-e03f-47e2-b824-38459549a6d8" alt="WeChat QR Code" width="200"/>
## 前置需求 | Prerequisite
Node.js 22 or above.
## 开始使用 | Start
### Start by Streamable HTTP transport
```shell
npm start
```
### Start by Stdio transport | 使用 Stdio 启动
Configure AI application (e.g. Claude Desktop).
```json
{
"mcpServers": {
"Bazi": {
"command": "npx",
"args": ["bazi-mcp"]
}
}
}
```
### Installing via Smithery
To install bazi-mcp for Claude Desktop automatically via [Smithery](https://smithery.ai/server/@cantian-ai/bazi-mcp):
```bash
npx -y @smithery/cli install @cantian-ai/bazi-mcp --client claude
```
## 工具列表 | Tools
### getBaziDetail
> Calculate the Bazi (八字) results based on the solar/lunar datetime.
#### 参数 | Arguments
- solarDatetime: `String`
> ISO 格式的阳历时间。例如:`2000-05-15T12:00:00+08:00`。
> Solar datetime in ISO format. Example: `2000-05-15T12:00:00+08:00`.
- lunarDatetime: `String`
> 农历时间。例如:`2000-05-15 12:00:00`。
> Lunar datetime. Example: `2000-05-15 12:00:00`.
- gender: `Number`
> 性别。可选。0 - 女,1-男。默认 1。
> Gender. Optional. 0 for female, 1 for male. 1 by default.
- eightCharProviderSect: `Number`
> 早晚子时配置。可选。1 - 表示 23:00-23:59 日干支为明天,2 - 表示 23:00-23:59 日干支为当天。默认 2。
> Configuration for eight char provider. Optional. 1 for meaning the day stem of 23:00-23:59 is for tomorrow, 2 for meaning the day stem of 23:00-23:59 is for today. 2 by default.
#### 结果示例 | Result example
```json
{
"Gender": "Male",
"Gregorian": "July 31, 1998 14:10:00",
"Lunar": "Lunar Year of Wu Yin, June 9, Xin Wei Hour",
"BaZi": "Wu Yin, Ji Wei, Ji Mao, Xin Wei",
"Zodiac": "Tiger",
"Day Master": "Ji",
"Year Pillar": {
"Heavenly Stem": {
"Heavenly Stem": "Wu",
"Five Elements": "Earth",
"Yin Yang": "Yang",
"Ten Gods": "Rob Wealth"
},
"Earthly Branch": {
"Earthly Branch": "Yin",
"Five Elements": "Wood",
"Yin Yang": "Yang",
"Hidden Stems": {
"Main Qi": {
"Heavenly Stem": "Jia",
"Ten Gods": "Direct Officer"
},
"Middle Qi": {
"Heavenly Stem": "Bing",
"Ten Gods": "Direct Seal"
},
"Remaining Qi": {
"Heavenly Stem": "Wu",
"Ten Gods": "Rob Wealth"
}
}
},
"Na Yin": "Earth on City Wall",
"Xun": "Jia Xu",
"Kong Wang": "Shen You",
"Star Luck": "Death",
"Self-Sitting": "Long Life"
},
"Month Pillar": {
"Heavenly Stem": {
"Heavenly Stem": "Ji",
"Five Elements": "Earth",
"Yin Yang": "Yin",
"Ten Gods": "Peer"
},
"Earthly Branch": {
"Earthly Branch": "Wei",
"Five Elements": "Earth",
"Yin Yang": "Yin",
"Hidden Stems": {
"Main Qi": {
"Heavenly Stem": "Ji",
"Ten Gods": "Peer"
},
"Middle Qi": {
"Heavenly Stem": "Ding",
"Ten Gods": "Partial Seal"
},
"Remaining Qi": {
"Heavenly Stem": "Yi",
"Ten Gods": "Seven Kill"
}
}
},
"Na Yin": "Fire in the Sky",
"Xun": "Jia Yin",
"Kong Wang": "Zi Chou",
"Star Luck": "Crown",
"Self-Sitting": "Crown"
},
"Day Pillar": {
"Heavenly Stem": {
"Heavenly Stem": "Ji",
"Five Elements": "Earth",
"Yin Yang": "Yin"
},
"Earthly Branch": {
"Earthly Branch": "Mao",
"Five Elements": "Wood",
"Yin Yang": "Yin",
"Hidden Stems": {
"Main Qi": {
"Heavenly Stem": "Yi",
"Ten Gods": "Seven Kill"
}
}
},
"Na Yin": "Earth on City Wall",
"Xun": "Jia Xu",
"Kong Wang": "Shen You",
"Star Luck": "Illness",
"Self-Sitting": "Illness"
},
"Hour Pillar": {
"Heavenly Stem": {
"Heavenly Stem": "Xin",
"Five Elements": "Metal",
"Yin Yang": "Yin",
"Ten Gods": "Food God"
},
"Earthly Branch": {
"Earthly Branch": "Wei",
"Five Elements": "Earth",
"Yin Yang": "Yin",
"Hidden Stems": {
"Main Qi": {
"Heavenly Stem": "Ji",
"Ten Gods": "Peer"
},
"Middle Qi": {
"Heavenly Stem": "Ding",
"Ten Gods": "Partial Seal"
},
"Remaining Qi": {
"Heavenly Stem": "Yi",
"Ten Gods": "Seven Kill"
}
}
},
"Na Yin": "Earth by the Roadside",
"Xun": "Jia Zi",
"Kong Wang": "Xu Hai",
"Star Luck": "Crown",
"Self-Sitting": "Decline"
},
"胎元": "Geng Xu",
"胎息": "Jia Xu",
"命宫": "Yi Mao",
"身宫": "Yi Mao",
"神煞": {
"Year Pillar": ["National Seal", "Death God"],
"Month Pillar": ["Heavenly Virtue Union", "Monthly Virtue Union", "Heavenly Yi Nobleman", "Tai Chi Nobleman", "Fortune Star Nobleman", "Golden Carriage", "Blood Blade", "Flower Canopy", "Heavenly Joy", "Original Star"],
"Day Pillar": ["Heavenly Virtue Union", "Monthly Virtue Union", "Peach Blossom", "Nine Oxen", "Child God"],
"Hour Pillar": ["Heavenly Yi Nobleman", "Tai Chi Nobleman", "Fortune Star Nobleman", "Golden Carriage", "Blood Blade", "Flower Canopy", "Heavenly Joy", "Original Star", "Child God"]
},
"大运": {
"Start Age": 4,
"Start Date": "2001-1-26",
"大运": [
{
"干支": "Geng Shen",
"Start Year": 2001,
"End": 2010,
"Heavenly Stem Ten Gods": "Shang Guan",
"Earthly Branch Ten Gods": ["Shang Guan", "Direct Wealth", "Rob Wealth"],
"Earthly Branch Hidden Stems": ["Geng", "Ren", "Wu"],
"Start Age": 4,
"End Age": 13
},
{
"干支": "Xin You",
"Start Year": 2011,
"End": 2020,
"Heavenly Stem Ten Gods": "Food God",
"Earthly Branch Ten Gods": ["Food God"],
"Earthly Branch Hidden Stems": ["Xin"],
"Start Age": 14,
"End Age": 23
},
{
"干支": "Ren Xu",
"Start Year": 2021,
"End": 2030,
"Heavenly Stem Ten Gods": "Direct Wealth",
"Earthly Branch Ten Gods": ["Rob Wealth", "Food God", "Partial Seal"],
"Earthly Branch Hidden Stems": ["Wu", "Xin", "Ding"],
"Start Age": 24,
"End Age": 33
},
{
"干支": "Gui Hai",
"Start Year": 2031,
"End": 2040,
"Heavenly Stem Ten Gods": "Partial Wealth",
"Earthly Branch Ten Gods": ["Direct Wealth", "Direct Officer"],
"Earthly Branch Hidden Stems": ["Ren", "Jia"],
"Start Age": 34,
"End Age": 43
},
{
"干支": "Jia Zi",
"Start Year": 2041,
"End": 2050,
"Heavenly Stem Ten Gods": "Direct Officer",
"Earthly Branch Ten Gods": ["Partial Wealth"],
"Earthly Branch Hidden Stems": ["Gui"],
"Start Age": 44,
"End Age": 53
},
{
"干支": "Yi Chou",
"Start Year": 2051,
"End": 2060,
"Heavenly Stem Ten Gods": "Seven Kill",
"Earthly Branch Ten Gods": ["Peer", "Partial Wealth", "Food God"],
"Earthly Branch Hidden Stems": ["Ji", "Gui", "Xin"],
"Start Age": 54,
"End Age": 63
},
{
"干支": "Bing Yin",
"Start Year": 2061,
"End": 2070,
"Heavenly Stem Ten Gods": "Direct Seal",
"Earthly Branch Ten Gods": ["Direct Officer", "Direct Seal", "Rob Wealth"],
"Earthly Branch Hidden Stems": ["Jia", "Bing", "Wu"],
"Start Age": 64,
"End Age": 73
},
{
"干支": "Ding Mao",
"Start Year": 2071,
"End": 2080,
"Heavenly Stem Ten Gods": "Partial Seal",
"Earthly Branch Ten Gods": ["Seven Kill"],
"Earthly Branch Hidden Stems": ["Yi"],
"Start Age": 74,
"End Age": 83
},
{
"干支": "Wu Chen",
"Start Year": 2081,
"End": 2090,
"Heavenly Stem Ten Gods": "Rob Wealth",
"Earthly Branch Ten Gods": ["Rob Wealth", "Seven Kill", "Partial Wealth"],
"Earthly Branch Hidden Stems": ["Wu", "Yi", "Gui"],
```
```json
"start_age": 84,
"end_age": 93
},
{
"GanZhi": "JiSi",
"start_year": 2091,
"end": 2100,
"TianGanTenGod": "BiJian",
"DiZhiTenGod": ["ZhengYin", "ShangGuan", "JieCai"],
"DiZhiHiddenGan": ["Bing", "Geng", "Wu"],
"start_age": 94,
"end_age": 103
}
]
},
"XingChongHeHui": {
"year": {
"TianGan": {},
"DiZhi": {}
},
"month": {
"TianGan": {},
"DiZhi": {
"half_combination": [
{
"pillar": "Ri",
"knowledge_point": "WeiMao half combination of Wood",
"element": "Wood"
}
]
}
},
"day": {
"TianGan": {},
"DiZhi": {
"half_combination": [
{
"pillar": "Yue",
"knowledge_point": "MaoWei half combination of Wood",
"element": "Wood"
},
{
"pillar": "Shi",
"knowledge_point": "MaoWei half combination of Wood",
"element": "Wood"
}
]
}
},
"hour": {
"TianGan": {},
"DiZhi": {
"half_combination": [
{
"pillar": "Ri",
"knowledge_point": "WeiMao half combination of Wood",
"element": "Wood"
}
]
}
}
}
}
```
### getSolarTimes
> Return a list of possible solar calendar datetime based on the given Bazi.
> 根据给定的八字返回可能的公历时间列表。
```
#### 参数 | Arguments
- bazi: `String`
> 八字,各柱用空格隔开。
> Bazi, with each pillar separated by a space.
#### Result example | 结果示例
```json
["1758-07-29 14:00:00", "1818-07-15 14:00:00", "1998-07-31 14:00:00"]
```
### getChineseCalendar
> 获取指定公历时间(默认今天)的黄历信息。
> Get Chinese calendar information for the specified solar calendar date (default is today).
#### 参数 | Arguments
- solarDatetime
> ISO 格式的阳历时间。例如:`2000-05-15T12:00:00+08:00`。
> Solar datetime in ISO format. Example: `2000-05-15T12:00:00+08:00`.
#### Result example | 结果示例
```json
{
"Gregorian": "Wednesday, May 7, 2025",
"Lunar": "Lunar Year of the Wood Snake, 10th day of the 4th month",
"Heavenly Stems and Earthly Branches": "Yi Si, Xin Si, Bing Zi",
"Zodiac": "Snake",
"Na Yin": "Water Under the Stream",
"Solar Term": "Beginning of Summer",
"Twenty-Eight Constellations": "Ji Shui Bao Ji",
"Peng Zu's Taboo": "Bing should not repair the stove to avoid disaster; Zi should not ask for divination to avoid trouble.",
"Auspicious Direction": "Southwest",
"Yang Gui Shen Direction": "West",
"Yin Gui Shen Direction": "Northwest",
"Fortune God Direction": "East",
"Wealth God Direction": "Southwest",
"Conflict and Killing": "Conflict with Horse (Wu) killing in the South",
"Suitable Activities": "Marriage, sacrificial rites, praying for blessings, seeking offspring, consecration, travel, dismantling, breaking ground, raising beams, igniting fire, increasing population, moving into a house, relocating, bed placement, planting, livestock raising, erecting pillars, door installation, construction, resolution, meeting friends and relatives",
"Taboos": ""
}
```
**Keywords**: Bazi MCP, Bazi AI Agent, Fengshui AI Agent, Bazi Calculator MCP, Bazi Calculator AI, Cantian AI