mcp-time-server
一个基于 MCP Python SDK v2 的最小 MCP Server,提供 get_current_time 工具。
- 可选 IANA 时区参数,例如
Asia/Shanghai - 省略参数时使用服务器本地时区
- 返回 ISO 8601 时间字符串,并附带时区名
- 非法时区通过
ToolError返回可读错误,便于模型自行纠正 - 协议版本:MCP
2025-11-25
快速开始
使用 uv 直接运行,无需手动安装:
{
"mcpServers": {
"time": {
"command": "uvx",
"args": ["mcp-time-server"]
}
}
}
或先安装再运行:
pip install mcp-time-server
{
"mcpServers": {
"time": {
"command": "mcp-time-server"
}
}
}
也可以作为模块启动:
python -m mcp_time_server
工具
get_current_time
获取当前时间。
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
timezone |
string |
否 | IANA 时区标识,如 Asia/Shanghai;省略时使用服务器本地时区 |
返回示例:
2026-11-24T21:30:00+08:00 (Asia/Shanghai)
不传 timezone 时,时区名取决于服务器本地设置,例如:
2026-11-24T21:30:00+08:00 (CST)
时区值会经过校验;传入 Asia/Shanghia 这类拼写错误时,工具返回:
无法识别的 IANA 时区 'Asia/Shanghia'。请传入如 'Asia/Shanghai' 的有效时区名。
本地开发
python -m venv .venv
.venv\Scripts\Activate.ps1
pip install -e ".[dev]"
# 以 stdio 启动
python -m mcp_time_server
# 使用 MCP Inspector 调试
mcp dev src/mcp_time_server/server.py
发布(维护者)
uv build
uvx twine check dist/*
uvx twine upload dist/*
上传时使用 PyPI API Token(用户名固定为 __token__)。
License
MIT
Metadata
Release files for mcp-time-server-1124agent 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| mcp_time_server_1124agent-0.1.0.tar.gz | 4.1 kB | Without provenance | Details for mcp_time_server_1124agent-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| mcp_time_server_1124agent-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for mcp_time_server_1124agent-0.1.0-py3-none-any.whl |
Total release size: 9.7 kB
Release files / mcp_time_server_1124agent-0.1.0.tar.gz
| Download URL | mcp_time_server_1124agent-0.1.0.tar.gz |
|---|---|
| Size | 4.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a0a9a9f0b08ee51063a50568beb9ee718fc626f5b0095380570c09a9720e513b
|
|
BLAKE2b-256 checksum How to use checksums |
d296f5eb664308bae4e2994805b379318b565d4e4761fdc278bf4999835be247
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.13.9 {"installer":{"name":"uv","version":"0.13.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Release files / mcp_time_server_1124agent-0.1.0-py3-none-any.whl
| Download URL | mcp_time_server_1124agent-0.1.0-py3-none-any.whl |
|---|---|
| Size | 5.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
4e3bd9659f97be45c294160ca25c9c9aa5a4798572ed58cad74882c0264ad856
|
|
BLAKE2b-256 checksum How to use checksums |
eec027ad741924fd4d7703c212b5dbab2bc30bf0ab45de120ee6dcd3d057a62c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.13.9 {"installer":{"name":"uv","version":"0.13.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Security for mcp-time-server-1124agent 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.