命盘 Mingpan

命盘 Mingpan

Provides traditional Chinese astrology (Bazi, Ziwei) and divination (Liuyao, Meihua, Qimen, etc.) calculations as MCP tools for AI assistants.

Category
Visit Server

README

命盘 MCP Server

Version License

命盘(Mingpan) 是一个中华传统术数 MCP 服务,为 Claude 等 AI 应用提供命理排盘与占卜起卦的计算能力。

特性

  • MCP 原生:无缝集成 Claude Desktop 及 Claude Code
  • 🌏 中文输出:以简体为主,术语保持传统
  • 📊 结构化文本:便于 AI 理解与分析的格式

配置方法

Claude Desktop

找到配置文件并添加以下内容:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.config/Claude/claude_desktop_config.json
{
  "mcpServers": {
    "mingpan": {
      "command": "npx",
      "args": ["-y", "mingpan"]
    }
  }
}

Claude Code

claude mcp add mingpan -- npx -y mingpan

验证

配置完成后重启客户端,然后尝试:

请帮我排一个八字命盘,1992年4月12日7点30分,男性

请帮我起一个奇门遁甲时盘,2024年6月21日10点

工具列表

命理排盘

命理学基于出生时间推算人生运势,属于「命」的范畴。

八字命理

工具 说明
bazi_basic 八字命盘排盘(四柱、藏干、十神、五行力量)
bazi_dayun 大运列表(十年一运)
bazi_liunian 流年列表(指定年份范围)
bazi_liuyue 流月列表(节气月,立春起算)
bazi_liuri 流日列表(指定月份内每日)

紫微斗数

工具 说明
ziwei_basic 紫微命盘排盘(十二宫、主星、辅星、四化)
ziwei_daxian 大限列表(十年一限)
ziwei_xiaoxian 小限列表(每年一宫)
ziwei_liunian 流年列表(指定年份范围)
ziwei_liuyue 流月列表(农历月)
ziwei_liuri 流日列表(农历日)

占卜起卦

占卜术基于起卦时间或随机数推演卦象,属于「卜」的范畴。

六爻

工具 说明
liuyao_basic 六爻排盘(本卦/变卦、纳甲、六亲、六神、世应、旬空)

六爻输入为六个爻值(自下而上):

  • 6 = 老阴(动爻,阴变阳)
  • 7 = 少阳(静爻)
  • 8 = 少阴(静爻)
  • 9 = 老阳(动爻,阳变阴)

梅花易数

工具 说明
meihua_basic 梅花易数排盘(本卦/变卦/互卦、体用分析)

支持两种起卦方式:

  • 时间起卦:根据农历年月日时计算
  • 数字起卦:根据两个数字计算

大六壬

工具 说明
daliuren_basic 大六壬排盘(天地盘、四课、三传、十二天将、神煞)

大六壬为三式之首,需输入节气、农历月、日干支、时干支。

奇门遁甲

工具 说明
qimen_basic 奇门遁甲排盘(九宫布局、三奇六仪、八门九星八神、格局判断)
qimen_yongshen 奇门用神分析(按事类选取用神,含主客、旺衰、空亡、入墓等)
qimen_zeri 奇门择日(指定日期区间内筛选相对更佳的时机)

奇门遁甲为三式之一,盘式与规则主要参考张志春《神奇之门》,支持:时盘/日盘/月盘/年盘、转盘/飞盘、拆补法/茅山法。

更多说明见:docs/qimen-yongshen-guide.md

输入参数

命理工具(八字/紫微)

参数 类型 必填 说明
year number 出生年份(1900-2100)
month number 出生月份(1-12)
day number 出生日期(1-31)
hour number 出生时辰(0-23)
minute number 出生分钟(0-59),默认 0
gender string male / female
longitude number 出生地经度,用于真太阳时校正
isLunar boolean 是否为农历输入,默认 false

占卜工具(六爻/梅花/大六壬)

占卜工具使用起卦时间而非出生时间,具体参数请参考各工具说明。

奇门遁甲工具

参数 类型 必填 说明
year number 起盘年份(1900-2100)
month number 起盘月份(1-12)
day number 起盘日期(1-31)
hour number 起盘时辰(0-23)
minute number 分钟(0-59),默认 0
isLunar boolean 是否为农历输入,默认 false
panType string 时盘 / 日盘 / 月盘 / 年盘,默认 时盘
panStyle string 转盘 / 飞盘,默认 转盘
zhiRunMethod string chaibu(拆补法)/ maoshan(茅山法),默认 chaibu

月份基准说明

系统 月份基准 日期基准
八字 节气月(立春起算) 公历日
紫微 农历月(初一起算) 农历日

开发

git clone https://github.com/ChesterRa/mingpan.git
cd mingpan
npm install
npm run build
npm run dev  # 监听变化

依赖

用途
@modelcontextprotocol/sdk MCP 协议实现
lunar-javascript 农历/公历转换
iztro 紫微斗数计算引擎
zod 输入参数校验

路线图

  • [x] 八字基础排盘与时运列表
  • [x] 紫微基础排盘与时运列表
  • [x] 六爻排盘
  • [x] 梅花易数排盘
  • [x] 大六壬排盘
  • [x] 奇门遁甲排盘

许可证

Apache License 2.0

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured