Skip to main content
Glama

Xuanqing MCP (xuanqing-mcp)

Verifiable BaZi & Ziwei Dou Shu MCP Server, Agent Skill, Classical Provenance Auditor & Ink Poster Generator

Zero Charting Hallucination × Zero Fabricated Citations

English · 简体中文 · 繁體中文

CI npm version Code License: MIT Data License: CC BY-SA 4.0 Node >= 22

Live Interactive Playground ↗ · npm Package ↗ · Try Full Web App (DaoKeDao 道可道) ↗ · Auditable Corpus & Benchmark ↗ · Book Distillation Framework ↗


Most AI astrology MCP servers and skills solve charting hallucination (stopping LLMs from miscalculating pillars or stars), yet still let models fabricate classical book quotes, confuse branch interactions (e.g. calling Zi-Mao a "Harm" when it is a "Punishment"), and flatten disagreeing schools into one dogmatic verdict.

xuanqing-mcp adds the missing second line of defense:

  1. Deterministic Dual-Engine Charting + True Solar Time Cross-Shichen Guard (@openfate/bazi-engine + @openfate/true-solar-time + iztro), issuing stable fact_id registries and SHA-256 hashes.

  2. Classical Claim Verifier backed by 278 CC BY-SA 4.0 Chinese Wikisource short excerpts across 8 classical volumes (Yuanhai Ziping, Sanming Tonghui, Ditian Sui Chanwei, Ziwei Doushu Quanshu) + 13 audited deterministic reference tables.

  3. 4-Tier Anti-Hallucination Reading Auditor (fact / source / interpretation / uncertain) that rejects fabricated entry_ids and downgrades unverified or example-generalized claims.

  4. New-Chinese Ink-Gold HTML/SVG Poster Generator (render_chart_poster) with an inline SVG Four-Pillar Branch Relation Field and traditional 12-Palace Ziwei grid.


30-Second Quickstart

1. MCP Server (Claude Desktop / Cursor / Windsurf / Cline)

Add to your MCP config (claude_desktop_config.json, .cursor/mcp.json, etc.):

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

2. Agent Skill (Claude Code / OpenClaw / TypingMind / Codex)

npx skills add https://github.com/bobobo2026/xuanqing-mcp --skill xuanqing-fate

Or copy skills/xuanqing-fate/SKILL.md into your agent's skills/ directory.

3. CLI (Zero-Setup Terminal Check)

# Intercept a false branch-relation claim (Zi-Mao is Punishment, not Harm!)
npx -y xuanqing-mcp verify "子卯害"

# Inspect cross-classic disagreement (Sanming Tonghui vs Ditian Sui on Storage Clash)
npx -y xuanqing-mcp verify "墓库开库"

# Cast BaZi with True Solar Time cross-shichen detection (Urumqi 87.62°E)
npx -y xuanqing-mcp bazi --date 1990-05-15 --time 14:30 --gender male --city 乌鲁木齐

# Render a self-contained New-Chinese Ink-Gold Dual Chart Poster
npx -y xuanqing-mcp poster --date 1995-08-22 --time 09:15 --gender female --city 北京 --mode dual --out poster.html

Related MCP server: 命盘 MCP Server

Why Xuanqing? (Landscape Comparison)

Capability

Raw LLM

Typical BaZi/Ziwei MCP or Skill

xuanqing-mcp

BaZi + Ziwei Dual Deterministic Engines

Mental math (frequent errors)

Single or dual engine

Dual (@openfate/bazi-engine + iztro) + facts_sha256

True Solar Time Cross-Shichen Alert

None

Silent override or ignored

Explicit cross-shichen / cross-day boundary warning

Branch-Relation Trap Interception (子卯害)

Often agrees with user

Not checked

Intercepted deterministically against truth tables

Classical Provenance (Wikisource URL + SHA-256)

Fabricates quotes

Uncited summary prompts

278 CC BY-SA 4.0 excerpts (8 volumes) with permalinks

