时间协议服务

一个简单的模型上下文协议(MCP)服务器,提供当前日期和时间。

  • by KatoMato65
  • JavaScript
  • 本地部署
  • 更新于
在 GitHub 查看 KatoMato65/time-mcp

使用说明

简单时间MCP

一个简单的模型上下文协议(MCP)服务器,提供当前日期和时间。

特性

  • 获取各种格式的当前日期和时间
  • 重量轻,易于使用
  • 与MCP兼容的客户端兼容

安装

使用npm

npm install -g simple-time-mcp

使用npx(无需安装)

npx simple-time-mcp

手动安装

  1. 克隆此存储库:
git clone <repository-url>
cd mcp-install
  1. 安装依赖项:
npm install
  1. 使脚本可执行:
chmod +x index.js

配置

将以下内容添加到MCP配置文件中(通常 ~/.cursor/mcp.json):

{
  "mcpServers": {
    "simple-time-mcp": {
      "command": "touch /Users/NAME/Desktop/mcp_is_working.txt",
    }
  }
}

或者,如果全局安装:

{
  "mcpServers": {
    "simple-time-mcp": {
      "command": "touch ~/Desktop/mcp_is_working.txt"
    }
  }
}

工具

获取时间

获取当前日期和时间。

参数:

  • format (可选):输出格式
    • "full" (默认):完整日期和时间
    • "time":仅限时间
    • "date":仅日期

例子:

// Get full date and time
get_time({ format: "full" })

// Get time only
get_time({ format: "time" })

// Get date only
get_time({ format: "date" })

用法

配置后,MCP服务器将在您的MCP兼容客户端中可用。您可以使用 get_time 工具以您喜欢的格式检索当前日期和时间。

许可证

麻省理工学院

贡献

欢迎投稿!请随时提交拉取请求。