Skip to main content
Glama

Time Tools MCP Server

用于时间操作的 MCP 服务器

用于时间操作的动态 MCP 服务器管理服务。

MCP 工具

该服务器通过模型上下文协议 (MCP) 提供几个与时间相关的工具。


获取时区

获取服务器的当前时区。

  • 返回:
    • text :时区字符串。
      • 例如Asia/Tokyo

获取unix时间

获取当前 Unix 时间戳(自纪元以来的秒数)。

  • 返回:
    • text :字符串形式的 Unix 时间戳。
      • 例如1746627290

将unix转换为datetime

将 Unix 时间戳转换为格式化的日期时间字符串。

  • 参数:
    • unixtimenumber ,必需):要转换的 Unix 时间戳。
      • 例如1746627290
    • timezonestring ,可选):要使用的时区(默认值:服务器的时区)。
      • 例如Asia/Tokyo
    • isISOboolean ,可选):如果为 true,则返回 ISO 8601 格式;否则,返回YYYY-MM-DD HH:mm:ss
      • 例如true
  • 返回:
    • text :格式化的日期时间字符串。
      • 例如2025-01-01 01:01:012025-01-01T01:01:01+09:00

将日期时间转换为unix

将日期时间字符串转换为 Unix 时间戳(自纪元以来的毫秒数)。

  • 参数:
    • timestring ,必需):要转换的日期时间字符串。
      • 例如2025-01-01 01:01:01
    • timezonestring ,可选):要使用的时区(默认值:服务器的时区)。
      • 例如Asia/Tokyo
  • 返回:
    • text :字符串形式的 Unix 时间戳。
      • 例如1746627290000

获取当前日期时间

YYYY-MM-DD HH:mm:ss格式获取当前日期和时间。

  • 参数:
    • timezonestring ,可选):要使用的时区(默认值:服务器的时区)。
      • 例如Asia/Tokyo
  • 返回:
    • text :格式化的当前日期和时间。
      • 例如2025-01-01 01:01:01

获取当前日期时间

以 ISO 8601 格式获取当前日期和时间。

  • 参数:
    • timezonestring ,可选):要使用的时区(默认值:服务器的时区)。
      • 例如Asia/Tokyo
  • 返回:
    • text :ISO 8601 格式的当前日期和时间。
      • 例如2025-05-07T23:03:27+09:00

获取已用时间

计算两个日期时间字符串之间的差异。

  • 参数:
    • fromstring ,必需):开始日期时间。
      • 例如2025-01-01 01:01:01
    • tostring ,必需):结束日期时间。
      • 例如2025-01-02 02:02:02
    • unit"millisecond" | "second" | "minute" | "hour" | "day" | "week" | "month" | "year" ,可选,默认值: "second" ):差异的单位。
      • 例如"hour"
  • 返回:
    • text :指定单位中两个日期时间之间的差值。
      • 例如3600

准备 mcp 服务器应用程序

1. 安装软件包

pnpm install

2. 构建

pnpm build

Mcp 检查器

检查器 - 模型上下文协议

pnpm inspect

获取当前日期时间

获取已用时间

VS 代码

在项目中管理时

.vscode/mcp.json

{ "servers": { "time-tools": { "command": "node", "args": ["/ABSOLUTE/PATH/TO/PARENT/FOLDER/build/index.js"] } } }

针对个人全球管理

~/Library/Application Support/Code/User/settings.json

{ "mcp": { "servers": { "time-tools": { "command": "node", "args": ["/ABSOLUTE/PATH/TO/PARENT/FOLDER/build/index.js"] } } } }

示例提示

英文

## Overview - Please perform the following tasks - Perform the following tasks and measure the time it takes to perform the tasks. - Please follow the time tracking requirements for the measurement method ## Tasks - Create the src directory - Create an empty file in it - Name the file index.ts ## Time tracking requirements 1. retrieve and display the current time before the task starts 2. 2. retrieve and display the current time after the task is completed 3. 3. retrieve and display the elapsed time from the start and end time of the task 4. finally display the following table 4. finally display in the following table format |item|record| |:---|:---| |start time|<enter result>| |end time|<enter result>| |elapsed time|<enter result>|

英文

## 概要 - 以下のタスクを実行してください - タスク実行に要した時間も計測します - 計測の方法はタイムトラッキング要件にしたがってください ## タスク - src ディレクトリを作成する - その中に空のファイルを作成する - 作成するファイル名は index.ts とする ## タイムトラッキング要件 1. タスク開始前の現在時間を取得して表示する 2. タスク終了後の現在時間を取得して表示する 3. タスクの開始時と終了時の時間から経過時間を取得して表示する 4. 最終的に以下の表形式で表示してください |項目|記録| |:---|:---| |開始時間|<結果を入力>| |終了時間|<結果を入力>| |経過時間|<結果を入力>|
Install Server
A
security – no known vulnerabilities
A
license - permissive license
A
quality - confirmed to work

local-only server

The server can only run on the client's local machine because it depends on local resources.

用于时间操作任务的模型上下文协议服务器,使 AI 模型能够获取当前日期/时间并计算时间戳之间的持续时间。

  1. MCP 工具
    1. 获取时区
    2. 获取unix时间
    3. 将unix转换为datetime
    4. 将日期时间转换为unix
    5. 获取当前日期时间
    6. 获取当前日期时间
    7. 获取已用时间
  2. 准备 mcp 服务器应用程序
    1. 安装软件包
    2. 构建
  3. Mcp 检查器
    1. VS 代码
      1. 在项目中管理时
      2. 针对个人全球管理
    2. 示例提示

      Related MCP Servers

      • -
        security
        F
        license
        -
        quality
        A versatile Model Context Protocol server that enables AI assistants to manage calendars, track tasks, handle emails, search the web, and control smart home devices.
        Last updated -
        2
        Python
        • Apple
        • Linux
      • A
        security
        F
        license
        A
        quality
        A Model Context Protocol server that enables AI assistants to interact with Bluesky/ATProtocol, providing authentication, timeline access, post creation, and social features like likes and follows.
        Last updated -
        18
        10
        TypeScript
        • Apple
        • Linux
      • -
        security
        F
        license
        -
        quality
        A Model Context Protocol server that provides persistent task management capabilities for AI assistants, allowing them to create, update, and track tasks beyond their usual context limitations.
        Last updated -
        1
        TypeScript
      • -
        security
        A
        license
        -
        quality
        A Model Context Protocol server that enables AI assistants to manage meeting data, including creating meeting bots, searching transcripts, and organizing calendar events.
        Last updated -
        15
        TypeScript
        MIT License
        • Apple

      View all related MCP servers

      MCP directory API

      We provide all the information about MCP servers via our MCP API.

      curl -X GET 'https://glama.ai/api/mcp/v1/servers/t-shiratori/time-tools-mcp-server'

      If you have feedback or need assistance with the MCP directory API, please join our Discord server