laoshifu-mcp
This server is a Chinese metaphysics MCP server that runs real local engines for Bazi, Ziwei, Liuyao, and Qimen to produce trustworthy charts and readings.
bazi_ziwei_chart: Compute a combined BaZi + Zi Wei Dou Shu chart for long-term fate and life-stage analysis, returning four pillars, ten gods, Na Yin, luck cycles, palaces, transformations, and evidence references. Requires explicit solar/lunar calendar, supports leap month and time zone.liuyao_qimen_fusion: For a specific question, run Liuyao and Qimen together, compare their conclusions, mark agreement/complement/conflict, and give success tendency, timing, and conditions. Uses either the confirmed current time or three numbers supplied by the person.hexagram_diagram: Generate a standard PNG hexagram diagram (original/changed lines, six relatives, six spirits, Shi/Ying, hidden lines, moving lines) from the same hexagram structure, plus per-line text for hosts that cannot show images.resolve_pillars: When only the four pillars are known, reverse-look-up candidate Gregorian years; zero candidates means invalid input, multiple candidates must be user-confirmed before continuing.laoshifu_consultation: Formal entry point for a full master-style consultation; the server itself only performs the chart calculations, not the conversational delivery or interpretive persona.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@laoshifu-mcp 帮我排八字和紫微,女,1995年6月15日14点,公历。"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
老师傅 MCP Server
这是一个神奇的skill。不同于大模型的简单算法,双系统交叉验证大幅提高准确率,看命用八字+紫微斗数,看事用六爻+奇门遁甲。命运、婚恋、事业、问事成败与时机;支持公历、农历、四柱反查及时间或三数起卦。先问清资料,调用真实排盘,再把相关依据讲给你听。说话直,但不吓人;需要细讲再展开。
本仓库把这套 Skill 里真实跑排盘的那部分做成了 MCP 服务器:任何支持 MCP 的客户端都能直接调用八字紫微双盘、六爻奇门双法同参、标准卦图和四柱反查。盘由本地引擎算出来,不是让大模型"想一想"写一个。
工具
工具 | 用途 | 关键参数 |
| 八字+紫微双盘。四柱、十神、长生、纳音、刑冲合害、格局旺衰、十二宫主辅星与四化、大运、流年、可引用证据 |
|
| 六爻+奇门双法同参。两法各自结论、一致/互补/冲突标记、证据编号与强度、成败倾向、时间与条件 |
|
| 固定坐标的标准六爻卦图 PNG(本卦、变卦、六亲、六神、世应、伏神、动爻),同时返回逐爻文字备用 | 同 |
| 只给四柱时反查候选公历年份 |
|
| 老师傅完整会谈的正式入口 | 无 |
另外提供一个提示词 laoshifu_reading,把已经排出的盘讲成一段自然的话,而不是输出字段清单。
Related MCP server: 命盘 Mingpan
为什么盘是可信的
排盘、起卦、画图全部调用与 Skill 同源的权威引擎,MCP 层不做任何算术:
八字与紫微:
engine/calculator/dist/run-chart.js六爻与奇门:
scripts/liuyao.cjs、scripts/qimen.cjs、scripts/qimen_core/卦图:
scripts/diagram_render.py(结构直出 PNG,不用 AI 生图重绘)四柱反查:
scripts/resolve-pillars.cjs
因此工具输出与 Skill 输出不可能漂移。仓库自带回归用例,用固定输入比对四柱,防止引擎被换掉而没人发现。
安装
需要 Python 3.10+ 与 Node.js 18+(引擎里的历法与干支换算依赖 Node)。
# 直接从 GitHub 运行,不需要预先安装
uvx --from git+https://github.com/william22820785-cmyk/laoshifu-mcp laoshifu-mcp已用 uv tool install --from git+https://github.com/william22820785-cmyk/laoshifu-mcp laoshifu-mcp
装进本地的,直接运行 laoshifu-mcp 即可。
客户端配置
{
"mcpServers": {
"laoshifu": {
"command": "uvx",
"args": [
"--from",
"git+https://github.com/william22820785-cmyk/laoshifu-mcp",
"laoshifu-mcp"
]
}
}
}已把包装进某个环境的,把 args 换成 ["laoshifu-mcp"] 即可。
输入约定
看命用 bazi_ziwei_chart。公历与农历必须由调用者明确指定,不能默认按公历处理;农历闰月要显式标记。出生排盘当前只接纳东八区,其他时区需先人工核准出生地。晚子时(23 点)按次日处理。
问事用 liuyao_qimen_fusion。必须先把事问实再起卦:method=time 用确认当刻起卦,method=numbers 必须由本人凭第一念报三个正整数,不能代选、不能暗示。同一件事不要因为不喜欢结论而重复起卦。
只有四柱时先用 resolve_pillars 反查。四柱会重复:0 个候选说明输入有误,多个候选必须让用户确认,唯一候选才继续。
输出规模
默认 detail=summary,去掉 bazi/ziwei 里重复的出生信息与四柱块,以及已废弃的旧卦图字段。一次双盘的返回约 6—7 千字符,六爻奇门约 3—4 千字符。需要原始完整 JSON 时传 detail=full。
边界
结果描述的是盘面结构和算法结论,不等于现实预测,也不代表预测经过科学验证。两法同向不等于保证应验。
健康只谈压力与生活管理,不做疾病诊断,不推断寿命;财富不承诺收益;关系不宣判离婚或复合必然发生;法律与安全不替代专业决策。
排盘本地运行不代表对话全程离线。
本服务器只排盘。老师傅的会谈断法、口吻与校准问句是 Skill 的另一半,见
laoshifu_consultation。
开发与验证
python scripts/sync-runtime.py --force # 从 Skill 源仓库同步运行时
python scripts/sync-runtime.py --check # 确认运行时完整且不含会谈断法资料
python scripts/verify-bundle.py # 只靠打包运行时跑一遍四个引擎并比对已知结果
python -m unittest discover -s tests # 20 个用例:工具注册、输入校验、引擎回归
python scripts/smoke-stdio.py # 真实 MCP stdio 契约测试laoshifu_mcp/_runtime/ 由 sync-runtime.py 生成,不进版本库;发布包由构建流程注入。
许可
本项目自有部分以 MIT No Attribution 发布,见 LICENSE。第三方组件(八字紫微引擎、六爻算法、lunar-typescript、mingyu-core、tyme4ts、卦图字形)的许可与出处见 NOTICE。
Available Tools
5 toolsbazi_ziwei_chart八字+紫微双盘排盘A
用真实排盘引擎同时排出八字与紫微斗数两张盘,返回四柱、十神、长生、纳音、刑冲合害、格局旺衰、紫微十二宫主辅星与四化、大运、流年及可引用的证据条目。只在看一个人的长期命运或阶段运势时使用;问一件具体的事请改用 liuyao_qimen_fusion。公历与农历必须由调用者明确指定,不能默认按公历处理。
Inputs: day (required), hour (required), year (required), month (required), +7 more. Returns: result
hexagram_diagram标准六爻卦图A
用本次六爻结构直接画出固定坐标的 PNG 卦图(本卦、变卦、六亲、六神、世应、伏神、动爻),并同时返回逐爻文字备用。图片由结构生成,不得用 AI 生图重绘或手工拼爻线。参数与 liuyao_qimen_fusion 一致,会重新起同一卦;宿主不能显示图片时就只用逐爻文字。
Inputs: day (required), hour (required), year (required), month (required), +6 more.
laoshifu_consultation老师傅完整会谈入口A
用户想要的不是一张盘,而是有人把盘讲明白——断成败、看时间、点条件、用核对式问句定盘、按需要细讲时,返回老师傅完整会谈的正式入口。本服务器本身只排盘,不产出老师傅的口吻与会谈流程。
Inputs: no named parameters. Returns: result
liuyao_qimen_fusion六爻+奇门双法同参A
针对一件具体的事,用真实引擎同时起六爻与奇门遁甲两盘并做双法同参,返回两法各自结论、一致/互补/冲突标记、证据编号与强度、成败倾向、时间与条件、以及可直接画图的六爻结构。必须先把事项问实;method=time 用确认当刻起卦,method=numbers 必须由本人凭第一念报三个正整数。同一件事不要因为不喜欢结果而重复起卦。
Inputs: day (required), hour (required), year (required), month (required), +7 more. Returns: result
resolve_pillars四柱反查公历候选A
用户只给出生四柱、不给出生日期时,反查符合这四个干支的候选公历年份。四柱会重复,没有唯一候选就不能继续完整推演;0 个候选说明输入有误,多个候选必须让用户确认。
Inputs: pillars (required), end_year (required), start_year (required). Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 5 tools
Each tool has a clearly distinct role: resolve_pillars handles ambiguous birth pillars, bazi_ziwei_chart addresses long-term life charts, liuyao_qimen_fusion handles specific-event divination, hexagram_diagram renders diagrams, and laoshifu_consultation provides the consultation entry. Descriptions explicitly steer usage between long-term and event-specific cases, so there is no real overlap.
All names are lowercase snake_case and mostly follow a domain-plus-artifact pattern such as bazi_ziwei_chart, liuyao_qimen_fusion, hexagram_diagram, and laoshifu_consultation. resolve_pillars is the one verb-led exception, making the set mostly consistent with a minor deviation.
Five tools is well-scoped for this domain: input resolution, two complementary charting methods, a visualization helper, and a consultation handoff. Each tool earns its place and together they cover the main workflow without unnecessary bulk.
The tool set covers the full user journey from resolving ambiguous inputs, producing long-term and event-specific divination charts, drawing diagrams, and entering a consultation. There are no obvious missing lifecycle steps or dead ends for the server's stated purpose.
Maintenance
Related MCP Connectors
Hosted remote MCP server for BaZi (Four Pillars) charts and the Chinese almanac. No install.
Free Qimen Dunjia and BaZi charts via MCP - deterministic engine, nine palaces and four pillars.
BaZi, Zi Wei, Qi Zheng Si Yu, divination and almanac from a deterministic engine. Pay per call.
Deterministic BaZi and Chinese metaphysics tools for AI agents: charts, divination, almanac.
Related MCP Servers
- AlicenseAqualityDmaintenanceProvides five Chinese metaphysics engines (BaZi, QMDJ, ZWDS, Feng Shui, I Ching) as MCP tools for analysis and forecasting.6MIT
- AlicenseAqualityBmaintenanceProvides traditional Chinese astrology (Bazi, Ziwei) and divination (Liuyao, Meihua, Qimen, etc.) calculations as MCP tools for AI assistants.18299 npm133Apache 2.0
- AlicenseAqualityDmaintenanceProvides MCP tools for Chinese metaphysics, including BaZi (Four Pillars) charting, Liu Yao hexagram casting, lunar conversion, and AI-powered destiny analysis.1018 npmMIT
- AlicenseAqualityDmaintenanceEnables users to compute a full Chinese Bazi (Four Pillars of Destiny) chart from a birth date, time, and place, with True Solar Time correction and historical daylight saving adjustments, running fully offline via MCP.246 npmMIT