Skip to main content
Glama
time-tool-mcp

time-tool-mcp

by Noir415

time-tool-mcp

一个极简的 MCP (Model Context Protocol) 服务器,基于 FastMCP 构建,为大模型提供获取当前日期的能力。

大模型本身无法感知“今天是几号”,接入本服务后即可通过工具调用拿到准确的本地日期。

工具列表

工具

参数

返回

说明

get_today

无

str,如 2026-11-26

返回服务器所在时区的当前年月日,格式 YYYY-MM-DD

Related MCP server: Date MCP Server

环境要求

  • Python 3.10+

  • mcp >= 1.2.0, < 2(2.x 已将 FastMCP 重命名为 MCPServer,本项目暂不兼容)

安装

git clone https://github.com/Noir415/time_tool_mcp.git
cd time_tool_mcp
python -m venv .venv
source .venv/bin/activate   # Windows: .venv\Scripts\activate
pip install -r requirements.txt

运行

服务默认使用 stdio 传输,通常由 MCP 客户端自动拉起:

python server.py

可使用官方 Inspector 进行调试:

npx @modelcontextprotocol/inspector python server.py

客户端配置

将下面的配置加入客户端(Claude Desktop、Cursor、ChatMCP 等)的 MCP 配置文件,并把路径替换为实际路径(建议使用虚拟环境中的 Python 解释器绝对路径):

{
  "mcpServers": {
    "time-tool-mcp": {
      "command": "python",
      "args": ["/path/to/time_tool_mcp/server.py"]
    }
  }
}

项目结构

time_tool_mcp/
├── server.py          # MCP 服务入口
├── requirements.txt   # Python 依赖
├── chatmcp.yaml       # ChatMCP 发布/安装配置
└── README.md

说明

  • 日期取自运行服务的机器的系统本地时间。

  • 本服务不访问网络,不读写任何文件。

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    Related MCP Connectors

    Related MCP Servers

    • F
      license
      Not graded
      quality
      D
      maintenance
      Provides AI assistants with accurate current date and day of week information through simple tools for retrieving ISO-formatted dates and day names.
      -
    • A
      license
      A
      quality
      Not graded
      maintenance
      Provides AI assistants with real-time date, time, and timezone information, enabling them to access current temporal data, format dates, calculate day of week, and work with different timezones.
      4
      7 npm
      -
    • A
      license
      A
      quality
      D
      maintenance
      A Model Context Protocol server built with FastMCP that provides tools for retrieving the current local date and time. It allows LLMs to access precise temporal information directly from the host environment.
      9
      MIT
    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables MCP clients to retrieve the server's current local date in YYYY-MM-DD format through a no-argument tool over stdio.
      MIT