{"_id":"@dhcckb/mcp-server-dila-time","_rev":"2-74b0d4e1cf6d1add37ae449fa5581815","name":"@dhcckb/mcp-server-dila-time","dist-tags":{"latest":"1.1.0"},"versions":{"1.0.0":{"name":"@dhcckb/mcp-server-dila-time","version":"1.0.0","keywords":["mcp","chinese-calendar","western-calendar","dila","buddhist-studies","time-authority","era-conversion","ganzhi","sexagenary-cycle"],"author":{"name":"DHCCKB"},"license":"MIT","_id":"@dhcckb/mcp-server-dila-time@1.0.0","maintainers":[{"name":"thudh","email":"tangchen@mail.tsinghua.edu.cn"}],"bin":{"mcp-server-dila-time":"dist/index.js"},"mcp":{"tools":[{"name":"dila_convert_chinese_to_western","description":"将中历日期转换为西历日期。输入朝代、年号、年份、月份（可选）、日期（可选），返回对应的西历年月日或年份范围。基于 DILA 佛学规范资料库权威数据。","inputSchema":{"type":"object","required":["dynasty","era_name","year"],"properties":{"day":{"type":"integer","description":"农历日期（1-30），可选"},"year":{"type":"integer","description":"年号纪年（数字），如 3 代表贞观三年"},"month":{"type":"integer","description":"农历月份（1-12），可选"},"dynasty":{"type":"string","description":"朝代名称，如：唐、宋、明、清等"},"era_name":{"type":"string","description":"年号名称，如：贞观、康熙、乾隆等"},"month_is_leap":{"type":"boolean","description":"是否为闰月，可选，默认 false"}}}},{"name":"dila_search_era_names","description":"根据关键词搜索朝代或年号信息。用于用户在不确定完整年号名称时进行模糊匹配。返回匹配的年号列表及其所属朝代和起止西历年份。","inputSchema":{"type":"object","required":["keyword"],"properties":{"limit":{"type":"integer","description":"返回结果数量上限，默认 10"},"dynasty":{"type":"string","description":"限定朝代范围，可选"},"keyword":{"type":"string","description":"搜索关键词，可以是朝代名或年号名的部分文字"}}}},{"name":"dila_lookup_ganzhi_year","description":"通过干支纪年查找对应的西历年份。输入干支组合（如：甲子、乙丑）和可选的朝代限定，返回对应的西历年份列表。","inputSchema":{"type":"object","required":["ganzhi"],"properties":{"ganzhi":{"type":"string","description":"干支纪年，如：甲子、乙丑、戊戌等"},"dynasty":{"type":"string","description":"限定朝代范围，可选"}}}}]},"dist":{"shasum":"b42705bc15f94ddfb96a7870642241c201f2a20d","tarball":"https://registry.npmjs.org/@dhcckb/mcp-server-dila-time/-/mcp-server-dila-time-1.0.0.tgz","fileCount":10,"integrity":"sha512-F5o6fBuEQ2xtdIRvfJ5ZBs1U6L7uN+y1k3uKdGiZrh++OpyPGVHbjo0fnPvX/h6I1WcKvMXsM4Q0m7W6ChHk+w==","signatures":[{"sig":"MEUCIQD/rQQb/JXmONfC8lJP50TLhRuoa0xhdhFPuRa2eBSyVQIgB0AXRP70UQUe7FM/TYEEYAIF1BA+X1xut2S7U4yiNTo=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":50988},"main":"dist/index.js","_from":"file:/tmp/dhp-agent-npm-CkFJMM/package.tgz","types":"./dist/index.d.ts","engines":{"node":">=18"},"scripts":{"build":"tsc","start":"node dist/index.js"},"_npmUser":{"name":"thudh","email":"tangchen@mail.tsinghua.edu.cn"},"_resolved":"/tmp/dhp-agent-npm-CkFJMM/package.tgz","_integrity":"sha512-F5o6fBuEQ2xtdIRvfJ5ZBs1U6L7uN+y1k3uKdGiZrh++OpyPGVHbjo0fnPvX/h6I1WcKvMXsM4Q0m7W6ChHk+w==","_npmVersion":"10.9.1","description":"MCP Server for Chinese-Western calendar conversion using DILA Buddhist Studies Time Authority Database","directories":{},"_nodeVersion":"22.22.2","dependencies":{"axios":"^1.7.0","cheerio":"^1.0.0","@modelcontextprotocol/sdk":"^1.17.0"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.4.0","@types/node":"^20.0.0"},"_npmOperationalInternal":{"tmp":"tmp/mcp-server-dila-time_1.0.0_1784169004914_0.841294262800675","host":"s3://npm-registry-packages-npm-production"}},"1.1.0":{"name":"@dhcckb/mcp-server-dila-time","version":"1.1.0","description":"MCP Server for Chinese-Western calendar conversion using DILA Buddhist Studies Time Authority Database. Supports precise day-level conversion via drill-down through dynasty→era→year→month→day.","main":"dist/index.js","bin":{"mcp-server-dila-time":"dist/index.js"},"scripts":{"build":"tsc","start":"node dist/index.js"},"keywords":["mcp","chinese-calendar","western-calendar","dila","buddhist-studies","time-authority","era-conversion","ganzhi","sexagenary-cycle"],"author":{"name":"DHCCKB"},"license":"MIT","engines":{"node":">=18"},"dependencies":{"@modelcontextprotocol/sdk":"^1.17.0","axios":"^1.7.0","cheerio":"^1.0.0"},"devDependencies":{"@types/node":"^20.0.0","typescript":"^5.4.0"},"mcp":{"tools":[{"name":"dila_convert_chinese_to_western","description":"将中历日期转换为西历日期。输入朝代、年号、年份、月份（可选）、日期（可选），返回对应的西历年月日或年份范围。当提供月份和日期时，会通过 DILA 网站逐级查询以获取精确到日的西历日期。基于 DILA 佛学规范资料库权威数据。","inputSchema":{"type":"object","properties":{"dynasty":{"type":"string","description":"朝代名称，如：唐、宋、明、清等"},"era_name":{"type":"string","description":"年号名称，如：贞观、康熙、乾隆等"},"year":{"type":"integer","description":"年号纪年（数字），如 3 代表贞观三年"},"month":{"type":"integer","description":"农历月份（1-12），可选"},"day":{"type":"integer","description":"农历日期（1-30），可选"},"month_is_leap":{"type":"boolean","description":"是否为闰月，可选，默认 false"}},"required":["dynasty","era_name","year"]}},{"name":"dila_search_era_names","description":"根据关键词搜索朝代或年号信息。用于用户在不确定完整年号名称时进行模糊匹配。返回匹配的年号列表及其所属朝代和起止西历年份。","inputSchema":{"type":"object","properties":{"keyword":{"type":"string","description":"搜索关键词，可以是朝代名或年号名的部分文字"},"dynasty":{"type":"string","description":"限定朝代范围，可选"},"limit":{"type":"integer","description":"返回结果数量上限，默认 10"}},"required":["keyword"]}},{"name":"dila_lookup_ganzhi_year","description":"通过干支纪年查找对应的西历年份。输入干支组合（如：甲子、乙丑）和可选的朝代限定，返回对应的西历年份列表。","inputSchema":{"type":"object","properties":{"ganzhi":{"type":"string","description":"干支纪年，如：甲子、乙丑、戊戌等"},"dynasty":{"type":"string","description":"限定朝代范围，可选"}},"required":["ganzhi"]}},{"name":"convert_chinese_date_full","description":"将中国年号纪年日期（含年、月、日）转换为精确的西历日期。支持闰月标记（month 为负数表示闰月，如 -6 表示闰六月）。当仅提供 eraName 和 year 时返回西历年份范围；提供 month 时返回该月的西历日期范围；提供完整年月日时返回精确西历日期（YYYY-MM-DD）及置信度。数据来源为 DILA 佛学规范资料库，通过逐级钻取年→月→日获取精确日。","inputSchema":{"type":"object","properties":{"eraName":{"type":"string","description":"中国年号名，如「乾隆」「康熙」「光绪」"},"year":{"type":"number","description":"年份，即位年数，如 25 表示二十五年"},"month":{"type":"number","description":"月份（1-12），闰月以负数表示，如 -6 表示闰六月。可选，缺省时仅返回年份范围。"},"day":{"type":"number","description":"日期（1-30）。可选，缺省时返回月份范围。"}},"required":["eraName","year"]}},{"name":"parse_chinese_date","description":"解析自然语言中文日期字符串（如「乾隆二十五年十月初三」「康熙六十年闰六月十五」），自动拆解为年号、年、月、日结构化数据，然后通过 DILA 资料库逐级查询得到精确西历日期。支持「初X」「廿X」等中文日期表达方式，支持闰月（如「闰六月」）。适合 LLM 直接传入用户原文，无需预拆分。","inputSchema":{"type":"object","properties":{"dateString":{"type":"string","description":"中文日期字符串，如「乾隆二十五年十月初三」「康熙六十年闰六月十五」「光绪二十年五月」"}},"required":["dateString"]}}]},"_id":"@dhcckb/mcp-server-dila-time@1.1.0","types":"./dist/index.d.ts","_integrity":"sha512-UQmKxkK5v2Fim7BxGSmyXmfmzwVZ0ulLETkL5RShSTEJS3G5IjwZi0BD7PDNhZRgVimkxg4i7mtPQPEDf4+ujw==","_resolved":"/tmp/dhp-agent-npm-ncBDhC/package.tgz","_from":"file:/tmp/dhp-agent-npm-ncBDhC/package.tgz","_nodeVersion":"22.22.2","_npmVersion":"10.9.1","dist":{"integrity":"sha512-UQmKxkK5v2Fim7BxGSmyXmfmzwVZ0ulLETkL5RShSTEJS3G5IjwZi0BD7PDNhZRgVimkxg4i7mtPQPEDf4+ujw==","shasum":"609205155e0e5a65c18fc8995143c958f54da6a5","tarball":"https://registry.npmjs.org/@dhcckb/mcp-server-dila-time/-/mcp-server-dila-time-1.1.0.tgz","fileCount":14,"unpackedSize":124883,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIHk7XVygxKiYX+ZASk3vPz0dkkdASGhnYAC+7DQY220iAiAWyyhXy/Y9pUYJIrSpO5N6K6M/4QHN5DkgmvtHcW80Mg=="}]},"_npmUser":{"name":"thudh","email":"tangchen@mail.tsinghua.edu.cn"},"directories":{},"maintainers":[{"name":"thudh","email":"tangchen@mail.tsinghua.edu.cn"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/mcp-server-dila-time_1.1.0_1784365440066_0.257697930901287"},"_hasShrinkwrap":false}},"time":{"created":"2026-07-16T02:30:04.724Z","modified":"2026-07-18T09:04:00.369Z","1.0.0":"2026-07-16T02:30:05.049Z","1.1.0":"2026-07-18T09:04:00.196Z"},"author":{"name":"DHCCKB"},"license":"MIT","keywords":["mcp","chinese-calendar","western-calendar","dila","buddhist-studies","time-authority","era-conversion","ganzhi","sexagenary-cycle"],"description":"MCP Server for Chinese-Western calendar conversion using DILA Buddhist Studies Time Authority Database. Supports precise day-level conversion via drill-down through dynasty→era→year→month→day.","maintainers":[{"name":"thudh","email":"tangchen@mail.tsinghua.edu.cn"}],"readme":"# @dhcckb/mcp-server-dila-time\n\nMCP Server for Chinese-Western calendar conversion using the [DILA Buddhist Studies Time Authority Database](https://authority.dila.edu.tw/time/index.php).\n\n## Features\n\n- **Chinese → Western Calendar Conversion**: Convert dynasty + era name + year to Western (Gregorian/Julian) dates\n- **Precise Day-Level Conversion** (v1.1.0): Supports month and day parameters to get exact Western dates via DILA drill-down\n- **Natural Language Date Parsing**: Parse Chinese date strings like \"乾隆二十五年十月初三\" directly\n- **Era Name Search**: Fuzzy search for dynasty and era names by keyword\n- **Ganzhi (Sexagenary Cycle) Lookup**: Find Western years corresponding to a Chinese sexagenary cycle combination\n\n## Installation\n\n```bash\nnpx @dhcckb/mcp-server-dila-time\n```\n\nOr install globally:\n\n```bash\nnpm install -g @dhcckb/mcp-server-dila-time\nmcp-server-dila-time\n```\n\n## MCP Client Configuration\n\nAdd to your MCP client configuration (e.g., Claude Desktop `claude_desktop_config.json`):\n\n```json\n{\n  \"mcpServers\": {\n    \"dila-time\": {\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"@dhcckb/mcp-server-dila-time\"]\n    }\n  }\n}\n```\n\n## Tools\n\n### `dila_convert_chinese_to_western`\n\nConvert a Chinese calendar date to Western calendar date. When both month and day are provided, uses DILA website drill-down to obtain precise day-level conversion.\n\n**Parameters:**\n- `dynasty` (required): Dynasty name, e.g., 唐, 宋, 明, 清\n- `era_name` (required): Era/reign name, e.g., 贞观, 康熙, 乾隆\n- `year` (required): Year number within the era, e.g., 3 for 贞观三年\n- `month` (optional): Lunar month (1-12)\n- `day` (optional): Lunar day (1-30)\n- `month_is_leap` (optional): Whether it's a leap month, default false\n\n### `convert_chinese_date_full` (NEW in v1.1.0)\n\nConvert Chinese era date to precise Western date with structured JSON output. Supports year-only (returns year range), year+month (returns month range), and year+month+day (returns exact date with confidence level).\n\n**Parameters:**\n- `eraName` (required): Era name, e.g., \"乾隆\", \"康熙\"\n- `year` (required): Year number, e.g., 25\n- `month` (optional): Month 1-12, use negative for leap month (e.g., -6 = 闰六月)\n- `day` (optional): Day 1-30\n\n**Example:** `eraName=\"乾隆\", year=25, month=10, day=3` → `\"1760-11-10\"` with confidence `\"exact\"`\n\n### `parse_chinese_date` (NEW in v1.1.0)\n\nParse natural language Chinese date strings and convert to Western dates using DILA.\n\n**Parameters:**\n- `dateString` (required): Chinese date string, e.g., \"乾隆二十五年十月初三\", \"康熙六十年闰六月十五\"\n\n**Example:** `dateString=\"乾隆二十五年十月初三\"` → `\"1760-11-10\"`\n\n### `dila_search_era_names`\n\nSearch for dynasty or era names by keyword.\n\n**Parameters:**\n- `keyword` (required): Search keyword (partial dynasty or era name)\n- `dynasty` (optional): Limit results to a specific dynasty\n- `limit` (optional): Maximum number of results, default 10\n\n### `dila_lookup_ganzhi_year`\n\nLook up Western years for a given sexagenary cycle combination.\n\n**Parameters:**\n- `ganzhi` (required): Sexagenary cycle combination, e.g., 甲子, 乙丑, 戊戌\n- `dynasty` (optional): Limit results to a specific dynasty\n\n## Data Source\n\nAll data is sourced from the [DILA Buddhist Studies Time Authority Database](https://authority.dila.edu.tw/time/index.php), maintained by the Dharma Drum Institute of Liberal Arts.\n\nThe day-precision conversion works by programmatically drilling down through DILA's web interface:\n1. Search for the era name → obtain dynasty and emperor parameters\n2. Navigate to the specific year → list of months with western date ranges\n3. Navigate to the specific month → list of days with exact western dates\n4. Extract the precise western date for the target day\n\n## Changelog\n\n### v1.1.0\n- Added `convert_chinese_date_full` tool for precise day-level conversion with structured JSON output\n- Added `parse_chinese_date` tool for natural language Chinese date parsing\n- Enhanced `dila_convert_chinese_to_western` to use drill-down when month and day are provided\n- Support for leap months (闰月)\n- Support for 元年 (first year of era) notation\n- In-memory HTTP caching for DILA responses (30-minute TTL)\n\n### v1.0.0\n- Initial release with basic era/year conversion, era search, and ganzhi lookup\n\n## Fallback\n\nIf the DILA website is unavailable or its HTML structure changes, the tools will return an error with a suggestion to visit https://authority.dila.edu.tw/time/index.php directly.\n\n## License\n\nMIT\n","readmeFilename":"README.md"}