Time MCP Server

Time MCP Server

site icon
2025.04.11 0
JavaScript时间服务其它
Time MCP Server 是一个基于 Model Context Protocol (MCP) 的服务,主要用于提供当前时间的获取功能。它支持多种时间格式和时区设置,适用于需要时间服务的各种场景。
View on GitHub

Overview

基本能力

产品定位

Time MCP Server 是一个时间服务工具,提供当前时间的获取功能,支持多种时间格式和时区设置。

核心功能

  • 获取当前时间,支持 ISO、locale 和 UNIX timestamp 格式
  • 可指定时区显示时间

适用场景

  • 需要获取当前时间的应用程序
  • 需要跨时区时间显示的系统
  • 时间相关的自动化任务

工具列表

get_current_time

  • 能力: 返回指定格式和时区的当前时间
  • 参数:
  • format (可选): 时间格式,可选 "iso", "locale", 或 "unix",默认为 "locale"
  • timezone (可选): 时区字符串(如 "Asia/Tokyo", "America/New_York"),默认为系统时区

常见问题解答

无明确常见问题解答部分

使用教程

使用依赖

  • Node.js 环境

安装教程

# 克隆仓库
git clone <repository-url>
cd example-mcp-server

# 安装依赖
npm install

# 构建项目
npm run build

调试方式

# 启动服务器
npm start

# 开发模式(带热重载)
npm run dev

MCP 配置

在 MCP 客户端配置文件中添加以下内容:

{
  "mcpServers": {
    "time": {
      "command": "node",
      "args": ["/path/to/example-mcp-server/dist/index.js"],
      "env": {}
    }
  }
}

许可证

该项目遵循 ISC 开源许可条款。