XiaoLiuRen MCP Server
Provides traditional Chinese XiaoLiuRen divination analysis with accurate lunar calendar conversion and time calculation. Enables users to perform fortune telling based on date and time inputs using the ancient six-spirit divination system.
README
小六壬 MCP (XiaoLiuRen Model Context Protocol)
一个基于 Model Context Protocol (MCP) 的小六壬占卜分析服务器,提供传统的六神占卜功能。
小六壬出自《增补许真君万全玉匣记》,名为“李淳风六壬时课”,是一种古代靠“掐指”来占卜的方法,源于六曜历注和六轮兀法(《居家必用事类全集·六轮经兀法》)。
占时将“大安、留连、速喜、赤口、小吉、空亡”分置食指、中指、无名指上,以“月、日、时”轮指数出,得大安、速喜、小吉为吉,其余为凶。明清时期的白话小说有其踪迹,如《醒世姻缘传》:“街上一个打路庄板的瞎子走过。相大舅叫他进来,与狄希陈起课,说是速喜,时下就到”,《隋唐演义》:“叔宝便说个申时。妇人捻指一算,便道:卦名速喜”。
其“大安、留连、速喜、赤口、小吉、空亡”和六壬式十二天将的六神“青龙、玄武、朱雀、白虎、六合、勾陈”对应,可能是称为六壬时课或小六壬的原因。
—— 维基百科
功能介绍
- 🗓️ 精准农历转换:支持阳历转农历,提供准确的干支纪年信息
- 🕐 时辰计算:自动识别传统十二时辰
- 🔮 小六壬占卜:基于传统算法的六神推算
- � 智能解读:提供详细的占卜解释和行动建议
使用方法
安装依赖
npm install
启动服务
node index.js
工具调用
服务器提供 analyze_xiaoliuren 工具:
参数:
date: 日期(格式:YYYY-MM-DD)time: 时间(格式:HH:MM)calendar_type: 历法类型("solar" = 阳历,"lunar" = 农历)
调用示例:
{
"name": "analyze_xiaoliuren",
"arguments": {
"date": "2025-09-25",
"time": "14:30",
"calendar_type": "solar"
}
}
输出示例
小六壬占卜结果:
🗓️ 输入信息:
- 原始日期:2025-09-25(阳历)
- 时辰:14:30 (未时)
📅 农历信息:
- 农历日期:2025年八月初四
- 年干支:乙巳
- 月干支:乙酉
- 日干支:丁酉
- 时辰:未时
🧮 小六壬推算过程:
- 农历8月 → 留连
- 从留连数4日 → 小吉
- 从小吉数8(时辰序号) → 空亡
🔮 占卜结果:【空亡】
- 五行属性:土
- 吉凶性质:凶
- 基本含义:空、亡,事情落空不成,但也有无事之意。性质特殊,倾向虚无。
- 详细解释:空亡有两种可能:一是大凶结果很差,二是什么都不会发生。问失物为未丢,问寻找为找不到。常代表弃考、放弃等情况。
💡 建议指导:
🌫️ 情况比较特殊,可能有两种截然不同的结果。
• 可能性一:事情完全落空,什么都不会发生
• 可能性二:结果很差,遭遇较大失败
• 特殊含义:在某些情况下反而表示"没有问题"
• 心理状态:可能已经有放弃的念头
• 总体建议:重新审视目标,或许应该转换思路和方向
六神体系
小六壬包含六个神煞,各有特定含义和象意:
| 六神 | 五行 | 性质 | 基本含义 | 详细象意 |
|---|---|---|---|---|
| 大安 | 木 | 吉 | 安稳安逸美事,但也有静止之意 | 事情平稳发展,宜守不宜动。感情平稳但可能平淡,财运稳定。适合问成功类问题。 |
| 留连 | 土 | 凶 | 反复、犹豫、拖延、纠缠、暧昧 | 纯阴卦,主不光明、秘密。事情未定仍有变化,夜晚测得尤为不稳定。 |
| 速喜 | 火 | 吉 | 火热、快速、好事,不长久 | 短期事情大吉,长期后劲不足。为朱雀,有口舌争辩之象。需快速行动。 |
| 赤口 | 金 | 凶 | 口舌官非、凶险意外 | 为白虎,代表挫败。落此宫必定失败,也主精神紧张。有交谈合作等正面象意。 |
| 小吉 | 水 | 平 | 驿马宫,向好发展但需努力 | 纯阳卦,变化可能性最大。成功取决于个人努力,积极则吉,消极则平。 |
| 空亡 | 土 | 凶 | 空亡,落空不成,虚无 | 两种可能:大凶或无事发生。问失物为未丢,问寻找为找不到。常代表放弃。 |
算法说明
小六壬推算采用传统三步法:
- 月将推算:根据农历月份确定起始位置
- 日期推算:从月将位置按农历日期继续数算
- 时辰推算:从日期位置按时辰序号最终定位
开发指南
技术栈
- Node.js - 运行时环境
- @modelcontextprotocol/sdk - MCP 框架
- js-calendar-converter - 农历转换库
VS Code 开发
项目已配置好 VS Code 开发环境:
快速启动
- 按 F5 启动调试模式
- 或选择
启动小六壬MCP服务器配置启动
可用的启动配置
启动小六壬MCP服务器- 普通启动模式调试小六壬MCP服务器- 调试模式(可设置断点)
可用的任务
Ctrl+Shift+P→Tasks: Run Task选择:启动MCP服务器- 普通启动watch模式启动MCP服务器- 文件变化自动重启(后台运行)测试MCP服务器- 快速连接测试
开发脚本
npm run dev # watch模式启动
npm run debug # 调试模式启动
npm run vscode-test # VS Code集成测试
项目结构
├── .vscode/ # VS Code配置文件
│ ├── launch.json # F5启动配置
│ ├── tasks.json # 任务配置
│ └── settings.json # 工作区设置
├── index.js # 主服务器文件
├── mcp-config.json # MCP客户端配置示例
├── vscode-test.js # VS Code测试脚本
├── package.json # 项目配置
└── README.md # 说明文档
MCP 客户端集成
使用 mcp-config.json 配置文件可以将此服务器集成到支持MCP的客户端(如Claude Desktop)中:
{
"mcpServers": {
"小六壬": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"xiaoliuren-mcp"
]
}
}
}
核心模块
calculateXiaoLiuRen()- 小六壬核心算法getShichen()- 时辰计算getAdvice()- 建议生成
扩展开发
如需扩展功能,可以:
- 修改六神定义和解释内容
- 添加更多占卜方法
- 增强输出格式
- 集成其他传统算法
许可证
MIT License
Recommended Servers
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.
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.
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.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
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.
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.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
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.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.