Time MCP
Click on "Install 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., "@Time MCPconvert 10:00 AM Beijing time to New York time"
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.
Time MCP
一个时间处理的 MCP (Model Context Protocol) 工具,基于 Python + FastMCP 构建。
功能特性
工具 | 说明 |
| 获取当前时间 |
| 时间计算(加减年/月/日/时/分/秒) |
| 时区转换 |
| 列出可用时区 |
核心特性
🕐 默认使用北京时间(Asia/Shanghai)
🔢 时间戳自动识别(10 位秒级 / 13 位毫秒级)
📅 支持多种时间输入格式
🌍 支持全球时区转换
Related MCP server: DateTime MCP Server
安装
使用 uv(推荐)
git clone https://github.com/xbsheng/time-mcp.git
cd time-mcp
uv sync使用 pip
pip install fastmcp python-dateutil pytz使用方法
启动 MCP 服务
服务默认使用 HTTP 方式运行在 8000 端口:
uv run python src/server.py启动后,MCP 服务将在 http://localhost:8000 上监听。
在 Cursor 中配置
在 ~/.cursor/mcp.json 中添加:
{
"mcpServers": {
"time-mcp": {
"url": "http://localhost:8000/mcp"
}
}
}或者使用命令行方式(无需单独启动服务):
{
"mcpServers": {
"time-mcp": {
"command": "uv",
"args": ["--directory", "/path/to/time-mcp", "run", "python", "src/server.py"]
}
}
}在 Claude Desktop 中配置
在 Claude Desktop 配置文件中添加:
{
"mcpServers": {
"time-mcp": {
"command": "uv",
"args": ["--directory", "/path/to/time-mcp", "run", "python", "src/server.py"]
}
}
}工具详细说明
get_current_time
获取当前时间,返回多种格式。
参数:
参数 | 类型 | 默认值 | 说明 |
| string | Asia/Shanghai | 时区 |
| string | - | 自定义输出格式 |
返回示例:
{
"datetime": "2026-01-12 22:00:00",
"date": "2026-01-12",
"time": "22:00:00",
"timestamp": 1768226400,
"timestamp_ms": 1768226400000,
"timezone": "Asia/Shanghai",
"iso": "2026-01-12T22:00:00+08:00",
"weekday": "Monday",
"weekday_cn": "周一"
}time_calculate
时间计算,对指定时间进行加减运算。
参数:
参数 | 类型 | 默认值 | 说明 |
| string/int | 当前时间 | 基准时间(时间戳或日期字符串) |
| int | 0 | 加减年数 |
| int | 0 | 加减月数 |
| int | 0 | 加减天数 |
| int | 0 | 加减小时数 |
| int | 0 | 加减分钟数 |
| int | 0 | 加减秒数 |
| string | Asia/Shanghai | 时区 |
使用示例:
# 当前时间加7天
time_calculate(days=7)
# 指定时间减1个月
time_calculate(base_time="2026-01-01", months=-1)
# 时间戳加8小时
time_calculate(base_time=1704067200, hours=8)timezone_convert
时区转换,将时间转换为指定时区。
参数:
参数 | 类型 | 默认值 | 说明 |
| string/int | - | 输入时间 |
| string | Asia/Shanghai | 源时区 |
| string | - | 目标时区 |
使用示例:
# 北京时间转纽约时间
timezone_convert(time="2026-01-12 12:00:00", to_tz="America/New_York")list_timezones
列出可用时区。
参数:
参数 | 类型 | 默认值 | 说明 |
| string | - | 按区域筛选(如 Asia, America, Europe) |
项目结构
time-mcp/
├── src/
│ ├── __init__.py
│ └── server.py # MCP 服务主文件
├── pyproject.toml # 项目配置
├── uv.lock # 依赖锁定
├── LICENSE
└── README.md技术栈
Python 3.11+
FastMCP >= 2.0.0 - MCP 服务框架
python-dateutil - 时间解析
pytz - 时区支持
开源协议
本项目采用 MIT License 开源协议。
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseAqualityDmaintenanceA Model Context Protocol server for time manipulation tasks, enabling AI models to get the current date/time and calculate duration between timestamps.Last updated72MIT
- AlicenseBqualityDmaintenanceA 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 updated41191MIT
- 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.Last updated2MIT
- AlicenseBqualityDmaintenanceGives large language models time awareness capabilities through various time-related functions including current time retrieval, timezone conversion, and relative time calculations.Last updated61,466MIT
Related MCP Connectors
A real clock for AI agents: current time, timezone conversion, and DST facts from the IANA tzdb.
Timezone MCP — wraps WorldTimeAPI (free, no auth)
Timezone tools for agents: convert, world clock, offset, lookup, date math, holidays, slots. x402
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/xbsheng/time-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server