Click on "Install 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., "@LiuRen MCP Servercalculate a Liu Ren chart for my birthday: 1990-05-15 08:30:00"
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服务器
基于kentang2017/kinliuren项目实现的六壬排盘MCP服务器。
参考MCPQimenJson项目重构,采用简洁的架构和标准的MCP协议。
功能特点
✅ 标准的MCP (Model Context Protocol) 服务器
✅ 支持JSON-RPC 2.0协议通信
✅ 提供六壬排盘计算工具
✅ 提供当前时间获取工具
✅ 直接调用kinliuren库,输出原始结果
✅ 简洁的架构,无复杂封装层
Related MCP server: Bazi MCP
安装依赖
pip install -r requirements.txtMCP工具说明
1. get_current_time
获取当前系统时间,返回详细的时间信息。
输入参数: 无
输出: 当前时间的详细JSON信息
2. calculate_liuren
计算指定时间的六壬排盘,返回完整的六壬数据。
输入参数:
datetime_str: 时间字符串,格式YYYY-MM-DD HH:MM:SS
输出: 包含六壬排盘完整数据的JSON结果
作为MCP服务器使用
该工具设计为MCP服务器,通过标准输入输出进行JSON-RPC通信:
// 初始化请求
{"jsonrpc": "2.0", "id": 1, "method": "initialize", "params": {}}
// 工具列表请求
{"jsonrpc": "2.0", "id": 2, "method": "tools/list", "params": {}}
// 工具调用请求
{"jsonrpc": "2.0", "id": 3, "method": "tools/call", "params": {
"name": "calculate_liuren",
"arguments": {"datetime_str": "2024-01-15 14:30:00"}
}}输出格式
六壬排盘结果
工具返回完整的六壬排盘JSON数据:
{
"success": true,
"data": {
"year": 2024,
"month": 1,
"day": 15,
"hour": 14,
"minute": 30,
"solar_term": "小寒",
"lunar_month": "腊",
"day_ganzhi": "癸丑",
"hour_ganzhi": "庚申",
"liuren_data": {
"格局": ["比用", "知一"],
"日馬": "寅",
"三傳": {
"初傳": ["戌", "合", "財", "丙"],
"中傳": ["巳", "陰", "子", "癸"],
"末傳": ["子", "龍", "父", "戊"]
},
"四課": {
"四課": ["戌卯", "合"],
"三課": ["卯申", "常"],
"二課": ["辰酉", "玄"],
"一課": ["酉甲", "雀"]
},
"天地盤": {
"天盤": ["午", "未", "申", "酉", "戌", "亥", "子", "丑", "寅", "卯", "辰", "巳"],
"地盤": ["亥", "子", "丑", "寅", "卯", "辰", "巳", "午", "未", "申", "酉", "戌"],
"天將": ["后", "貴", "蛇", "雀", "合", "勾", "龍", "空", "虎", "常", "玄", "陰"]
}
// ... 更多六壬数据
}
}
}时间获取结果
{
"success": true,
"data": {
"year": 2024,
"month": 1,
"day": 15,
"hour": 14,
"minute": 30,
"second": 45,
"datetime_str": "2024-01-15 14:30:45",
"weekday": "Monday",
"weekday_cn": "星期一",
"timestamp": 1705323045
}
}项目结构
MCPliuren/
├── liuren_mcp.py # 主要的六壬MCP服务器
├── config.py # 配置文件和辅助函数
├── requirements.txt # 项目依赖
└── README.md # 说明文档依赖库
kinliuren: 六壬排盘计算库
sxtwl: 中国传统天文历法计算库
技术实现
MCP协议支持: 实现完整的JSON-RPC 2.0协议
简洁架构: 直接调用kinliuren库,无复杂封装
配置分离: 使用独立的config.py处理配置逻辑
错误处理: 完善的异常处理和错误响应
标准化输出: 返回结构化的JSON结果
MCP协议特性
initialize: 服务器初始化
tools/list: 获取可用工具列表
tools/call: 调用具体工具
错误处理: 标准JSON-RPC错误响应
注意事项
确保Python版本>=3.6
需要网络连接来安装依赖包
时间计算基于中国传统历法
作为MCP服务器使用时,通过标准输入输出进行通信
This server cannot be installed
Resources
Looking for Admin?
Admins can modify the Dockerfile, update the server description, and track usage metrics. If you are the server author, to access the admin panel.