Cross-Classic Disagreement Preservation

Flattens into one voice

Single-school prompt

Side-by-side conflicts (e.g. Sanming vs Ditian Sui)

Automated 4-Tier Reading Audit Validator

None

None

fact / source / interpretation / uncertain gate

Offline Ink-Gold Relation Field + 12-Palace Poster

Text only

Basic HTML

Zero-CDN SVG Relation Arcs + 12-Palace Grid (--no-branding)

Copyright & Privacy Boundary

N/A

Often scrapes copyrighted courses

Strict Fail-Closed Allowlist (MIT code + CC BY-SA 4.0 data)


MCP Tools, Resources & Prompts

Tool

Purpose

cast_bazi_chart

Deterministic Four Pillars, True Solar Time check, hidden stems, Ten Gods, NaYin, 12 Growth Stages, branch interactions (presence-only), core ShenSha, DaYun, fact_registry, facts_sha256

cast_ziwei_chart

Deterministic 12-Palace Ziwei astrolabe (iztro@2.6.0), True Solar Time cross-shichen boundary check, natal SiHua (四化), decadal cycles, fact_registry, facts_sha256

cross_verify_charts

Casts both BaZi & Ziwei, checks cross-engine True Solar Time consistency, aligns DaYun vs DaXian on a shared age/year timeline without conflating traditions

verify_classical_claim

Fact-checks claims against 13 deterministic tables, reviewed cross-classic conflicts, and 278 CC BY-SA 4.0 excerpts; explicitly returns unverified_in_public_corpus when unsupported

audit_reading_response

Audits AI reading drafts against valid_fact_ids & valid_entry_ids, blocks fabricated citations, downgrades background_only / example-only / high-risk absolute claims

render_chart_poster

