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 Code License: MIT Data License: CC BY-SA 4.0 Node >= 22

Live Interactive Playground ↗ · 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", "github:bobobo2026/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 github:bobobo2026/xuanqing-mcp verify "子卯害"

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

# Cast BaZi with True Solar Time cross-shichen detection (Urumqi 87.62°E)
npx -y github:bobobo2026/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 github:bobobo2026/xuanqing-mcp poster --date 1995-08-22 --time 09:15 --gender female --city 北京 --mode dual --out poster.html

Related MCP server: OpenFate Bazi MCP

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 persistent multi-chart archives, interactive concept atlas, 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.

Tool Schema Changelog

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

Loading tool schema changelog…

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables traditional Chinese fortune-telling through BaZi (Four Pillars) analysis, including solar/lunar date conversion, Five Element balance calculations, Ten Gods deduction, and destiny interpretation for metaphysics applications.
      MIT
    • 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.
      8
      655 npm
      163
      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