文档 / 农历节假日
历

农历节假日/calendar-mcp/mcp

查某天是不是放假、哪天要补班,同时给农历年月日和干支。列整年安排时给每个假期的日期区间、放假天数、调休上班日;公历转农历给生肖、年/月/日三组干支和是否闰月。数据覆盖 2025、2026 两年。

3 个工具7 天调用 —免费 100 次 / 天 / IP

MCP 客户端接入

一行命令,工具自动出现在 Agent 的工具列表里。

bashclaude mcp add
# Claude Code / Cursor / 任何 MCP 客户端
claude mcp add --transport http mycel-calendar https://pianam.cn/calendar-mcp/mcp

HTTP 直连

标准 JSON-RPC 2.0。initialize 握手不消耗额度,只有 tools/call 计数。

bash先看有哪些工具
curl -s https://pianam.cn/calendar-mcp/mcp \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json, text/event-stream' \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/list","params":{}}'

工具清单

3 个工具,参数与返回结构均来自线上真实响应
01

query_holiday

1 个参数

查询指定公历日期的中国法定节假日或调休安排,同时返回农历信息。支持2025、2026年。参数date格式:YYYY-MM-DD

入参

参数类型必填默认说明
datestring必填—公历日期,格式 YYYY-MM-DD,如 "2026-10-01"
bash直接 curl 调(真实可跑)
curl -s https://pianam.cn/calendar-mcp/mcp \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json, text/event-stream' \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"query_holiday","arguments":{"date":"2026-10-01"}}}'
返回示例(线上真实结果) · 413 字符,点开看
jsonstructuredContent
{
  "date": "2026-10-01",
  "weekday": "周四",
  "holiday_name": "国庆节",
  "type": "放假",
  "is_holiday": true,
  "is_workday_adjusted": false,
  "lunar": {
    "lunar_year": 2026,
    "lunar_month": 8,
    "lunar_day": 21,
    "is_leap_month": false,
    "lunar_date_str": "2026年八月廿一",
    "zodiac": "马",
    "year_ganzhi": "丙午",
    "month_ganzhi": "丁酉",
    "day_ganzhi": "戊申",
    "solar_date": "2026-10-01"
  }
}

type 取值是「放假」或「调休上班」;is_holiday 和 is_workday_adjusted 两个布尔位分开判断更稳。农历信息嵌在 lunar 子对象里,含生肖和年月日三组干支。只支持 2025、2026 两年,其他年份返回错误。

02

solar_to_lunar

3 个参数

将公历日期转换为农历日期,返回农历年月日、是否闰月、生肖、干支等信息

入参

参数类型必填默认说明
yearinteger必填—公历年,如 2026
monthinteger必填—公历月,如 2
dayinteger必填—公历日,如 17
bash直接 curl 调(真实可跑)
curl -s https://pianam.cn/calendar-mcp/mcp \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json, text/event-stream' \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"solar_to_lunar","arguments":{"year":2026,"month":2,"day":17}}}'
返回示例(线上真实结果) · 237 字符,点开看
jsonstructuredContent
{
  "lunar_year": 2026,
  "lunar_month": 1,
  "lunar_day": 1,
  "is_leap_month": false,
  "lunar_date_str": "2026年正月初一",
  "zodiac": "马",
  "year_ganzhi": "丙午",
  "month_ganzhi": "庚寅",
  "day_ganzhi": "壬戌",
  "solar_date": "2026-02-17"
}

2026-02-17 正好是农历正月初一(丙午马年),适合当验证用例。year/month/day 三个参数都是 integer,传字符串 "2026" 可能被拒。

03

list_holidays

1 个参数

列出指定年份的全部中国法定节假日安排,包括放假日期和调休上班日期。支持2025、2026年

入参

参数类型必填默认说明
yearinteger必填—年份,如 2026
bash直接 curl 调(真实可跑)
curl -s https://pianam.cn/calendar-mcp/mcp \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json, text/event-stream' \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"list_holidays","arguments":{"year":2026}}}'
返回示例(线上真实结果) · 1,112 字符,点开看
jsonstructuredContent
{
  "year": 2026,
  "total_holiday_days": 33,
  "total_work_adjust_days": 6,
  "holidays": [
    {
      "name": "元旦",
      "days": 3,
      "date_range": "2026-01-01 至 2026-01-03",
      "off_dates": [
        "2026-01-01",
        "2026-01-02",
        "2026-01-03"
      ],
      "work_adjust_dates": [
        "2026-01-04"
      ]
    },
    {
      "name": "春节",
      "days": 9,
      "date_range": "2026-02-15 至 2026-02-23",
      "off_dates": [
        "2026-02-15",
        "2026-02-16",
        "2026-02-17",
        "2026-02-18",
        "2026-02-19",
        "2026-02-20",
        "2026-02-21",
        "2026-02-22",
        "2026-02-23"
      ],
      "work_adjust_dates": [
        "2026-02-14",
        "2026-02-28"
      ]
    },
    {
      "name": "国庆节",
      "days": 7,
      "date_range": "2026-10-01 至 2026-10-07",
      "off_dates": [
        "2026-10-01",
        "2026-10-02",
        "2026-10-03",
        "2026-10-04",
        "2026-10-05",
        "2026-10-06",
        "2026-10-07"
      ],
      "work_adjust_dates": [
        "2026-09-20",
        "2026-10-10"
      ]
    }
  ]
}

线上真实返回 2026 年 7 个节假日,此处截元旦、春节、国庆节 3 条,其余(清明/劳动/端午/中秋)结构相同。total_holiday_days 和 total_work_adjust_days 是全年汇总,没被截断,仍是真实值 33 天和 6 天。

✓

免费额度:每 IP 每天 100 次

超额返回 -32002,带 X-API-Key 继续用。密钥在 pianam.cn 注册后于控制台创建。

接法 ①:MCP 客户端

Claude Code、Cursor、Cherry Studio 等支持 streamable HTTP 的客户端,一行命令把 3 个工具挂到 Agent 上。

bashclaude mcp add
# Claude Code / Cursor / 任何 MCP 客户端
claude mcp add --transport http mycel-calendar https://pianam.cn/calendar-mcp/mcp

接法 ②:直接打 HTTP

端点 https://pianam.cn/calendar-mcp/mcp,POST 一个 JSON-RPC 就返回数据,响应是 SSE(data: 行内是 JSON)。

bash先看工具清单(不消耗额度)
curl -s https://pianam.cn/calendar-mcp/mcp \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json, text/event-stream' \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/list","params":{}}'
← 回全部端点