Lunar Calendar MCP Server
This server provides comprehensive traditional Chinese lunar calendar functionality for AI applications, offering 20 tools across 6 categories.
🎯 Auspicious Date Analysis
Check if a date is auspicious for specific activities (weddings, business openings, travel, etc.) with a 0–10 score and detailed recommendations
Find the best dates in a date range for a given activity, ranked by auspiciousness
Get daily fortune based on the traditional Chinese almanac (通胜/黄历), including lucky directions, colors, and activity guidance
Check zodiac compatibility between two dates based on Chinese zodiac animals and five elements
🎊 Festival Information
Look up festivals occurring on a specific date (Spring Festival, Mid-Autumn, Dragon Boat, etc.)
Find the next upcoming festival from any reference date
Get in-depth details about a specific festival (history, customs, foods, significance)
Generate a full-year festival calendar with all traditional celebrations
🌙 Moon Phase Analysis
Get moon phase details for any date (phase name, illumination %, rise/set times), with location-aware calculations
View a monthly moon calendar showing daily phases and key lunar events
Analyze how the moon phase influences specific activities based on traditional lunar wisdom
Predict upcoming moon phase transitions (new moons, full moons, quarters) over a date range
📅 Calendar Conversions
Convert solar (Gregorian) dates to lunar calendar dates, including zodiac animal and heavenly stem/earthly branch info
Convert lunar dates back to solar dates, handling leap months correctly
Get Chinese zodiac information for any date (animal, element, traits, lucky numbers/colors)
🔮 BaZi (八字) Four Pillars of Destiny
Calculate a full BaZi chart from a birth date and time, including the eight characters, day master element, five elements balance, personality insights, and career suggestions
Analyze BaZi compatibility between two people for relationships or partnerships, with a compatibility score and element relationship analysis
⚡ Advanced / Utility Tools
Batch check multiple dates (up to 30) for auspiciousness in a single request, identifying the best and worst options
Compare multiple dates (up to 10) side-by-side across auspiciousness, moon phase, festivals, and zodiac dimensions
Get lucky hours for a specific day based on traditional Chinese 12 two-hour time periods, with activity-specific recommendations
All tools are accessible via MCP protocol, with Python API and CLI support, and can be easily integrated into AI applications like Claude Desktop.
Integrated with Codecov for tracking test coverage of the lunar calendar MCP server codebase.
Source code hosted on GitHub with CI/CD workflows for testing and code coverage tracking.
Distributed as a Python package on PyPI, allowing installation and usage of the lunar calendar MCP server via pip.
Uses Pytest for running unit tests and test coverage of the lunar calendar functionality.
Python-based MCP server providing lunar calendar calculations, auspicious date checking, BaZi analysis, and Chinese cultural tradition tools through a Python API.
Uses Ruff for code quality checking and linting during development.
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 Serveris tomorrow a good day to sign a contract?"
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
Traditional Chinese Lunar Calendar for AI Applications
20 Tools | BaZi (八字) | Chinese Zodiac | Five Elements | Moon Phases | Festivals | Auspicious Dates
Standard CPython 3.11, 3.12, 3.13, and 3.14 are supported and tested. Python 3.14 free-threaded builds are not part of the v1.2.1 support guarantee.
📖 Overview
A comprehensive Model Context Protocol (MCP) server providing traditional Chinese lunar calendar information, auspicious date checking, and festival data based on Chinese cultural traditions.
Perfect for integrating ancient Chinese wisdom into modern AI applications through the Model Context Protocol.
Related MCP server: Bazi MCP
✨ Features
🎯 Auspicious Date Analysis - Check favorable dates, find good dates, daily fortune, zodiac compatibility
🎊 Festival Information - Chinese festivals, next festival, festival details, annual calendars
🌙 Moon Phase Analysis - Accurate moon phases, location-aware, activity influence, monthly calendars
📅 Calendar Conversions - Solar-lunar conversion, zodiac information, cultural integration
🔮 BaZi (八字) Four Pillars - Birth chart analysis, destiny calculation, compatibility reading
⚡ Advanced Tools - Batch checking, date comparison, lucky hours
🚀 Quick Start in 30 Seconds
One-Line Installation
The fastest way to get started - no Python installation required:
# Install and run with uvx (recommended)
uvx lunar-mcp-serverTry It Out
Once running, you can immediately ask questions like:
"Is today a good day for a wedding?"
"When is the next Chinese festival?"
"What's my Chinese zodiac sign if I was born in 1990?"
"Find me 3 auspicious dates for moving house in March 2024"
"Calculate my BaZi (八字) for 1990-05-15 14:30"
"Check our BaZi compatibility for marriage"
Claude Desktop Integration
Add to your Claude Desktop configuration (claude_desktop_config.json):
{
"mcpServers": {
"lunar-calendar": {
"command": "uvx",
"args": ["lunar-mcp-server"]
}
}
}Then restart Claude Desktop and start asking about lunar calendar information!
MCP compatibility
MCP Python SDK:
>=1.28.1,<2(the lockfile records the exact tested v1 release)Primary protocol:
2025-11-25Backward-compatible initialization:
2024-11-05Production transport: STDIO
MCP SDK v2, the prerelease 2026 protocol, and remote production transports are not part of the v1.2.1 compatibility contract.
Alternative Installation Methods
# Using pip
pip install lunar-mcp-server
lunar-mcp-server
# Using uv
uv tool install lunar-mcp-server
lunar-mcp-server
# From source (for development)
git clone https://github.com/AngusHsu/lunar-mcp-server.git
cd lunar-mcp-server
uv sync
uv run lunar-mcp-server🛠️ Available Tools
🎯 Auspicious Date Tools (4)
check_auspicious_date- Check if date is favorablefind_good_dates- Find optimal datesget_daily_fortune- Daily fortune infocheck_zodiac_compatibility- Zodiac compatibility
🎊 Festival Tools (4)
get_lunar_festivals- Festivals on dateget_next_festival- Next upcoming festivalget_festival_details- Festival informationget_annual_festivals- Annual calendar
🌙 Moon Phase Tools (4)
get_moon_phase- Moon phase infoget_moon_calendar- Monthly calendarget_moon_influence- Activity influencepredict_moon_phases- Phase predictions
📅 Calendar Conversion Tools (3)
solar_to_lunar- Solar to lunar conversionlunar_to_solar- Lunar to solar conversionget_zodiac_info- Zodiac information
🔮 BaZi (八字) Tools (2)
calculate_bazi- Calculate Four Pillars of Destinycalculate_bazi_compatibility- BaZi compatibility analysis
⚡ Advanced Tools (3)
batch_check_dates- Check multiple datescompare_dates- Compare datesget_lucky_hours- Lucky hours of day
🔮 BaZi (八字) - Four Pillars of Destiny
The BaZi feature provides authentic traditional Chinese fortune-telling based on birth date and time.
What is BaZi?
BaZi (八字), also known as "Four Pillars of Destiny" or "Eight Characters," is a traditional Chinese astrological system that analyzes a person's destiny and characteristics based on the cosmic energies present at their birth. Each person has four pillars (year, month, day, hour), and each pillar consists of two characters (a Heavenly Stem and an Earthly Branch), totaling eight characters.
Features
Complete Four Pillars Analysis: Year (年柱), Month (月柱), Day (日柱), Hour (时柱)
Heavenly Stems & Earthly Branches: All 10 stems (天干) and 12 branches (地支)
Five Elements Analysis: Wood, Fire, Earth, Metal, Water distribution and balance
Day Master (日主): Your core element and personality traits
Life Stage Insights: How each pillar influences different life periods
Element Recommendations: Favorable colors, directions, and career paths
Compatibility Analysis: Relationship harmony based on element interactions
Timezone Support: Accurate calculations for any timezone
Example Usage
from lunar_mcp_server.bazi import BaZiCalculator
calculator = BaZiCalculator()
# Calculate BaZi chart
result = await calculator.calculate_bazi("1990-05-15 14:30", timezone_offset=8)
print(f"Eight Characters: {result['eight_characters']}")
# Output: 庚午乙巳丙子乙未
print(f"Day Master: {result['day_master']['element']} {result['day_master']['polarity']}")
# Output: Day Master: Fire Yang
# Check compatibility
compat = await calculator.get_compatibility(
"1990-05-15 14:30",
"1992-08-20 10:00",
timezone_offset=8
)
print(f"Compatibility: {compat['compatibility_score']}/10 - {compat['compatibility_level']}")
# Output: Compatibility: 8/10 - Excellent
print(f"Relationship: {compat['element_relationship']}")
# Output: Wood generates Fire - supportive relationshipUnderstanding Your BaZi Chart
Each pillar represents different aspects of your life:
Year Pillar (年柱): Ancestors, early life (0-15 years), inherited characteristics
Month Pillar (月柱): Parents, youth (16-30 years), career development
Day Pillar (日柱): Self, spouse, middle age (31-45 years), marriage
Hour Pillar (时柱): Children, later life (46+ years), legacy
The Day Master (your day pillar's Heavenly Stem) represents your core self and is the most important element in BaZi analysis.
Element Relationships
BaZi uses two key cycles:
Generation Cycle (生): Wood → Fire → Earth → Metal → Water → Wood
Control Cycle (克): Wood → Earth → Water → Fire → Metal → Wood
These relationships determine compatibility and element balance in your chart.
🏮 Cultural Traditions
Based on traditional Chinese calendar systems:
Lunar Calendar - Traditional lunar-solar calendar
12 Zodiac Animals - Rat, Ox, Tiger, Rabbit, Dragon, Snake, Horse, Goat, Monkey, Rooster, Dog, Pig
Five Elements - Wood, Fire, Earth, Metal, Water
28 Lunar Mansions - Traditional stellar divisions
Traditional Festivals - Spring Festival, Mid-Autumn, Dragon Boat, and more
📝 Example Usage
Python API
import asyncio
from lunar_mcp_server import LunarMCPServer
async def main():
server = LunarMCPServer()
# Check if date is auspicious for wedding
result = await server._check_auspicious_date(
date="2024-03-15",
activity="wedding",
culture="chinese"
)
print(f"Auspiciousness: {result['auspicious_level']}")
print(f"Score: {result['score']}/10")
asyncio.run(main())Example Output
Here's what you can expect when checking an auspicious date:
{
"date": "2024-03-15",
"activity": "wedding",
"auspicious_level": "Very Auspicious",
"score": 8.5,
"lunar_date": {
"year": 2024,
"month": 2,
"day": 6,
"zodiac": "Dragon",
"element": "Wood"
},
"recommendations": [
"Excellent day for new beginnings",
"Dragon day brings good fortune",
"Wood element supports growth"
],
"lucky_hours": ["7-9 AM", "11 AM-1 PM", "5-7 PM"],
"favorable_colors": ["red", "gold", "purple"],
"things_to_do": ["Marriage ceremony", "Important contracts", "Grand openings"],
"things_to_avoid": ["Funerals", "Moving house", "Starting construction"]
}🧪 Testing
# Run comprehensive MCP server tests
./scripts/test_mcp_final.sh
# Run unit tests
uv run pytest --cov📦 Publishing
This server is published to:
PyPI:
pip install lunar-mcp-serverSmithery.ai:
npx @smithery/cli install lunar-mcp-server(coming soon)
🛠️ Development
# Clone and setup
git clone https://github.com/AngusHsu/lunar-mcp-server.git
cd lunar-mcp-server
uv sync --dev
# Code quality
uv run black src/ tests/
uv run ruff check src/ tests/
uv run mypy src/📚 Documentation
📖 Usage Examples - Practical examples and integration guides
📖 Tools Reference - Complete API documentation
📖 Cultural Traditions - Understanding Chinese calendar systems
📖 Testing Guide - Running and writing tests
📖 Development Guide - Contributing to the project
📖 Smithery Publishing - Publishing to MCP registry
📄 License
MIT License - see LICENSE file for details.
🙏 Acknowledgments
Built with dedication for preserving and sharing traditional calendar wisdom.
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- Alicense-qualityDmaintenanceEnables traditional Chinese fortune-telling through BaZi (Four Pillars) analysis, including solar/lunar date conversion, Five Element balance calculations, Ten Gods deduction, and destiny interpretation for metaphysics applications.17MIT
- Alicense-qualityDmaintenanceProvides accurate Chinese Bazi (八字) fortune-telling calculations including birth chart analysis, destiny forecasting, and Chinese calendar information. Addresses inaccuracies in existing AI fortune-telling tools by delivering precise Bazi data for personality analysis and metaphysical insights.184ISC
- Alicense-qualityBmaintenanceProvides Chinese holiday information, lunar calendar conversion, traditional festivals, 24 solar terms, and BaZi (Eight Characters) calculations for AI assistants to accurately handle Chinese calendar queries and date conversions.3Apache 2.0
- Alicense-qualityDmaintenanceProvides Chinese traditional calendar functions including BaZi calculation, solar-lunar calendar conversion, Huangli almanac queries, daily fortune readings, 24 solar terms, and Wu Xing (Five Elements) analysis.MIT
Related MCP Connectors
Chinese almanac: lunar calendar, BaZi 八字, daily 宜忌, lucky-day picker, public holidays.
Generate BaZi charts from birth details. Explore Four Pillars, solar terms, and Luck Pillars for d…
Zi Wei Dou Shu for AI agents: free natal charts, six transit levels, and optional readings.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/AngusHsu/lunar-mcp-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server