@dhcckb/mcp-server-dila-time
@dhcckb/mcp-server-dila-time
MCP Server for Chinese-Western calendar conversion using the DILA Buddhist Studies Time Authority Database.
Features
- Chinese → Western Calendar Conversion: Convert dynasty + era name + year to Western (Gregorian/Julian) dates
- Precise Day-Level Conversion (v1.1.0): Supports month and day parameters to get exact Western dates via DILA drill-down
- Natural Language Date Parsing: Parse Chinese date strings like "乾隆二十五年十月初三" directly
- Era Name Search: Fuzzy search for dynasty and era names by keyword
- Ganzhi (Sexagenary Cycle) Lookup: Find Western years corresponding to a Chinese sexagenary cycle combination
Installation
npx @dhcckb/mcp-server-dila-time
Or install globally:
npm install -g @dhcckb/mcp-server-dila-time
mcp-server-dila-time
MCP Client Configuration
Add to your MCP client configuration (e.g., Claude Desktop claude_desktop_config.json):
{
"mcpServers": {
"dila-time": {
"command": "npx",
"args": ["-y", "@dhcckb/mcp-server-dila-time"]
}
}
}
Tools
dila_convert_chinese_to_western
Convert 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.
Parameters:
dynasty(required): Dynasty name, e.g., 唐, 宋, 明, 清era_name(required): Era/reign name, e.g., 贞观, 康熙, 乾隆year(required): Year number within the era, e.g., 3 for 贞观三年month(optional): Lunar month (1-12)day(optional): Lunar day (1-30)month_is_leap(optional): Whether it's a leap month, default false
convert_chinese_date_full (NEW in v1.1.0)
Convert 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).
Parameters:
eraName(required): Era name, e.g., "乾隆", "康熙"year(required): Year number, e.g., 25month(optional): Month 1-12, use negative for leap month (e.g., -6 = 闰六月)day(optional): Day 1-30
Example: eraName="乾隆", year=25, month=10, day=3 → "1760-11-10" with confidence "exact"
parse_chinese_date (NEW in v1.1.0)
Parse natural language Chinese date strings and convert to Western dates using DILA.
Parameters:
dateString(required): Chinese date string, e.g., "乾隆二十五年十月初三", "康熙六十年闰六月十五"
Example: dateString="乾隆二十五年十月初三" → "1760-11-10"
dila_search_era_names
Search for dynasty or era names by keyword.
Parameters:
keyword(required): Search keyword (partial dynasty or era name)dynasty(optional): Limit results to a specific dynastylimit(optional): Maximum number of results, default 10
dila_lookup_ganzhi_year
Look up Western years for a given sexagenary cycle combination.
Parameters:
ganzhi(required): Sexagenary cycle combination, e.g., 甲子, 乙丑, 戊戌dynasty(optional): Limit results to a specific dynasty
Data Source
All data is sourced from the DILA Buddhist Studies Time Authority Database, maintained by the Dharma Drum Institute of Liberal Arts.
The day-precision conversion works by programmatically drilling down through DILA's web interface:
- Search for the era name → obtain dynasty and emperor parameters
- Navigate to the specific year → list of months with western date ranges
- Navigate to the specific month → list of days with exact western dates
- Extract the precise western date for the target day
Changelog
v1.1.0
- Added
convert_chinese_date_fulltool for precise day-level conversion with structured JSON output - Added
parse_chinese_datetool for natural language Chinese date parsing - Enhanced
dila_convert_chinese_to_westernto use drill-down when month and day are provided - Support for leap months (闰月)
- Support for 元年 (first year of era) notation
- In-memory HTTP caching for DILA responses (30-minute TTL)
v1.0.0
- Initial release with basic era/year conversion, era search, and ganzhi lookup
Fallback
If 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.
License
MIT