← Directory

cantian-ai/bazi-mcp

Open Source
• Updated Jun 4, 2026, 06:31 PM

Bazi, also known as the Four Pillars of Destiny, is a traditional Chinese astrological system that uses a person's birth date and time to construct a chart of heavenly stems and earthly branches.

Use Cases ▼
01

Developers building AI chatbots that offer personalized Bazi-based fortunes and advice.

02

Hobbyists creating a personal astrology assistant that runs locally with Claude Desktop.

03

Educational platforms teaching traditional Chinese metaphysics with interactive chart generation.

04

Integrating Bazi analysis into dating apps for compatibility matching.

05

Research projects studying correlations between Bazi patterns and real-world outcomes.

What Problem It Solves ▼

Bazi analysis traditionally requires deep expertise or manual consultation with almanacs, making it inaccessible for casual users and hard to integrate into digital products. The bazi-mcp server solves this by providing a reliable, programmatic way to generate accurate Bazi charts and expose them to AI models, enabling automated, conversational astrology experiences without needing to implement complex Chinese calendar algorithms from scratch.

Key Features ▼
✓

Free and open-source

✓

Seamless integration with AI via MCP

✓

Accurate Bazi calculations using tymext

✓

Flexible deployment options (Docker, npx)

✓

Extensible tool design for custom analysis

Overview

Bazi, also known as the Four Pillars of Destiny, is a traditional Chinese astrological system that uses a person's birth date and time to construct a chart of heavenly stems and earthly branches. This chart forms the basis for personality analysis, life path prediction, and compatibility assessment. The bazi-mcp server bridges this ancient practice with modern AI by providing a standardized interface for AI assistants to compute and interpret Bazi charts. It implements the Model Context Protocol (MCP), allowing seamless integration with MCP-compatible clients like Claude Desktop or any LLM-powered application.

Full Description ▼

Built as a Node.js server using TypeScript, bazi-mcp accepts birth date, time, and optional location parameters and returns detailed Bazi charts including the eight characters, animal signs, element distribution, and other derived information. The server leverages the tymext library for accurate Chinese calendar calculations and supports both Gregorian and lunar dates. It provides multiple MCP tools for different levels of analysis, from basic chart generation to detailed elemental balance assessments, and supports stdio and streamable HTTP transports for flexible deployment via npx or Docker.

Key features include comprehensive chart breakdowns, easy extensibility for custom analysis tools, and an open-source design that encourages community contributions. The server handles the computational heavy lifting of Bazi, while the interpretive part relies on the AI model's capabilities, making it a versatile backend for astrology-focused chatbots, personal assistants, or research tools. Its containerized deployment and detailed documentation lower the barrier for developers to incorporate traditional Chinese metaphysics into their software solutions.

Pros & Cons

Pros

+

Free and open-source

+

Seamless integration with AI via MCP

+

Accurate Bazi calculations using tymext

+

Flexible deployment options (Docker, npx)

+

Extensible tool design for custom analysis

Cons

−

Requires technical setup and MCP client

−

Limited to Bazi; no other astrology systems

−

Interpretation depth depends on the AI model

Similar Tools

lunar-javascript bazi astrology-mcp chinese-zodiac-api

More in Developer Tools