Generates a self-contained New-Chinese Ink-Gold HTML/SVG chart & branch relation field poster (`mode: dual

Also exposes MCP Resources (xuanqing://corpus/overview, xuanqing://reference-tables/index) and Prompt (verifiable_dual_reading).


Xuanqing Open-Source Ecosystem

  • xuanqing-mcp (this repo) — Verifiable BaZi & Ziwei MCP Server, Agent Skill & Ink Poster Generator.

  • xuanqing-tianji-knowledge — Dual-System CC BY-SA 4.0 Auditable Classical Corpus + Fate-Hallucination-Bench v1.0 (60-question anti-hallucination benchmark for LLMs).

  • evidence-distill — Domain-agnostic Audit-Grade Book & Long-Corpus Distillation Framework for AI Agents (Prompt-Injection Firewall, Multi-School Isolation, Zero-Weight Dedup, Release Gates & Incremental Concept Dossiers).

  • DaoKeDao (道可道) Web App — Looking for a zero-setup mobile/web experience with 159 verifiable reference pages, persistent multi-chart archives, and deep topic QA? Try DaoKeDao online.


Licenses & Research Boundary

  • Code: MIT License.

  • Bundled Classical Excerpts (data/*.jsonl): CC BY-SA 4.0 derived from Chinese Wikisource (<= 180 Unicode code points per excerpt, full_text_included: false). Zero proprietary course transcripts, personal birth archives, or unverified web articles are included.

  • Boundary: Provided strictly for traditional cultural research, deterministic calendar computation, and AI hallucination auditing. Not medical, legal, financial, or scientific prediction advice.

Available Tools

6 tools
audit_reading_responseA

Audit an AI-generated BaZi/Ziwei reading draft against deterministic fact IDs and verified corpus entry IDs. Enforces 4-tier separation (fact / source / interpretation / uncertain), blocks fabricated citations, downgrades background_only or example-only generalizations, and flags high-risk absolute medical/financial/marriage claims.

Inputs: sections (required), valid_fact_ids, valid_entry_ids.

cast_bazi_chartB

Cast a deterministic BaZi (Four Pillars of Destiny / 八字排盘) chart with True Solar Time correction, cross-shichen boundary detection, core ShenSha lookups, branch interactions (presence-only), DaYun cycles, and a stable fact_registry + SHA-256 hash.

Inputs: date (required), gender (required), city, time, +6 more.

cast_ziwei_chartB

Cast a deterministic Ziwei Dou Shu (紫微斗数) 12-palace astrolabe via iztro with explicit True Solar Time cross-shichen boundary validation, natal transformations (四化), decadal cycles (大限), and stable fact_registry.

Inputs: date (required), gender (required), city, time, +6 more.

cross_verify_chartsA

Cast BOTH BaZi and Ziwei Dou Shu charts for the same birth profile, verify True Solar Time consistency across engines, align BaZi DaYun and Ziwei DaXian timelines without conflating traditions, and suggest classical verification queries.

Inputs: date (required), gender (required), city, time, +5 more.

render_chart_posterC

Generate a self-contained New-Chinese Ink-Gold HTML + SVG chart poster featuring Four Pillars, SVG Branch Relation Field arcs, Five-Element distribution, DaYun strip, and optional 12-Palace Ziwei astrolabe.

Inputs: date (required), gender (required), city, mode, +4 more.

verify_classical_claimA

Verify a BaZi or Ziwei claim/concept against 278 CC BY-SA 4.0 Wikisource excerpts (8 classical volumes: 渊海子平/三命通会/滴天髓阐微/紫微斗数全书) and 13 deterministic reference tables. Catches factual traps (e.g. 子卯害 -> actual 相刑), surfaces cross-classic conflicts side by side (e.g. 墓库开库), and refuses to fabricate citations.

Inputs: query (required), limit, domain.

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    A3.7/5.0

    Scored across 6 tools

    Disambiguation4/5

    Each tool has a distinct role: two casting tools split cleanly by tradition (BaZi vs Ziwei), plus rendering, cross-verification, corpus verification, and draft auditing. The only soft overlap is between cast_bazi_chart/cast_ziwei_chart and cross_verify_charts, which re-casts both charts internally, but the descriptions make the 'single tradition' vs 'aligned dual-engine' distinction reasonably clear.

    Naming Consistency5/5

    All names are snake_case and verb-first (render_, cast_, cross_verify_, verify_, audit_), with the noun consistently naming the object acted upon. No casing or style drift across the six tools.

    Tool Count5/5

    Six tools is well-scoped for a domain that naturally decomposes into cast-BaZi, cast-Ziwei, render, cross-verify, verify-source, and audit-output. No tool looks redundant or like filler, and none of the responsibilities are crammed into a mega-tool.

    Completeness4/5

    The surface covers the full workflow from casting through rendering, cross-tradition verification, classical citation checking, and output auditing, with stable fact_registry hashes for traceability. Minor gaps: no tool to retrieve or re-list a previously cast chart by its registry/hash, and no direct search over the 278-excerpt corpus or the 13 reference tables outside of claim verification.

    Maintenance

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      B
      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.
      16
      355 npm
      166
      MIT
    • A
      license
      A
      quality
      B
      maintenance
      Enables AI applications to generate deterministic Chinese metaphysics charts and divination hexagrams—including Bazi, Ziwei, Liuyao, Meihua, Daliuren, and Qimen—plus solar-term and lunar/Gregorian calendar queries, with multi-timezone support.
      18
      Apache 2.0
    • A
      license
      A
      quality
      B
      maintenance
      Deterministic BaZi (Four Pillars of Destiny / 四柱推命 / 八字) astronomical 24 solar-term perpetual calendar MCP server with universal-UTC solar-term transitions, True Solar Time, IANA historical DST rollback, and an open 100-case LLM accuracy benchmark.
      3
      341 npm
      MIT
    • A
      license
      C
      quality
      B
      maintenance
      Enables local AI assistants to generate deterministic Chinese metaphysics charts across 16 tools, retrieve classical texts and personal long-term memory, and archive or calibrate readings through 22 MCP tools.
      22
      MIT