BaZi (Eight Characters) Calculator
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., "@BaZi (Eight Characters) Calculatorcalculate my BaZi chart for 1990-05-15 14:30 in Beijing"
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.
八字排盘工具
这是一个基于Python的八字辅助工具,可以计算八字、节气信息和大运信息。
功能特性
八字计算(年柱、月柱、日柱、时柱)
真太阳时校正
节气信息计算
大运信息计算
农历转换
农历出生时间显示为真太阳时校正后的时间
安装依赖
pip install -r requirements.txt直接运行
python mcp_server.py默认情况下,服务将在 http://localhost:8001/mcp 上运行。
启动MCP服务
使用Docker(推荐)
docker-compose up --build默认情况下,服务将在 http://localhost:8001/mcp 上运行。
如果从宿主机访问Docker容器中的服务,使用以下地址:
Windows/Linux/macOS:
http://host.docker.internal:8001/mcp
MCP客户端调用
MCP服务提供了一个名为 bazi 的工具,可以计算八字信息。该工具接受以下参数:
name(str): 姓名gender(str): 性别 ('男' 或 '女')calendar(str): 日历类型 ('公历' 或 '农历')year(int): 出生年份month(int): 出生月份day(int): 出生日期hour(int): 出生小时 (0-23)minute(int): 出生分钟 (0-59)birth_city(str): 出生城市current_city(str, 可选): 当前居住城市
项目结构
bazi/
├── mcp_server.py # MCP服务端
├── bazi_tool.py # 八字计算工具
├── query_longitude.py # 查询经度
├── region.json # 城市经纬度数据
├── README.md # 项目说明
示例输出
=== 张三的八字信息 ===
姓名:张三
性别:男 (乾造)
出生时间:
公历:[年份]年[月份]月[日期]日[小时]:[分钟]
农历:[年份]年[月份]月[日期]日[小时]:[分钟] (非闰月)
出生城市:[城市名]([经度]°E)
现居城市:[城市名]
八字信息:[年柱] [月柱] [日柱] [时柱]
节气信息:生于[节气1]节气后[天数]天,[节气2]节气前[天数]天
大运信息:[阴阳]男,[顺排/逆排],起运时间[年数]年[月数]月,[起运年龄]岁起运Related MCP Connectors
BaZi (Chinese Four Pillars) chart calculator. Structured chart data only, no predictions.
BaZi four pillars, Chinese zodiac, lunisolar calendar and almanac days for AI agents.
Western, Vedic, and Chinese astrology calculations, charts, forecasts, and geocoding.
Read-only Bazi, True Solar Time, and Chinese almanac tools in English and Traditional Chinese.