AlexLIAOPOLY/Calculator_MCP_server
If you are the rightful owner of Calculator_MCP_server and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.
The MCP Time Service is a tool designed for AI assistants, enabling multi-timezone queries and time-related operations using the Model Context Protocol (MCP).
MCP Time Service
基于Model Context Protocol (MCP)的时间服务工具,支持多时区时间查询,专为AI助手设计。
功能特性
多时区时间查询 - 获取世界各地的当前时间 中文时区别名 - 支持"北京"、"上海"等中文别名 时间格式化 - 多种时间格式显示 时间计算 - 时区转换和时间差计算 时区列表 - 查看所有支持的时区
支持的工具
本MCP服务提供以下6个时间相关工具:
1. get_current_time - 获取当前时间
获取指定时区的当前时间
2. convert_timezone - 时区转换
将时间从一个时区转换到另一个时区
3. format_time - 时间格式化
按指定格式显示时间
4. calculate_time_difference - 计算时间差
计算两个时间之间的差值
5. list_timezones - 时区列表
显示所有支持的时区
6. get_timezone_info - 时区信息
获取特定时区的详细信息
安装
npm install -g mcp-time-service-liaowang
使用方法
Claude Desktop配置
在Claude Desktop的配置文件中添加:
{
"mcpServers": {
"time-service": {
"command": "npx",
"args": ["-y", "mcp-time-service-liaowang"]
}
}
}
配置文件位置
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%/Claude/claude_desktop_config.json - Linux:
~/.config/claude/claude_desktop_config.json
使用示例
配置完成后,在Claude Desktop中可以这样使用:
查询当前时间:
现在北京时间是几点?
时区转换:
帮我把北京时间2024年1月15日下午3点转换为纽约时间
时间格式化:
请用ISO 8601格式显示当前的东京时间
开发
本地开发
# 克隆仓库
git clone https://github.com/liaowang/mcp-time-service.git
cd mcp-time-service
# 安装依赖
npm install
# 开发模式
npm run dev
# 构建
npm run build
# 测试
npm test
项目结构
mcp-time-service/
├── src/
│ └── index.ts # 主要服务器实现
├── dist/ # 编译输出
├── tests/ # 测试文件
├── package.json # 项目配置
├── tsconfig.json # TypeScript配置
└── README.md # 项目文档
技术规格
- Node.js版本: >= 16.0.0
- 协议: Model Context Protocol (MCP)
- 传输方式: stdio
- 语言: TypeScript
- 许可证: MIT
更新日志
v1.0.7 (2025-01-07)
- 新增时区信息查询功能
- 优化错误处理机制
- 改进中文时区别名支持
- 修复时间格式化问题
v1.0.6 (2025-01-06)
- 添加更多时区支持
- 优化性能
- 修复已知bug
v1.0.0 (2025-01-01)
- 首次发布
- 基础时间查询功能
- MCP协议支持
贡献
欢迎提交Issue和Pull Request!
开发指南
- Fork此仓库
- 创建feature分支:
git checkout -b feature/amazing-feature - 提交更改:
git commit -m 'Add amazing feature' - 推送到分支:
git push origin feature/amazing-feature - 创建Pull Request
许可证
本项目使用MIT许可证 - 查看 文件了解详情
联系方式
- 作者: liaowang
- GitHub: github.com/liaowang/mcp-time-service
- NPM: npmjs.com/package/mcp-time-service-liaowang
注意: 本工具需要Node.js 16.0.0或更高版本。确保Claude Desktop已正确配置MCP服务器。