samay58
服务介绍
time-mcp
一个提供实时时区感知日期和时间信息的 Claude 模型配置协议 (MCP) 服务器。
特性
- 获取任何 IANA 时区的当前时间
- 通过 MCP 轻松与 Claude AI 集成
- 使用 Python 的
zoneinfo模块提供全面的时区支持 - 以 ISO 格式返回简单的 JSON 响应
安装
bash
克隆仓库
git clone https://github.com/yourusername/time-mcp.git
cd time-mcp
设置虚拟环境(使用 uv)
uv venv
source .venv/bin/activate
安装包
pip install -e .
使用
运行服务器
bash
python -m src.time_mcp.server
这将在本地启动 MCP 服务器,使时间工具对 Claude 可用。
可用工具
get_current_time: 返回指定时区的当前时间- 参数:
timezone(字符串) - 任何有效的 IANA 时区(例如,"America/New_York", "Europe/London", "Asia/Tokyo") - 默认值: 如果未指定时区,则为 "UTC"
- 参数:
开发
bash
运行测试
pytest tests/
代码检查
ruff check .
代码格式化
ruff format .
依赖
- Python 3.10+
- MCP 库
许可证
MIT