时间感知服务器

一个为LLM提供时间感知能力的模型上下文协议(MCP)服务器。

  • by yokingma
  • JavaScript
  • 本地部署
  • 72 星标
  • 更新于
在 GitHub 查看 yokingma/time-mcp

使用说明

🚀 时间MCP服务器:赋予LLM时间感知能力

一种模型上下文协议(MCP)服务器实现,允许LLM具有时间感知能力。

工具

  • current_time:获取当前时间(UTC和当地时间)
  • relative_time:获取相对时间
  • get_timestamp:获取时间的时间戳
  • days_in_month:获取月份中的天数
  • convert_time:在时区之间转换时间
  • get_week_year:获取周和ISO一年中的周

安装

通过Smithery安装

通过以下方式自动安装Claude Desktop的time mcp 铁匠铺:

npx -y @smithery/cli install @yokingma/time-mcp --client claude

手动安装(可选)

npm install -g time-mcp

使用npx

npx -y time-mcp

在Claude代码上运行

要将时间mcp添加到Claude代码中,请使用以下命令:

claude mcp add time-mcp -- npx -y time-mcp

要验证安装:

claude mcp list

您应该看到时间mcp与✓ 连接状态。

Claude代码中的用法

安装后,您可以在与Claude Code的对话中使用time mcp工具。例如:

  • “现在几点了?”
  • “将纽约时间下午2:00转换为东京时间”
  • “这个月有几天?”
  • “现在是一年中的哪一周?”

时间mcp服务器将自动向Claude提供准确的时间信息。

在游标上运行

你的 mcp.json 文件看起来像这样:

{
  "mcpServers": {
    "time-mcp": {
      "command": "npx",
      "args": ["-y", "time-mcp"]
    }
  }
}

在风帆上跑步

将此添加到您的 ./codeium/windsurf/model_config.json 文件:

{
  "mcpServers": {
    "time-mcp": {
      "command": "npx",
      "args": ["-y", "time-mcp"]
    }
  }
}

许可证

MIT许可证-请参阅 许可证 文件以获取详细信息。