Skip to main content
Glama
Four Pillars MCP Server

Four Pillars MCP Server

Four Pillars MCP Server

MCP server License: MIT

An MCP server for deterministic BaZi (八字) Four Pillars calculation from a local date, time, IANA timezone, and longitude.

Built for transparent calendrical and software workflows that need year, month, day, and hour pillars without address geocoding, gender-dependent luck cycles, stored birth data, or automated interpretation.

Why this is useful

  • Coordinates in, no hidden location lookup. Callers pass the timezone and longitude they already trust.

  • True solar time included. Day and hour calculations use local apparent solar time; the response exposes the correction details.

  • Solar-term aware. Year and month use astronomical solar-term boundaries.

  • Facts before interpretation. The tool returns versioned chart facts, not guaranteed predictions.

Related MCP server: OpenFate Bazi MCP

Tool

calculate_four_pillars

Input:

{
  "date": "1990-05-20",
  "time": "14:30",
  "timezone": "Asia/Shanghai",
  "longitude": 104.0668,
  "latitude": 30.5728
}

The calculation uses:

  • local apparent true solar time for day and hour calculations;

  • astronomical solar-term boundaries for year and month;

  • 23:00 Zi-hour as the next-day boundary;

  • explicit engine and rules versions in every result.

The result contains the year, month, day, and hour pillars, stem and branch elements, yin-yang labels, Day Master, time correction details, nearby solar-term information, warnings, and provenance.

Quick start

git clone https://github.com/cdaily1995-create/four-pillars-mcp.git
cd four-pillars-mcp
pnpm install
pnpm build
node dist/server.js

MCP client configuration:

{
  "mcpServers": {
    "four-pillars": {
      "command": "node",
      "args": ["/absolute/path/to/four-pillars-mcp/dist/server.js"]
    }
  }
}

Example

calculate_four_pillars {
  "date": "2005-12-23",
  "time": "08:37",
  "timezone": "Asia/Shanghai",
  "longitude": 121.4737,
  "latitude": 31.2304
}

The response contains the four pillar names, stem and branch elements, yin-yang labels, Day Master, true-solar correction details, nearby solar-term information, warnings, and engine/rules versions.

Input contract

Field

Required

Description

date

yes

Local civil date in YYYY-MM-DD.

time

yes

Local civil time in HH:mm.

timezone

yes

IANA identifier such as Asia/Shanghai or America/Los_Angeles.

longitude

yes

Decimal degrees, east positive, from -180 to 180.

latitude

no

Decimal degrees, from -90 to 90; retained for traceability.

Search-friendly description

This project is a Four Pillars of Destiny calculator for BaZi birth-chart normalization. It provides reproducible year, month, day, and hour pillars from date, time, timezone, and longitude, including true solar time and solar-term handling. It is intended for calendrical and software workflows that need transparent calculation facts rather than automated fortune-telling claims.

Privacy and scope

The server accepts coordinates and time-zone identifiers only. There is no address search, analytics, database, account, payment, or remote API requirement. Results are calculated locally by the process running the MCP server.

Traditional BaZi meanings are culturally interpretive and are not presented here as scientific proof, diagnosis, or guaranteed prediction.

License

MIT

Available Tools

1 tool
calculate_four_pillarsA
Read-onlyIdempotent

Calculate the BaZi (Four Pillars) chart from a local birth date, time, IANA timezone, and decimal longitude. The calculation uses local apparent true solar time, astronomical solar-term boundaries, and the 23:00 Zi-hour next-day boundary. Returns only reproducible chart facts and provenance, not interpretation or prediction.

Inputs: date (required), time (required), timezone (required), longitude (required), +1 more.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A4.1/5.0

    Scored across 1 tool

    Disambiguation5/5

    With only one tool in the set, there is no possibility of misselection or overlap. The tool's purpose (compute a BaZi chart from birth data) is unambiguous and clearly stated.

    Naming Consistency5/5

    The single name calculate_four_pillars follows a clean verb_noun snake_case convention. There is no competing convention to create inconsistency.

    Tool Count3/5

    One tool is on the thin side even for a narrowly scoped domain. The server is defensible as a single-purpose calculator, but a single operation gives an agent no alternative entry points.

    Completeness3/5

    The core calculation is covered, but the surface stops there. Useful companions such as solar-term lookup, current-pillar calculation, or input validation (timezone/longitude checks) are absent, leaving dead ends for follow-up questions.

    Maintenance

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    • InsightBaZi exposes a public, read-only MCP tool (`calculate_bazi_chart`) that calculates BaZi pillars, hidden stems, Ten Gods, and Five Elements from birth inputs. Birth date and an IANA time zone are required. Recorded birth time, birthplace longitude, a birthplace display label, gender, and one of ten supported languages are optional. The birthplace label is for display; it does not look up coordinates. With a birth time, the tool returns all Four Pillars and true solar time, using the supplied longitude or an estimated time-zone meridian when longitude is omitted. Without a birth time, it returns Year, Month, and Day Pillars only, assumes a birth before 23:00 for the Day Pillar, and omits true solar time and luck pillars. Luck pillars require both birth time and gender. Historical daylight-saving offsets are derived automatically from the IANA time zone and birth date/time; there is no separate DST input, and the recorded time should not be pre-adjusted. Supported languages are English, Simplified Chinese, Traditional Chinese, Japanese, Korean, Thai, Indonesian, Spanish, Portuguese, and French. No authentication is required.

    • Bazi (Four Pillars) and Qimen Dunjia charts with true solar time and historical time zones.

      https://xiaodaox.com/mcp
    • Cast a BaZi (Four Pillars) chart with true solar time, plus a reflective personality sketch.

    • BaZi (Four Pillars) and Zi Wei Dou Shu chart calculation with true solar time. No install or login.

      1
      https://mcp.bazichart.ai/mcp

    Related MCP Servers

    • F
      license
      Not graded
      quality
      Not graded
      maintenance
      Calculates Chinese BaZi (Four Pillars of Destiny) charts based on birth date, time, and location, including solar term information, decade luck cycles, and true solar time corrections.
      2
      -
    • A
      license
      A
      quality
      B
      maintenance
      Enables AI agents to calculate deterministic Bazi (Four Pillars) charts with True Solar Time and Earthly Branch interactions, avoiding LLM hallucination of calendrical math.
      6
      181 npm
      162
      MIT
    • A
      license
      Not graded
      quality
      C
      maintenance
      Provides precise Chinese metaphysics chart calculation (Bazi, Ziwei, Qimen) with true solar time correction, outputting structured JSON and Markdown for AI integration.
      3
      MIT
    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables calculation of Four Pillars of Destiny (BaZi) charts using true solar time and a global geographic database, providing pillars, Da Yun, and branch interactions for any location and time.
      36 npm
      1
      MIT