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., "@Lunar Calendar MCP Servercalculate my BaZi for birth date 1990-01-01 at 08:30"
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.
Lunar Calendar MCP Server
中文 | English
A Model Context Protocol (MCP) server for Chinese traditional calendar functions, built with Python 3.12 and lunar-python.
🚀 Quick Start (Recommended)
One-Command Launch with UVX
That's it! No installation, no virtual environment setup, no dependencies to manage. UVX will automatically download and run the server.
Configure in Your MCP Client
Cursor IDE
Claude Desktop
Cherry Studio
📦 PyPI Package: https://pypi.org/project/bach-lunar-mcp/
📖 Quick Start Guide: QUICKSTART_UVX.md
Features
🎋 BaZi Calculation - Calculate eight characters for fortune telling
📅 Calendar Conversion - Convert between solar and lunar calendars
🌙 Huangli Query - Chinese almanac with daily recommendations
🔮 Daily Fortune - Daily fortune and recommendations
⭐ Solar Terms - Query 24 solar terms for any year
🧮 Wu Xing Analysis - Five elements analysis from birth info
Installation
Prerequisites
Python 3.12+
uv package manager
Setup
Clone the repository:
Install uv (if not already installed):
Install project with dependencies:
This will automatically:
Create a virtual environment with Python 3.12
Install all dependencies from pyproject.toml
Generate uv.lock for reproducible builds
Usage
As MCP Server
Configure in your MCP client (e.g., Claude Desktop):
Direct Usage
You can also use the helper functions directly:
Available Tools
1. bazi_calculate
Calculate BaZi (Eight Characters) for fortune telling.
Parameters:
birth_date: Birth date in YYYY-MM-DD formatbirth_time: Birth time in HH:MM format
Example:
2. calendar_convert
Convert between solar and lunar calendars.
Parameters:
date: Date in YYYY-MM-DD formatconvert_to: "lunar" or "solar"is_leap: Is leap month (optional)
Example:
3. huangli_query
Query Chinese almanac information for a specific date.
Parameters:
date: Date in YYYY-MM-DD format
Example:
4. fortune_daily
Get daily fortune and recommendations.
Parameters:
date: Date in YYYY-MM-DD format
Example:
5. jieqi_query
Query 24 solar terms for a specific year.
Parameters:
year: Year to query
Example:
6. wuxing_analyze
Analyze Wu Xing (Five Elements) from birth information.
Parameters:
birth_date: Birth date in YYYY-MM-DD formatbirth_time: Birth time in HH:MM format
Example:
Development
Running Tests
Code Formatting
Dependencies
mcp: Model Context Protocol implementation
lunar-python: Chinese lunar calendar library
pydantic: Data validation and settings management
Contributing
Fork the repository
Create your feature branch
Commit your changes
Push to the branch
Create a Pull Request
License
This project is licensed under the MIT License - see the LICENSE file for details.
Acknowledgments
lunar-python - Excellent Chinese lunar calendar library
MCP - Model Context Protocol specification
Note: This is a traditional calendar tool for educational and entertainment purposes. Please use responsibly.