Sponsored by Deepsite.site

Lunar Calendar Service(万年历)

Created By
wouhaoa month ago
中文万年历 MCP 服务。支持公农历转换、二十四节气、法定节假日、黄历宜忌、八字五行、黄道吉日查询,共 9 个工具,直接接入 Claude/Cursor 使用。
Overview

lunar-calendar-service

🗓️ 给 AI Agent 使用的中文万年历 MCP 服务。提供公农历转换、二十四节气、法定节假日、黄历宜忌、八字五行等查询能力。

线上服务: https://cheerful-trust-production-065e.up.railway.app/sse


快速接入

Claude Desktop

编辑 ~/Library/Application Support/Claude/claude_desktop_config.json

{
  "mcpServers": {
    "lunar-calendar": {
      "url": "https://cheerful-trust-production-065e.up.railway.app/sse",
      "transport": "sse"
    }
  }
}

Cursor / Windsurf

在 MCP 设置里添加:

Name: lunar-calendar
URL:  https://cheerful-trust-production-065e.up.railway.app/sse
Type: SSE

本地运行(stdio 模式)

git clone https://github.com/wouhao/lunar-calendar-service
cd lunar-calendar-service
uv sync

# Claude Desktop 本地接入
# claude_desktop_config.json:
# {
#   "mcpServers": {
#     "lunar-calendar": {
#       "command": "uv",
#       "args": ["run", "python", "server.py"],
#       "cwd": "/path/to/lunar-calendar-service"
#     }
#   }
# }
uv run python server.py

可用工具(9 个)

基础功能

工具参数说明
get_date_infodate: YYYY-MM-DD返回公历/农历/干支/生肖/星座/节气/节假日完整信息
solar_to_lunardate: YYYY-MM-DD公历 → 农历
lunar_to_solaryear, month, day, leap_month?农历 → 公历(支持闰月)
get_solar_termsyear: int查询某年全部 24 节气日期
is_holidaydate: YYYY-MM-DD是否节假日 / 调休上班
get_holidaysyear: int某年全部法定节假日列表

黄历

工具参数说明
get_almanacdate: YYYY-MM-DD每日宜忌、吉神方位(喜/福/财)、纳音、彭祖百忌

高级

工具参数说明
get_advanced_infodate: YYYY-MM-DD, hour?: 0-23八字、五行、星宿、胎神、佛历、道历、黄道黑道
get_lucky_daysstart_date, end_date, purpose?查询范围内的黄道吉日,可指定用途

使用示例

接入后,你可以这样问 Claude:

  • "今天是什么日子?有没有节气?"
  • "明天黄历上宜什么忌什么?"
  • "2025 年春节是哪天?"
  • "下个月有哪些黄道吉日适合开业?"
  • "帮我查一下 2025 年全年节假日安排"
  • "农历正月初一是公历几号?"

技术栈

层次技术
语言Python 3.11+
包管理uv
底层历法库lunar-python 1.4.8
服务层FastMCP (MCP SDK)
SchemaPydantic v2
节假日数据静态 JSON(2025 年)
部署Railway

本地开发

# 安装依赖
uv sync

# 运行测试
uv run pytest tests/ -v

# CLI 快捷查询
uv run python cli.py today

# 本地 HTTP/SSE 模式
MCP_TRANSPORT=sse PORT=8000 uv run python server.py
curl http://localhost:8000/health

自行部署到 Railway

项目已包含 railway.jsonProcfile

  1. Fork 本仓库
  2. Railway 创建项目,导入 GitHub 仓库
  3. 部署完成后,MCP endpoint 为 https://<your-app>.up.railway.app/sse

路线图

  • Phase 1:核心功能(公农历/节气/节假日)
  • Phase 2:黄历增强(宜忌/方位/纳音)
  • Phase 3:高级功能(八字/五行/吉日)
  • Phase 4:Railway 云端部署
  • 补充 2026 年节假日数据
  • 更多年份节假日支持

License

MIT


如有问题或建议,欢迎提 Issue 或 PR。

Server Config

{
  "mcpServers": {
    "lunar-calendar": {
      "url": "https://cheerful-trust-production-065e.up.railway.app/sse",
      "transport": "sse"
    }
  }
}
Recommend Servers
TraeBuild with Free GPT-4.1 & Claude 3.7. Fully MCP-Ready.
MCP AdvisorMCP Advisor & Installation - Use the right MCP server for your needs
Playwright McpPlaywright MCP server
Zhipu Web SearchZhipu Web Search MCP Server is a search engine specifically designed for large models. It integrates four search engines, allowing users to flexibly compare and switch between them. Building upon the web crawling and ranking capabilities of traditional search engines, it enhances intent recognition capabilities, returning results more suitable for large model processing (such as webpage titles, URLs, summaries, site names, site icons, etc.). This helps AI applications achieve "dynamic knowledge acquisition" and "precise scenario adaptation" capabilities.
AiimagemultistyleA Model Context Protocol (MCP) server for image generation and manipulation using fal.ai's Stable Diffusion model.
RedisA Model Context Protocol server that provides access to Redis databases. This server enables LLMs to interact with Redis key-value stores through a set of standardized tools.
Visual Studio Code - Open Source ("Code - OSS")Visual Studio Code
Howtocook Mcp基于Anduin2017 / HowToCook (程序员在家做饭指南)的mcp server,帮你推荐菜谱、规划膳食,解决“今天吃什么“的世纪难题; Based on Anduin2017/HowToCook (Programmer's Guide to Cooking at Home), MCP Server helps you recommend recipes, plan meals, and solve the century old problem of "what to eat today"
Jina AI MCP ToolsA Model Context Protocol (MCP) server that integrates with Jina AI Search Foundation APIs.
Tavily Mcp
ChatWiseThe second fastest AI chatbot™
MiniMax MCPOfficial MiniMax Model Context Protocol (MCP) server that enables interaction with powerful Text to Speech, image generation and video generation APIs.
WindsurfThe new purpose-built IDE to harness magic
Baidu Map百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Y GuiA web-based graphical interface for AI chat interactions with support for multiple AI models and MCP (Model Context Protocol) servers.
Serper MCP ServerA Serper MCP Server
BlenderBlenderMCP connects Blender to Claude AI through the Model Context Protocol (MCP), allowing Claude to directly interact with and control Blender. This integration enables prompt assisted 3D modeling, scene creation, and manipulation.
EdgeOne Pages MCPAn MCP service designed for deploying HTML content to EdgeOne Pages and obtaining an accessible public URL.
DeepChatYour AI Partner on Desktop
Amap Maps高德地图官方 MCP Server
CursorThe AI Code Editor