20 Tools | BaZi (ๅ ซๅญ) | Chinese Zodiac | Five Elements | Moon Phases | Festivals | Auspicious Dates
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.
- ๐ฏ 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
๐ Complete Features List โ
The fastest way to get started - no Python installation required:
# Install and run with uvx (recommended)
uvx lunar-mcp-serverOnce 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"
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!
# 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-servercheck_auspicious_date- Check if date is favorablefind_good_dates- Find optimal datesget_daily_fortune- Daily fortune infocheck_zodiac_compatibility- Zodiac compatibility
get_lunar_festivals- Festivals on dateget_next_festival- Next upcoming festivalget_festival_details- Festival informationget_annual_festivals- Annual calendar
get_moon_phase- Moon phase infoget_moon_calendar- Monthly calendarget_moon_influence- Activity influencepredict_moon_phases- Phase predictions
solar_to_lunar- Solar to lunar conversionlunar_to_solar- Lunar to solar conversionget_zodiac_info- Zodiac information
calculate_bazi- Calculate Four Pillars of Destinycalculate_bazi_compatibility- BaZi compatibility analysis
batch_check_dates- Check multiple datescompare_dates- Compare datesget_lucky_hours- Lucky hours of day
๐ Complete API Reference โ
The BaZi feature provides authentic traditional Chinese fortune-telling based on birth date and time.
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.
- 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
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 relationshipEach 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.
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.
๐ Complete API Reference โ
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
๐ Cultural Traditions Guide โ
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())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"]
}# Run comprehensive MCP server tests
./scripts/test_mcp_final.sh
# Run unit tests
uv run pytest --covThis server is published to:
- PyPI:
pip install lunar-mcp-server - Smithery.ai:
npx @smithery/cli install lunar-mcp-server(coming soon)
# 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/- ๐ 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
MIT License - see LICENSE file for details.
Built with dedication for preserving and sharing traditional calendar wisdom.