@oiyonet/saju
v1.0.0
Published
Zero-dependency pure mathematical Korean Saju (Four Pillars / BaZi) and Five Elements astronomical calculation engine & MCP server.
Maintainers
Readme
🔮 @oiyo/saju & saju-mcp
Zero-dependency Pure Mathematical Korean Saju (Four Pillars / BaZi) & Five Elements Calculation Engine & MCP Server.
100% Deterministic (Zero LLM Hallucination), Astronomical Julian Day algorithms, Runs in <1ms.
💡 Why This Matters (LLM Hallucination in Metaphysics)
When asked to calculate Four Pillars (Saju / BaZi), LLMs (Claude, GPT-4, Cursor) frequently hallucinate incorrect Chinese sexagenary cycles (60 Ganzhi) and Solar Terms (24절기) because astronomical solar year cutoffs (Lichun / 입춘) and Julian day cycles cannot be reliably inferred through next-token prediction.
@oiyo/saju solves this definitively:
- Pure Astronomical Formulas: Julian Day Number & Solar Longitude algorithms.
- Zero External API Calls: Runs locally, completely offline, privacy-safe (birthdates never leave the machine).
- Comprehensive Analysis: Four Pillars (8 characters), Day Master (일간), Five Elements (오행 balance & percentages), and Ten Gods (십신).
🤖 1. AI Agent Integration (Claude Desktop & Cursor MCP)
Equip Claude Desktop, Cursor, or Zed with zero-hallucination Saju calculation tools via Model Context Protocol:
Claude Desktop Configuration (claude_desktop_config.json)
{
"mcpServers": {
"saju": {
"command": "npx",
"args": ["-y", "@oiyo/saju", "mcp"]
}
}
}Now, ask Claude: "Calculate the Saju and Five Elements balance for someone born on July 12, 1993 at 15:00".
Claude will call calculate_saju and give you verified, astronomically precise Four Pillars.
💻 2. CLI Usage
Instant command-line calculation via npx:
# Syntax: npx @oiyo/saju <Year> <Month> <Day> [Hour] [Minute]
npx @oiyo/saju 1993 7 12 15Output:
============================================================
📜 사주 명식(四柱 命式) 계산 결과 (1993년 7월 12일 15시)
============================================================
[사주 팔자 (四柱 八字)]
- 시주(時柱): 壬申 (Water/Metal) [편인(偏印)]
- 일주(日柱): 甲午 (Wood/Fire) [일원(日元)] ⭐ 일간(Day Master)
- 월주(月柱): 戊申 (Earth/Metal) [편재(偏財)]
- 연주(年柱): 癸酉 (Water/Metal) [정인(正印)]
------------------------------------------------------------
[나의 본원: 일간(日干)]
- 일간: 甲 (Jia) - 목(木) [Yang]
------------------------------------------------------------
[오행(五行) 분포 비율]
- 목(木): 1개 (13%)
- 화(火): 1개 (13%)
- 토(土): 1개 (13%)
- 금(金): 3개 (38%)
- 수(水): 2개 (25%)
============================================================📦 3. TypeScript / JavaScript SDK
import { calculateSaju } from '@oiyo/saju';
const saju = calculateSaju({
year: 1993,
month: 7,
day: 12,
hour: 15,
});
console.log('Day Master:', saju.day_master.stem, saju.day_master.element_ko);
console.log('Year Pillar:', saju.pillars.year.ganzhi);
console.log('Five Elements Balance:', saju.element_distribution);📜 License
MIT License © OIYO Lab
