用于时间操作的 MCP 服务器
用于时间操作的动态 MCP 服务器管理服务。
MCP 工具
该服务器通过模型上下文协议 (MCP) 提供几个与时间相关的工具。
获取时区
获取服务器的当前时区。
返回:
text
:时区字符串。例如
Asia/Tokyo
获取unix时间
获取当前 Unix 时间戳(自纪元以来的秒数)。
返回:
text
:字符串形式的 Unix 时间戳。例如
1746627290
将unix转换为datetime
将 Unix 时间戳转换为格式化的日期时间字符串。
参数:
unixtime
(number
,必需):要转换的 Unix 时间戳。例如
1746627290
timezone
(string
,可选):要使用的时区(默认值:服务器的时区)。例如
Asia/Tokyo
isISO
(boolean
,可选):如果为 true,则返回 ISO 8601 格式;否则,返回YYYY-MM-DD HH:mm:ss
。例如
true
返回:
text
:格式化的日期时间字符串。例如
2025-01-01 01:01:01
或2025-01-01T01:01:01+09:00
将日期时间转换为unix
将日期时间字符串转换为 Unix 时间戳(自纪元以来的毫秒数)。
参数:
time
(string
,必需):要转换的日期时间字符串。例如
2025-01-01 01:01:01
timezone
(string
,可选):要使用的时区(默认值:服务器的时区)。例如
Asia/Tokyo
返回:
text
:字符串形式的 Unix 时间戳。例如
1746627290000
获取当前日期时间
以YYYY-MM-DD HH:mm:ss
格式获取当前日期和时间。
参数:
timezone
(string
,可选):要使用的时区(默认值:服务器的时区)。例如
Asia/Tokyo
返回:
text
:格式化的当前日期和时间。例如
2025-01-01 01:01:01
获取当前日期时间
以 ISO 8601 格式获取当前日期和时间。
参数:
timezone
(string
,可选):要使用的时区(默认值:服务器的时区)。例如
Asia/Tokyo
返回:
text
:ISO 8601 格式的当前日期和时间。例如
2025-05-07T23:03:27+09:00
获取已用时间
计算两个日期时间字符串之间的差异。
参数:
from
(string
,必需):开始日期时间。例如
2025-01-01 01:01:01
to
(string
,必需):结束日期时间。例如
2025-01-02 02:02:02
unit
("millisecond" | "second" | "minute" | "hour" | "day" | "week" | "month" | "year"
,可选,默认值:"second"
):差异的单位。例如
"hour"
返回:
text
:指定单位中两个日期时间之间的差值。例如
3600
准备 mcp 服务器应用程序
1. 安装软件包
2. 构建
Mcp 检查器
获取当前日期时间
获取已用时间
VS 代码
在项目中管理时
.vscode/mcp.json
针对个人全球管理
~/Library/Application Support/Code/User/settings.json
示例提示
英文
英文
local-only server
The server can only run on the client's local machine because it depends on local resources.
Tools
用于时间操作任务的模型上下文协议服务器,使 AI 模型能够获取当前日期/时间并计算时间戳之间的持续时间。
Related MCP Servers
- AsecurityFlicenseAqualityA Model Context Protocol server that provides time and timezone conversion capabilities, enabling LLMs to get current time information and perform timezone conversions using IANA timezone names.
- AsecurityFlicenseAqualityA Model Context Protocol server that provides tools to get the current date and time in various formats, supporting different timezones and custom formatting options.Last updated -14
TimeCamp MCP Serverofficial
-securityFlicense-qualityA Model Context Protocol server that provides time tracking integration with TimeCamp, allowing AI assistants to create, retrieve, update, and delete time entries through natural language commands.Last updated -- AsecurityFlicenseAqualityA Model Context Protocol server that provides time and timezone conversion capabilities, enabling LLMs to get current time information and perform timezone conversions using IANA timezone names.Last updated -2