mcp-datetime

v0.3.0
mcp-datetime Checked 3 days ago Published 28 days ago

A MCP server for datetime formatting, timezones, Japanese era (wareki) and file name generation.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

get_datetime

Get the current date and time in the given format. The time is in the local timezone of the machine running the server, unless 'timezone' is given as an IANA name such as 'Asia/Tokyo' or 'UTC'. 'format' is one of the format names below, or a custom pattern containing '%'. Custom patterns accept strftime directives (%Y %m %d %H %M %S %a %A %b %B %z %Z %j ...), %-m %-d %-H %-M %-S %-I %-j %-y for no leading zero, and these Japanese directives: %Je era name (令和), %JE era initial (R), %Jy era year (元 for year 1), %JY era year (always a number), %Ja weekday (火), %JA weekday (火曜日). E…

ParameterTypeDescription
format *stringFormat name such as 'datetime', or a custom pattern containing '%'. See the tool description.
timezoneIANA timezone name such as 'Asia/Tokyo', 'UTC' or 'America/New_York'. Omit to use the local timezone of the machine.

convert_time

Convert a time or date-time from one timezone to another. Returns both sides with their timezone, UTC offset and weekday, and the time difference. A note is added when the time is skipped or repeated by a daylight saving time change. Accepted forms: '2024-12-10', '2024-12-10 14:30', '2024-12-10T14:30:00+09:00', '2024/12/10', '2024年12月10日 14時30分', Japanese era such as '令和6年12月10日' or 'R6.12.10', and a time only such as '14:30' (today).

ParameterTypeDescription
target_timezone *stringIANA timezone to convert to, e.g. 'America/New_York'.
time *stringTime or date-time to convert, e.g. '14:30' or '2024-12-10 14:30'.
formatstringOutput format name or custom pattern, as in get_datetime.
source_timezoneIANA timezone of 'time', e.g. 'Asia/Tokyo'. Omit to use the local timezone. An offset written in 'time' (+09:00, Z) takes precedence.

shift_datetime

Add or subtract an amount of time to a date-time (default: now). Use negative numbers for the past. Years, months, weeks and days keep the wall time; if the day does not exist in the new month, the last day of that month is used (2024-01-31 + 1 month = 2024-02-29). Hours, minutes and seconds are elapsed time. Accepted forms: '2024-12-10', '2024-12-10 14:30', '2024-12-10T14:30:00+09:00', '2024/12/10', '2024年12月10日 14時30分', Japanese era such as '令和6年12月10日' or 'R6.12.10', and a time only such as '14:30' (today).

ParameterTypeDescription
baseStart date-time. Omit to start from now.
daysinteger
formatstringOutput format name or custom pattern, as in get_datetime.
hoursinteger
minutesinteger
monthsinteger
secondsinteger
timezoneIANA timezone of 'base' and of the result. Omit for local time.
weeksinteger
yearsinteger

get_datetime_info

Get details of a date-time (default: now): ISO date-time, timezone, UTC offset, daylight saving time, Unix time, weekday in English and Japanese, Japanese era (wareki), day of year, ISO week, quarter, leap year, days in the month, and the difference from a reference date-time (default: now) in days and seconds, e.g. how many days until a date. Accepted forms: '2024-12-10', '2024-12-10 14:30', '2024-12-10T14:30:00+09:00', '2024/12/10', '2024年12月10日 14時30分', Japanese era such as '令和6年12月10日' or 'R6.12.10', and a time only such as '14:30' (today).

ParameterTypeDescription
datetimeDate-time to inspect. Omit for now.
referenceDate-time to compare with. Omit to compare with now.
timezoneIANA timezone for reading and showing the date-times. Omit for local.