Provides Taiwan national holidays and compensatory workday information. Data is fetched and cached automatically.
一個基於 Model Context Protocol (MCP) 的台灣假期查詢伺服器,提供準確的台灣國定假日和補班日資訊。
YYYY-MM-DD
和 YYYYMMDD
格式最簡單的使用方式,無需安裝:
npx taiwan-holiday-mcp
npm install -g taiwan-holiday-mcp
taiwan-holiday-mcp
git clone https://github.com/lis186/taiwan-holiday-mcp.git
cd taiwan-holiday-mcp
npm install
npm run build
npm start
在 Claude Desktop 的設定檔中新增:
{
"mcpServers": {
"taiwan-holiday": {
"command": "npx",
"args": ["taiwan-holiday-mcp"]
}
}
}
設定檔位置:
~/Library/Application Support/Claude/claude_desktop_config.json
%APPDATA%\Claude\claude_desktop_config.json
點擊以下按鈕直接安裝。
在專案的 .cursorrules
或設定檔中新增:
{
"mcp": {
"servers": {
"taiwan-holiday": {
"command": "npx",
"args": ["taiwan-holiday-mcp"]
}
}
}
}
安裝完成後,你可以直接在 Claude Desktop 中用自然語言與 AI 對話,詢問台灣假期相關問題:
你可以這樣問:
"2025年10月10日是假期嗎?"
"幫我查一下2025年1月有哪些假期"
"2025年總共有多少個假期?"
Claude 會自動呼叫相應的工具並回答:
你: "我想規劃2025年第一季的旅遊,幫我找出有哪些連假可以安排?"
Claude: 會自動查詢1-3月的假期,分析連續假期,並告訴你:
你: "下週一(2025年10月6日)需要上班嗎?"
Claude: 會檢查該日期並回答是否為工作日,如果是假期還會說明原因。
你: "2025年10月份有幾個假期?有什麼重要節日嗎?"
Claude: 會提供該月份的假期統計,包含國定假日和重要節慶資訊。
你: "幫我分析2025年哪個月份最適合請假旅遊?"
Claude: 會分析各月份的假期分布,考慮連假長度和頻率,給出最佳建議。
你: "我想看2025年所有的長假期,幫我整理一個清單"
Claude: 會自動找出所有3天以上的連假,並按時間順序整理成清單。
check_holiday
檢查指定日期是否為台灣假期。
參數:
date
(string): 日期,格式為 YYYY-MM-DD
或 YYYYMMDD
回傳:
{
"success": true,
"data": {
"date": "2025-10-10",
"isHoliday": true,
"description": "國慶日",
"week": "五",
"normalizedDate": "20251010"
}
}
get_holidays_in_range
獲取指定日期範圍內的所有台灣假期。
參數:
start_date
(string): 開始日期end_date
(string): 結束日期回傳:
{
"success": true,
"data": {
"startDate": "2025-01-01",
"endDate": "2025-01-31",
"holidays": [...],
"totalCount": 14,
"summary": "在 2025-01-01 到 2025-01-31 期間共有 14 個假期"
}
}
get_holiday_stats
獲取指定年份或年月的台灣假期統計資訊。
參數:
year
(number): 年份 (2017-2025)month
(number, 可選): 月份 (1-12)回傳:
{
"success": true,
"data": {
"year": 2025,
"statistics": {
"year": 2025,
"totalHolidays": 115,
"nationalHolidays": 113,
"compensatoryDays": 2,
"holidayTypes": {...}
},
"summary": "2025 年共有 115 個假期"
}
}
伺服器提供以下資源:
taiwan-holidays://years
- 支援的年份列表taiwan-holidays://holidays/{year}
- 指定年份的完整假期資料taiwan-holidays://stats/{year}
- 指定年份的統計資訊問題:Claude Desktop 顯示 "無法連接到 MCP 伺服器"
解決方案:
# 檢查 Node.js 版本(需要 18+)
node --version
# 重新安裝套件
npm uninstall -g taiwan-holiday-mcp
npm install -g taiwan-holiday-mcp
# 測試伺服器
taiwan-holiday-mcp --version
問題:收到 "無效的日期格式" 錯誤
解決方案:
YYYY-MM-DD
或 YYYYMMDD
問題:無法獲取假期資料
解決方案:
# 檢查網路連接
curl -I https://cdn.jsdelivr.net/gh/ruyut/TaiwanCalendar/data/2025.json
# 清除快取(如果有問題)
rm -rf ~/.taiwan-holiday-mcp-cache
啟用詳細日誌:
taiwan-holiday-mcp --debug
如果查詢速度較慢:
詳細的開發說明請參考 DEVELOPMENT.md。
# 複製專案
git clone https://github.com/lis186/taiwan-holiday-mcp.git
cd taiwan-holiday-mcp
# 安裝依賴
npm install
# 執行測試
npm test
# 建置專案
npm run build
# 啟動開發模式
npm run dev
npm run test:coverage
目前測試覆蓋率:92.34%(246 個測試案例,100% 通過)
歡迎貢獻!請遵循以下步驟:
git checkout -b feature/amazing-feature
)git commit -m 'Add amazing feature'
)git push origin feature/amazing-feature
)本專案的台灣假期資料來源於 TaiwanCalendar 開源專案,該專案基於中華民國政府公告的官方假期資訊。
重要聲明:
在法律允許的最大範圍內,本專案的作者和貢獻者不對因使用本軟體而產生的任何直接、間接、偶然、特殊或後果性損害承擔責任。
本專案採用 MIT 授權條款。詳見 LICENSE 檔案。
版本: 1.0.2
最後更新: 2025-06-21
MCP SDK: @modelcontextprotocol/sdk ^1.13.0
Node.js 需求: ≥ 18.0.0
品質狀態: 企業級生產就緒 ✅
Interact with Apple Notes using natural language on macOS.
MCP server for seamless document format conversion using Pandoc, supporting Markdown, HTML, and plain text, with other formats like PDF, csv and docx in development.
Control and interact with a local Logseq graph for knowledge management and note-taking.
Full implementation of Todoist Rest API for MCP server
An MCP proxy bridge for the Leantime project management system, forwarding JSON-RPC messages with proper authentication.
Interact with Fider, an open-source customer feedback tool, to manage user suggestions and feedback.
Interact with Atlassian products like Confluence and Jira, supporting both Cloud and Server/Data Center deployments.
Interact with Notion using its API. This server mirrors the Notion API SDK, allowing LLMs to manage pages, databases, and other Notion content.
Create notes in Flomo through AI chat interactions in Cursor or Claude desktop.
Access and manage your Roam Research graph via its API.