Featured

Deploy OpenClaw in 60 seconds โ€” 20% off logoDeploy OpenClaw in 60 seconds โ€” 20% off

Launch OpenClaw on Hostinger in about 60 seconds and keep your agent live 24/7. Our referral link gives you 20% off, no coupon code needed.

Launch on Hostinger โ†’
Run your Hermes agent on Hostinger, fully managed logoRun your Hermes agent on Hostinger, fully managed

Launch Hermes on Hostinger in one click, fully managed, no VPS knowledge needed. Use code ZACAARON10 for 10% off.

Launch on Hostinger โ†’
Crawl and scrape any site into clean data, 10% off logoCrawl and scrape any site into clean data, 10% off

Firecrawl crawls and scrapes any site into clean markdown for your agent. Get 1,000 free credits, and new users get 10% off their first purchase.

Try Firecrawl free โ†’
Your own AI agent, running 24/7 with QwikClaw logoYour own AI agent, running 24/7 with QwikClaw

QwikClaw sets up and runs an always-on OpenClaw agent for you. One click, no config files, no server setup.

Deploy now โ†’
One API to scrape, enrich, and extract the internet. logoOne API to scrape, enrich, and extract the internet.

Context.dev gives your agents a single API to scrape, enrich, and extract live web data โ€” no proxies, no parsers, no maintenance.

Start building free โ†’
SetupClaw: done-for-you OpenClaw for founders & exec teams logoSetupClaw: done-for-you OpenClaw for founders & exec teams

White-glove OpenClaw for founders and exec teams (4โ€“50+ employees): we install, harden, integrate your tools, and maintain it โ€” secured from day one.

Get it set up for you โ†’
SEO data APIs for your agent, $1 free credit logoSEO data APIs for your agent, $1 free credit

DataForSEO gives your agent live access to SERP results, keyword data, backlinks, and on-page SEO data through one API. New accounts get a $1 credit, good for up to 20,000 keyword or backlink lookups.

Try DataForSEO free โ†’
Reach 47,000+ AI builders

A flat monthly placement in front of developers actively installing AI tools. No lock-in, cancel anytime.

Advertise here โ†’

Works with

Claude CodeClaude DesktopCursorVS CodeClineCodex CLIOpenClaw+ any MCP client

Install to Claude Code

This server doesn't publish a one-line install command. Follow the setup in the source repository.

Summary

