MCP Server Time
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@MCP Server Time what time is it right now in Tokyo?"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
MCP Server Time
一个简单易用的 Model Context Protocol (MCP) 时间服务器,用于在 Cursor、Claude Desktop 等支持 MCP 的应用中方便地获取当前时间信息。
✨ 功能特性
✅ 获取当前时间 - 支持多种格式(ISO、本地格式、时间戳)
✅ 时区支持 - 支持所有 IANA 时区标识符
✅ 详细信息 - 获取年、月、日、时、分、秒、星期等详细信息
✅ 轻量级 - 零配置,开箱即用
✅ 跨平台 - 支持 Windows、macOS、Linux
Related MCP server: Timezone MCP Server
📦 安装
方式一:使用 npx(推荐)
无需安装,直接使用:
# 在 MCP 配置中使用
npx -y @guanxiong/mcp-server-time方式二:全局安装
npm install -g @guanxiong/mcp-server-time方式三:本地安装
npm install @guanxiong/mcp-server-time🚀 快速开始
配置 Cursor
编辑 ~/.cursor/mcp.json(Windows: C:\Users\<用户名>\.cursor\mcp.json),添加以下配置:
{
"mcpServers": {
"time-server": {
"command": "npx",
"args": [
"-y",
"@guanxiong/mcp-server-time"
]
}
}
}配置 Claude Desktop
编辑 ~/Library/Application Support/Claude/claude_desktop_config.json(macOS)或 %APPDATA%\Claude\claude_desktop_config.json(Windows),添加:
{
"mcpServers": {
"time-server": {
"command": "npx",
"args": [
"-y",
"@guanxiong/mcp-server-time"
]
}
}
}重启应用
配置完成后,重启 Cursor 或 Claude Desktop 使配置生效。
🛠️ 可用工具
1. get_current_time
获取当前日期和时间。
参数:
timezone(可选): 时区标识符,例如Asia/Shanghai、UTC、America/New_Yorkformat(可选): 时间格式iso: ISO 8601 格式(默认)locale: 本地化格式timestamp: Unix 时间戳(毫秒)
示例:
用户:现在几点了?
AI:调用 get_current_time → 返回当前时间
用户:北京时间现在几点?
AI:调用 get_current_time,参数 timezone: "Asia/Shanghai"
用户:获取 UTC 时间戳
AI:调用 get_current_time,参数 format: "timestamp"2. get_time_info
获取详细的时间信息,包括年、月、日、时、分、秒、星期等。
参数:
timezone(可选): 时区标识符
返回信息:
year: 年份month: 月份(1-12)day: 日期(1-31)hour: 小时(0-23)minute: 分钟(0-59)second: 秒(0-59)weekday: 星期几timezone: 时区
示例:
用户:今天是几号?星期几?
AI:调用 get_time_info → 返回详细信息🌍 支持的时区
可以使用任何有效的 IANA 时区标识符,例如:
时区 | 标识符 | UTC 偏移 |
中国标准时间 |
| UTC+8 |
协调世界时 |
| UTC+0 |
美国东部时间 |
| UTC-5/-4 |
美国西部时间 |
| UTC-8/-7 |
英国时间 |
| UTC+0/+1 |
日本时间 |
| UTC+9 |
法国时间 |
| UTC+1/+2 |
📋 使用示例
示例 1:获取当前时间
用户:现在几点了?返回:
{
"time": "2025-12-27T09:38:01.938Z",
"timezone": "Asia/Shanghai",
"format": "iso"
}示例 2:获取指定时区时间
用户:纽约现在几点?返回:
{
"time": "2025-12-27T04:38:01.938Z",
"timezone": "America/New_York",
"format": "iso"
}示例 3:获取时间戳
用户:当前时间戳是多少?返回:
{
"time": "1735292625123",
"timezone": "Asia/Shanghai",
"format": "timestamp"
}示例 4:获取详细时间信息
用户:今天是几号?星期几?返回:
{
"year": 2025,
"month": 12,
"day": 27,
"hour": 17,
"minute": 38,
"second": 1,
"weekday": "星期五",
"timezone": "Asia/Shanghai"
}🔧 故障排除
工具不可用
确认已重启应用 - 配置更改后必须重启 Cursor/Claude Desktop
检查配置文件路径 - 确保配置文件路径正确
检查 JSON 格式 - 确保 JSON 格式正确,无语法错误
检查 Node.js 版本 - 需要 Node.js >= 18.0.0
服务器无法启动
检查 Node.js 版本:
node -v # 需要 >= 18.0.0手动测试服务器:
npx -y @guanxiong/mcp-server-time应该无输出(使用 stdio 通信)
检查网络连接 - 使用 npx 需要网络连接下载包
时区错误
确认时区标识符正确 - 使用标准 IANA 时区标识符
检查时区名称大小写 - 时区名称区分大小写
不指定时区 - 如果不指定,将使用系统默认时区
📚 相关资源
🤝 贡献
欢迎提交 Issue 和 Pull Request!
Fork 本仓库
创建特性分支 (
git checkout -b feature/AmazingFeature)提交更改 (
git commit -m 'Add some AmazingFeature')推送到分支 (
git push origin feature/AmazingFeature)开启 Pull Request
📝 更新日志
1.0.0 (2025-12-27)
✨ 初始版本发布
✅ 支持获取当前时间(多种格式)
✅ 支持时区设置
✅ 支持获取详细时间信息
📄 许可证
本项目采用 MIT 许可证。
🙏 致谢
Model Context Protocol - 提供 MCP 协议和 SDK
所有贡献者和用户
Made with ❤️ for the MCP community
Available Tools
2 toolsget_current_timeC
获取当前日期和时间
Inputs: format, timezone.
get_time_infoC
获取详细的时间信息,包括年、月、日、时、分、秒等
Inputs: timezone.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 2 tools
Both tools appear to return the current time, with only vague differentiation between 'detailed time information' and 'current date and time'. An agent could easily choose either one without understanding the intended distinction.
Both names use the same get_ prefix and snake_case convention, making the pattern predictable. The noun phrases differ slightly in structure, but the overall naming is consistent.
Two tools is thin for a server, especially since they overlap heavily and could likely be consolidated into one. The count is borderline rather than clearly appropriate.
The basic operation of retrieving the current time is covered, but common time-related needs such as timezone specification, formatting options, or timestamp conversion are absent. The surface is usable but notably incomplete for a general time server.
Maintenance
Related MCP Connectors
A real clock for AI agents: current time, timezone conversion, and DST facts from the IANA tzdb.
Current time, timezone conversion & date math for AI agents. On Cloudflare Workers.
Time and date math for AI agents: Unix timestamp conversion, DST-correct time zone conversion, durations, epoch arithmetic, cron schedules, and holiday countdowns. Eight tools, no key.
Current time, time differences, DST changes and time conversion for any city or IANA time zone.
Related MCP Servers
- AlicenseCqualityDmaintenanceProvides current time and date information with timezone support and multiple formatting options. Enables AI assistants to answer time-related queries in different timezones with detailed temporal information.2MIT
- FlicenseNot gradedqualityDmaintenanceEnables LLMs to get current time information for any timezone worldwide, including available regions, cities, and ISO 8601 formatted timestamps with timezone offsets.8-
- AlicenseAqualityDmaintenanceProvides LLMs with current date and time information across any timezone, with configurable defaults and support for IANA timezone identifiers.13Apache 2.0
- AlicenseAqualityNot gradedmaintenanceProvides AI assistants with real-time date, time, and timezone information, enabling them to access current temporal data, format dates, calculate day of week, and work with different timezones.47 npm-