1.0.0 • Published 11 months ago

@admin_mcp/time-server v1.0.0

Weekly downloads
-
License
MIT
Repository
-
Last release
11 months ago

Time MCP Server

一个用于处理时间相关操作的 Model Context Protocol (MCP) 服务器。

功能

  • 获取当前时间(支持多种格式)
  • 时区转换
  • 时间间隔计算
  • 简单的自然语言时间处理

安装

npm install @admin/mcp-time-server

配置

在您的 mcp.json 中添加:

{
  "mcpServers": {
    "time": {
      "command": "npx",
      "args": [
        "-y",
        "@admin/mcp-time-server"
      ]
    }
  }
}

API

getCurrentTime

获取当前时间

{
  "method": "getCurrentTime",
  "params": {
    "format": "YYYY-MM-DD HH:mm:ss"
  }
}

convertTimezone

时区转换

{
  "method": "convertTimezone",
  "params": {
    "time": "2025-04-11T10:00:00Z",
    "targetTimezone": "Asia/Shanghai",
    "format": "YYYY-MM-DD HH:mm:ss"
  }
}

calculateDuration

计算时间间隔

{
  "method": "calculateDuration",
  "params": {
    "start": "2025-04-11T10:00:00Z",
    "end": "2025-04-12T10:00:00Z",
    "unit": "hours"
  }
}

parseNaturalLanguage

自然语言时间处理

{
  "method": "parseNaturalLanguage",
  "params": {
    "text": "tomorrow"
  }
}

许可证

MIT

1.0.0

11 months ago