Back to MCP directory
publicPublicdnsLocal runtime

timeservice-mcp

一个简单的MCP服务器,提供当前日期和时间查询功能,支持多种格式输出。

article

README

🚀 简单时间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"
    }
  }
}

工具

get_time

获取当前日期和时间。

参数:

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

示例:

// 获取完整日期和时间
get_time({ format: "full" })

// 仅获取时间
get_time({ format: "time" })

// 仅获取日期
get_time({ format: "date" })

使用方法

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

📄 许可证

本项目采用MIT许可证。

🤝 贡献指南

欢迎贡献代码!请随时提交拉取请求。

help

Runtime guide

cloud

Hosted runtime

Hosted servers run from a provider-managed environment. You usually connect the MCP client to the hosted endpoint or follow the provider's authorization flow, without keeping a local process alive

  1. Open provider connection page
  2. Authorize or copy endpoint
  3. Connect from your MCP client
terminal

Local runtime / other methods

Local servers run on your own machine or infrastructure. You normally copy the server_config into your MCP client, install the required package, and provide env variables from env_schema when needed

  1. Copy server_config
  2. Install required package
  3. Fill env variables and restart client