shunshi-ai/bazi-reader-mcp MCP server](https://glama.ai/mcp/servers/shunshi-ai/bazi-reader-mcp/badges/score.svg)](https://glama.ai/mcp/servers/shunshi-ai/bazi-reader-mcp) ๐Ÿ“‡ ๐Ÿ  ๐ŸŽ ๐ŸชŸ ๐Ÿง - Bazi (Four Pillars / ๅ››ๆŸฑๆŽจๅ‘ฝ / ์‚ฌ์ฃผํŒ”์ž) charting MCP server with true...

README.md

bazi-reader-mcp

๐Ÿ‡จ๐Ÿ‡ณ ไธญๅ›ฝๅ…ซๅญ— (Four Pillars of Destiny) ใƒป ๐Ÿ‡ฏ๐Ÿ‡ต ๅ››ๆŸฑๆŽจๅ‘ฝ (ใ—ใกใ‚…ใ†ใ™ใ„ใ‚ใ„) ใƒป ๐Ÿ‡ฐ๐Ÿ‡ท ์‚ฌ์ฃผํŒ”์ž (ๅ››ๆŸฑๅ…ซๅญ—) The calculation engine (and MCP server) behind Shunshi.AI / ้กบๆ—ถ, open-sourced.

![License: MIT](LICENSE) ![Powered by Shunshi.AI](https://shunshi.ai) ![Node](#)

๐Ÿ‡ฏ๐Ÿ‡ต ๆ—ฅๆœฌใฎ้–‹็™บ่€…ใฎๆ–นใธ: ใ“ใ‚Œใฏไธญๅ›ฝใฎใ€Œๅ…ซๅญ— (bฤzรฌ)ใ€โ€” ๆ—ฅๆœฌใง่จ€ใ† ๅ››ๆŸฑๆŽจๅ‘ฝ ใฎ่จˆ็ฎ—ใ‚จใƒณใ‚ธใƒณ + MCP ใ‚ตใƒผใƒใƒผใงใ™ใ€‚็”Ÿๅนดๆœˆๆ—ฅใƒปๅ‡บ็”Ÿๆ™‚ๅˆปใƒปๅ‡บ็”Ÿๅœฐใ‹ใ‚‰ๅ››ๆŸฑ / ๅ็ฅž / ๅคง้‹ / ไบ”่กŒใƒใƒฉใƒณใ‚นใ‚’่จˆ็ฎ—ใงใใพใ™ใ€‚็œŸๅคช้™ฝๆ™‚๏ผˆๅ‡ๆ™‚ๅทฎ๏ผ‰่ฃœๆญฃใซใ‚‚ๅฏพๅฟœใ—ใฆใŠใ‚Šใ€AI ใ‚จใƒผใ‚ธใ‚งใƒณใƒˆ (Claude / Cursor / Cline ใชใฉ) ใ‹ใ‚‰็›ดๆŽฅๅ‘ผใณๅ‡บใ›ใพใ™ใ€‚ ๐Ÿ‡ฐ๐Ÿ‡ท ํ•œ๊ตญ ๊ฐœ๋ฐœ์ž๋ถ„๋“ค๊ป˜: ์ค‘๊ตญ์˜ "ๅ…ซๅญ— (bฤzรฌ)" โ€” ํ•œ๊ตญ์—์„œ๋Š” ์‚ฌ์ฃผํŒ”์ž๋ผ๊ณ  ๋ถ€๋ฅด๋Š” ๋ช…๋ฆฌํ•™์˜ ๊ณ„์‚ฐ ์—”์ง„ + MCP ์„œ๋ฒ„์ž…๋‹ˆ๋‹ค. ์ƒ๋…„์›”์ผยท์ถœ์ƒ์‹œ๊ฐยท์ถœ์ƒ์ง€๋กœ๋ถ€ํ„ฐ ์‚ฌ์ฃผ / ์‹ญ์„ฑ / ๋Œ€์šด / ์˜คํ–‰ ๊ท ํ˜•์„ ๊ณ„์‚ฐํ•ฉ๋‹ˆ๋‹ค. ์ง„ํƒœ์–‘์‹œ ๋ณด์ •๋„ ์ง€์›ํ•˜๋ฉฐ, AI ์—์ด์ „ํŠธ (Claude / Cursor / Cline ๋“ฑ) ์—์„œ ๋ฐ”๋กœ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

---

This repository is a monorepo with two published npm packages:

| Package | What it is | Install | |---|---|---| | shunshi-bazi-core | Pure TypeScript calculation library. Zero framework deps. Use it from any Node.js / browser app. | npm install shunshi-bazi-core | | shunshi-bazi-mcp | Thin Model Context Protocol server wrapping the core library. Drop-in tool for Claude Desktop / Cursor / Cline / any MCP client. | npx -y shunshi-bazi-mcp |

Both packages share the same calculation engine that powers Shunshi.AI's production backend. Both are parity-tested on every release.

---

Why this exists

Most existing open-source Bazi libraries (in any language) have at least one of these problems:

  1. No true solar time correction. Clock time gets used as-is, which gives wrong charts for births far from the timezone's standard meridian (ๆ–ฐ็–† / ้ป‘้พ™ๆฑŸ / the U.S. West Coast / ๅŒ—ๆตท้“). A 30-minute error shifts the whole hour pillar.
  2. Inconsistent ๅญๆ—ถ handling. Some libraries put 23:00-23:59 in "yesterday's" day pillar, others in "tomorrow's". If you don't pick, your charts disagree with professional reference tools.
  3. No parity baseline. You compute a chart locally, compare against a paid service, get different numbers, and have no way to tell who's right.
  4. Raw data only, no multilingual context. Output is Chinese-centric, hard to wire into JP/KR/EN AI assistants.

shunshi-bazi-core + shunshi-bazi-mcp fix all four:

  • โœ… True solar time built-in, default on (just pass city or longitude/latitude).
  • โœ… Default sect=1 (23:00 = tomorrow's day pillar), matching ้—ฎ็œŸๅ…ซๅญ—.
  • โœ… Parity-tested against Shunshi.AI's Python backend (5/5 golden cases) and cantian-tymext's calculateRelation() (5/5 on ๅˆ‘ๅ†ฒๅˆไผš pair-wise subset).
  • โœ… Multilingual discoverability via keywords (bazi / ๅ…ซๅญ— / ๅ››ๆŸฑๆŽจๅ‘ฝ / ์‚ฌ์ฃผํŒ”์ž / saju / shichu-suimei) so JP/KR/EN developers can find the package.

---

Quick start

If you're embedding Bazi calc in your own app

npm install shunshi-bazi-core
import { getBaziChart } from 'shunshi-bazi-core';

const chart = getBaziChart({
  year: 1990, month: 3, day: 24, hour: 10, minute: 28,
  gender: 1,           // 0 = ๅฅณ, 1 = ็”ท
  city: 'ๅนฟๅทž',         // triggers true solar time correction
});

console.log(chart.ๅ…ซๅญ—.ๅ››ๆŸฑ);          // "ๅบšๅˆ ๅทฑๅฏ ๆˆŠๅญ ไธๅทณ"
console.log(chart.็œŸๅคช้˜ณๆ—ถ?.ไฟฎๆญฃๅˆ†้’Ÿ); // -33.85 (minutes of correction applied)

โ†’ Full API and output reference: packages/bazi-core/README.md

If you want Claude / Cursor / Cline to compute Bazi charts

Add this to your MCP config (e.g. claude_desktop_config.json):

{
  "mcpServers": {
    "shunshi-bazi": {
      "command": "npx",
      "args": ["-y", "shunshi-bazi-mcp"]
    }
  }
}

Then restart the client and ask your AI agent in natural language:

"ๅธฎๆˆ‘็ฎ—ไธ€ไธ‹ 1990 ๅนด 3 ๆœˆ 24 ๆ—ฅ ไธŠๅˆ 10 ็‚น 28 ๅˆ†ๅ‡บ็”Ÿๅœจๅนฟๅทž็š„็”ท็”Ÿ็š„ๅ…ซๅญ—ใ€‚"

The server exposes two tools:

  • getBaziChart โ€” full Bazi (Four Pillars) chart with true-solar-time correction, ๅคง่ฟ, ๅˆ‘ๅ†ฒๅˆไผš, ็ฅž็…ž.
  • getHuangli โ€” ้ป„ๅކ (่€้ป„ๅކ / Chinese almanac) for any day: ๅฎœ/ๅฟŒ, ๅฝญ็ฅ–็™พๅฟŒ, ็ฅž็…ž, ๅปบ้™ค, ไบŒๅๅ…ซๅฎฟ, ๅ‰็ฅžๆ–นไฝ, 12 ๆ—ถ่พฐๅฎœๅฟŒ. Accepts ๅ…ฌๅކ or ๅ†œๅކ input; omit the date for today.

"ไปŠๅคฉ็š„้ป„ๅކๅฎœๅฟŒๆ˜ฏไป€ไนˆ๏ผŸ"

โ†’ Full MCP tool docs, alternate client configs, troubleshooting: packages/bazi-mcp/README.md

---

Repository layout

bazi-reader-mcp/
โ”œโ”€โ”€ package.json                 # npm workspace root (private)
โ”œโ”€โ”€ tsconfig.base.json           # shared TypeScript config
โ”œโ”€โ”€ LICENSE                      # MIT
โ”œโ”€โ”€ README.md                    # you are here
โ””โ”€โ”€ packages/
    โ”œโ”€โ”€ bazi-core/               # โ†’ publishes as "shunshi-bazi-core"
    โ”‚   โ”œโ”€โ”€ src/
    โ”‚   โ”‚   โ”œโ”€โ”€ index.ts
    โ”‚   โ”‚   โ””โ”€โ”€ lib/{bazi,relations,shensha,solarTime,cityCache}.ts
    โ”‚   โ”œโ”€โ”€ tests/{parity,relations-vs-cantian,smoke}.ts
    โ”‚   โ”œโ”€โ”€ package.json
    โ”‚   โ””โ”€โ”€ README.md
    โ””โ”€โ”€ bazi-mcp/                # โ†’ publishes as "shunshi-bazi-mcp"
        โ”œโ”€โ”€ src/{mcp,stdio}.ts
        โ”œโ”€โ”€ tests/smoke-stdio.ts
        โ”œโ”€โ”€ package.json
        โ””โ”€โ”€ README.md

---

Development

# install deps for both packages
npm install

# build both packages
npm run build

# run bazi-core tests (parity + relations-vs-cantian)
npm test

# run the MCP server locally via tsx (no build required)
npm run dev:mcp

# stdio smoke test for the MCP (spawns the built dist/stdio.js)
cd packages/bazi-mcp && npm run smoke

Test coverage

  • packages/bazi-core/tests/parity.test.ts โ€” 5 golden cases hand-labeled from screenshots of ้—ฎ็œŸๅ…ซๅญ—, cross-checked against Shunshi.AI's Python backend on ๅ››ๆŸฑ / ๅ็ฅž / ็ฉบไบก / ็บณ้Ÿณ / ่—ๅนฒ.
  • packages/bazi-core/tests/relations-vs-cantian.test.ts โ€” 5/5 match vs cantian-tymext's calculateRelation() on ๅˆ‘ๅ†ฒๅˆไผš (pair-wise subset: ๅˆ / ๅ†ฒ / ๅˆ‘ / ๅฎณ / ็ ด / ๅ…‹).
  • packages/bazi-mcp/tests/smoke-stdio.ts โ€” End-to-end stdio handshake + tools/list + tools/call, asserts the real ๅ››ๆŸฑ output and the ๆ•ฐๆฎๆฅๆบ attribution block. Uses the real MCP SDK client so it exercises the exact same code path as Claude Desktop.

---

Related projects

  • tyme4ts by 6tail โ€” the TypeScript lunar/solar calendar primitives this library builds on.
  • cantian-ai/bazi-mcp โ€” pioneering open-source Bazi MCP. We use their cantian-tymext as a dev dependency for relations parity testing. The two MCPs are complementary, not competing โ€” we made different defaults (sect=1, true solar time on by default) based on what matches professional practice in the Chinese-speaking world.

---

About Shunshi.AI

๐ŸŒ Website: https://shunshi.ai ๐Ÿฆ X / Twitter: @shunshiai2026 ๐Ÿš€ Product Hunt: Shunshi.AI

Shunshi.AI (้กบๆ—ถ) is an AI-powered Bazi reading platform supporting English, ไธญๆ–‡, ๆ—ฅๆœฌ่ชž, and ํ•œ๊ตญ์–ด. Free to try, no credit card required.

We open-sourced the calculation engine behind our production backend so:

  • Any developer can compute Bazi charts with the same accuracy as our paid product.
  • The ็œŸๅคช้˜ณๆ—ถ / ๅญๆ—ถ edge cases get solved once and for all, instead of each project getting them wrong in a slightly different way.
  • JP/KR/EN developers finally have a TypeScript library that speaks their terminology (ๅ››ๆŸฑๆŽจๅ‘ฝ / ์‚ฌ์ฃผํŒ”์ž).

---

License

MIT ยฉ 2026 Shunshi.AI

See related servers & alternatives โ†’

Related MCP servers

Browse all โ†’

Related guides

Hand-picked reading to help you choose and use AI & ML servers.