MCP 时间服务器是一款基于 Python 的高级微服务,它能提供跨时区的时间相关实用工具。借助该服务器,用户可轻松获取当前时间,还能在不同全球时区之间进行时间转换。
chuk-mcp-time-server
from chuk_mcp_time_server.main import main
if __name__ == "__main__":
main()
pip install chuk-mcp-time-server
git clone
cd chuk-mcp-time-server
python -m venv venv
source venv/bin/activate # 在 Windows 上使用 `venv\Scripts\activate`
pip install . # 以可编辑模式安装包
要设置开发环境:
pip install .[dev] # 使用开发依赖项安装包
# 输入:
# - `timezone`: IANA 时区名称(例如 'America/New_York')
# 返回:
# - 指定时区的当前时间
# - 时区详细信息
# - 夏令时 (DST) 状态
get_current_time('Europe/London')
# 输入:
# - `source_timezone`: 源时区(IANA 格式)
# - `time`: 时间,格式为 HH:MM(24 小时制)
# - `target_timezone`: 目标时区(IANA 格式)
# 返回:
# - 源时间详细信息
# - 目标时间详细信息
# - 时区之间的时差
convert_time('America/New_York', '14:30', 'Europe/Paris')
属性 | 详情 |
---|---|
版本 | 0.1.1 |
Python 兼容性 | Python 3.11+ |
NO_BOOTSTRAP
:设置以禁用组件引导pytest
git checkout -b feature/AmazingFeature
)git commit -m 'Add some AmazingFeature'
)git push origin feature/AmazingFeature
)本项目采用 MIT 许可证。