BaZi Astrology MCP server

Provides a bridge to Chinese BaZi astrology calculations, enabling fortune-telling and personality analysis based on birth date and time without specialized knowledge of the complex calculation systems.
Back to servers
Provider
Cantian AI
Release date
Apr 27, 2025
Language
TypeScript
Stats
67 stars

The Bazi MCP by Cantian AI is an advanced metaphysical Bazi calculator designed to provide accurate Chinese astrological calculations. It addresses the inaccuracies in existing AI fortune-telling tools like GPT and DeepSeek, delivering reliable Bazi data for personality analysis, destiny forecasting, and other metaphysical applications.

Installation

Prerequisites

You'll need Node.js 22 or above installed on your system.

Manual Installation

  1. Clone the repository and navigate to its directory:

    git clone https://github.com/cantian-ai/bazi-mcp.git
    cd bazi-mcp
    
  2. Install dependencies:

    npm i
    
  3. Configure your AI application (e.g., Claude Desktop) by adding the following to its configuration:

    {
      "mcpServers": {
        "Bazi": {
          "command": "node",
          "args": ["{Absolute path of the repository directory}/dist/stdio.js"]
        }
      }
    }
    

Automatic Installation via Smithery

For a simpler installation process with Claude Desktop, use Smithery:

npx -y @smithery/cli install @cantian-ai/bazi-mcp --client claude

Usage

The Bazi MCP provides two main tools for calculating Bazi results:

Using Lunar Date Calculations

The buildBaziFromLunarDatetime tool calculates Bazi results based on lunar datetime:

Arguments:

  • lunarDatetime: String - Lunar datetime (Example: "2000-05-15 12:00:00")
  • gender: Number (Optional) - 0 for female, 1 for male (default: 1)
  • eightCharProviderSect: Number (Optional) - Configuration for eight char provider:
    • 1: day stem of 23:00-23:59 is for tomorrow
    • 2: day stem of 23:00-23:59 is for today (default)

Using Solar Date Calculations

The buildBaziFromSolarDatetime tool calculates Bazi results based on solar datetime:

Arguments:

  • solarDatetime: String - Solar datetime in ISO format (Example: "2000-05-15T12:00:00+08:00")
  • gender: Number (Optional) - 0 for female, 1 for male
  • eightCharProviderSect: Number (Optional) - Same configuration options as above

Understanding Bazi Results

The tools return comprehensive Bazi results in JSON format, including:

  • Personal details (gender, solar and lunar dates)
  • Year, month, day, and hour pillars with:
    • Heavenly stems (天干)
    • Earthly branches (地支)
    • Five elements (五行)
    • Yin-Yang attributes (阴阳)
    • Ten gods/spirits (十神)
    • Hidden stems (藏干)
    • Musical notes (纳音)
    • Luck cycle information (旬, 空亡, 星运, 自坐)
  • Special readings (胎元, 胎息, 命宫, 身宫)
  • Auspicious and inauspicious influences (神煞)

Here's an example of what the result looks like (abbreviated):

{
  "性别": "女",
  "阳历": "2000年1月3日 10:24:00",
  "农历": "农历己卯年十一月廿七辛巳时",
  "年柱": {
    "天干": { "天干": "己", "五行": "土", "阴阳": "阴", "十神": "正印" },
    "地支": { "地支": "卯", "五行": "木", "阴阳": "阴", "藏干": { "主气": { "天干": "乙", "十神": "正财" } } },
    "纳音": "城头土",
    "旬": "甲戌",
    "空亡": "申酉",
    "星运": "胎",
    "自坐": "病"
  }
  // Additional pillars and information omitted for brevity
}

For more information or support, contact: [email protected]

How to add this MCP server to Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > MCP and click "Add new global MCP server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "cursor-rules-mcp": {
            "command": "npx",
            "args": [
                "-y",
                "cursor-rules-mcp"
            ]
        }
    }
}

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later