MCP DateTime
MCP 日期时间
模型上下文协议 (MCP) 服务器的 TypeScript 实现,为代理系统和聊天 REPL 提供日期时间和时区信息。
概述
MCP DateTime 是一个简单的服务器,它实现了模型上下文协议 (MCP Protocol) ,用于向 AI 代理和聊天界面提供日期时间和时区信息。它允许 AI 系统:
获取本地系统时区的当前时间
获取任何有效时区的当前时间
列出所有可用的时区
通过 URI 资源访问时区信息
Related MCP server: Time Tools MCP Server
安装
来自 npm
npm install -g mcp-datetime从源头
git clone https://github.com/odgrmi/mcp-datetime.git
cd mcp-datetime
npm install
npm run build用法
命令行
MCP DateTime 可以以两种模式运行:
1. 标准I/O模式(默认)
此模式非常适合通过标准输入/输出与支持 MCP 协议的 AI 系统集成:
mcp-datetime2. 服务器发送事件(SSE)模式
此模式启动一个为 MCP 协议提供 SSE 传输的 HTTP 服务器:
mcp-datetime --sse您还可以指定自定义端口和 URI 前缀:
mcp-datetime --sse --port=8080 --prefix=/api/datetime环境变量
PORT:设置 SSE 模式的端口(默认值:3000)URI_PREFIX:设置 SSE 模式的 URI 前缀(默认值:无)
可用工具
MCP DateTime 提供以下工具:
get-current-time
返回系统本地时区的当前时间。
get-current-timezone
返回当前系统时区。
get-time-in-timezone
返回指定时区的当前时间。
参数:
timezone:获取当前时间的时区(例如“America/New_York”)
list-timezones
返回所有可用时区的列表。
资源 URI
MCP DateTime 还通过资源 URI 提供对时区信息的访问:
datetime://{timezone}
返回指定时区的当前时间。
例如: datetime://America/New_York
datetime://list
返回所有可用时区的列表。
常见时区
以下常见时区始终可用:
世界标准时间
欧洲/伦敦
欧洲/巴黎
欧洲/柏林
美国/纽约
美国/芝加哥
美国/丹佛
美国/洛杉矶
亚洲/东京
亚洲/上海
亚洲/加尔各答
澳大利亚/悉尼
太平洋/奥克兰
SSE 终端节点
在 SSE 模式下运行时,以下端点可用:
/sse:SSE 连接端点/message:客户端到服务器通信的消息端点/info:基本服务器信息
如果指定了 URI 前缀,它将被添加到所有端点的前面。
与人工智能系统集成
MCP DateTime 可以与支持模型上下文协议 (MCP Protocol) 的 AI 系统集成。这使得 AI 代理能够访问准确的时区和日期时间信息。
发展
先决条件
Node.js 14.16 或更高版本
npm
设置
git clone https://github.com/odgrim/mcp-datetime.git
cd mcp-datetime
npm install建造
npm run build以开发模式运行
npm run dev # Standard I/O mode
npm run dev:sse # SSE mode执照
该项目根据 Mozilla 公共许可证 2.0 获得许可 - 有关详细信息,请参阅LICENSE文件。
Available Tools
4 toolsget-current-timeB
Get the current time in the configured local timezone
Inputs: no named parameters.
get-current-timezoneB
Get the current system timezone
Inputs: no named parameters.
get-time-in-timezoneC
Get the current time in a specific timezone
Inputs: timezone (required).
list-timezonesB
List all available timezones
Inputs: no named parameters.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 4 tools
Every tool has a clearly distinct purpose with no ambiguity: get-current-time retrieves local time, get-current-timezone returns the system timezone, get-time-in-timezone fetches time for a specified zone, and list-timezones enumerates available zones. The descriptions make it impossible to confuse these tools.
All tool names follow a consistent verb_noun pattern with hyphens (e.g., get-current-time, list-timezones). This predictable naming scheme enhances readability and agent usability without any deviations.
With 4 tools, the server is well-scoped for handling date/time operations. Each tool earns its place by covering core functionalities: retrieving time, managing timezones, and listing options, making the count appropriate for the domain.
The tool surface provides complete coverage for basic date/time operations: it supports getting current time (locally and in specific zones), accessing timezone information, and listing all available zones. There are no obvious gaps for this focused purpose.
Maintenance
Related MCP Connectors
Current time, timezone conversion & date math for AI agents. On Cloudflare Workers.
A real clock for AI agents: current time, timezone conversion, and DST facts from the IANA tzdb.
A time server that keeps your AI honest about time. Real clock + drift guard, zero dependencies.
MCP server for time in cities around the world, time zones, DST, conversion, and meetings.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceA TypeScript server that provides time-related tools through the Model Context Protocol, allowing users to get current time in various timezones and convert times between different IANA timezones.MIT
- AlicenseAqualityDmaintenanceA Model Context Protocol server for time manipulation tasks, enabling AI models to get the current date/time and calculate duration between timestamps.72MIT
- AlicenseBqualityDmaintenanceA 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.2MIT
- AlicenseNot gradedqualityDmaintenanceThe Time MCP Server is a Model Context Protocol (MCP) server that provides AI assistants and other MCP clients with standardized tools to perform time and date-related operations. This server acts as a bridge between AI tools and a robust time-handling back72 npm25MIT