Sponsored by Deepsite.site

本地时间获取服务

Created By
panpeter20247 months ago
为 LLM 提供了获取“当前”时间、日期、星期等信息的能力。有了它,LLM 回答“现在”、“最近”相关问题时,终于可以获得真正的“现在”——不再停留在模型训练的过去!
Content

DateServer MCP 服务

本项目为基于 FastMCP 的本地日期与时间工具服务,支持 MCP 协议,可在本地运行并通过 Cherry Studio 等 MCP 客户端调用。


部署与使用说明

1. 环境准备

  • 推荐 Python 3.8 及以上版本
  • 建议使用虚拟环境隔离依赖

2. 克隆代码

git clone https://github.com/panpeter2024/date_mcp
cd date_mcp

3. 创建虚拟环境并安装依赖

macOS/Linux

python3 -m venv venv
source venv/bin/activate
pip install fastmcp

Windows

python -m venv venv
venv\Scripts\activate
pip install fastmcp

4. 启动服务

  • macOS/Linux:
    nohup venv/bin/python server_date.py > mcp.log 2>&1 &
    
  • Windows:
    python server_date.py
    

5. 在 Cherry Studio 配置 MCP 服务

  • 服务名称:本地日期服务
  • MCP服务地址:http://127.0.0.1:9000/sse
  • 传输方式:SSE
  • 认证/Key:留空

6. 常用命令

  • 查看日志:
    • macOS/Linux:
      tail -f mcp.log
      
    • Windows:
      type mcp.log
      
  • 停止服务:
    • macOS/Linux:
      ps aux | grep server_date.py
      kill <进程号>
      
    • Windows: 在任务管理器中结束 python.exe 进程,或关闭命令行窗口。

工具列表

  • get_current_date:获取当前日期(YYYY-MM-DD)
  • get_current_time:获取当前时间(HH:MM:SS)
  • get_current_weekday:获取今天是星期几(中文)
  • get_current_timestamp:获取当前Unix时间戳(秒)
  • get_current_iso_datetime:获取当前日期和时间(ISO 8601 格式)

说明

  • 本服务仅在本地运行,无需公网暴露。
  • 如需自定义端口或扩展功能,请修改 server_date.py

Server Config

{
  "mcpServers": {
    "dateserver": {
      "command": "python",
      "args": [
        "server_date.py"
      ],
      "setup": [
        "python -m venv venv",
        "venv\\Scripts\\activate || source venv/bin/activate",
        "pip install -r requirements.txt"
      ],
      "env": {}
    }
  }
}
Recommend Servers
TraeBuild with Free GPT-4.1 & Claude 3.7. Fully MCP-Ready.
EdgeOne Pages MCPAn MCP service designed for deploying HTML content to EdgeOne Pages and obtaining an accessible public URL.
TimeA Model Context Protocol server that provides time and timezone conversion capabilities. This server enables LLMs to get current time information and perform timezone conversions using IANA timezone names, with automatic system timezone detection.
AiimagemultistyleA Model Context Protocol (MCP) server for image generation and manipulation using fal.ai's Stable Diffusion model.
Zhipu Web SearchZhipu Web Search MCP Server is a search engine specifically designed for large models. It integrates four search engines, allowing users to flexibly compare and switch between them. Building upon the web crawling and ranking capabilities of traditional search engines, it enhances intent recognition capabilities, returning results more suitable for large model processing (such as webpage titles, URLs, summaries, site names, site icons, etc.). This helps AI applications achieve "dynamic knowledge acquisition" and "precise scenario adaptation" capabilities.
Playwright McpPlaywright MCP server
Amap Maps高德地图官方 MCP Server
MCP AdvisorMCP Advisor & Installation - Use the right MCP server for your needs
ChatWiseThe second fastest AI chatbot™
Visual Studio Code - Open Source ("Code - OSS")Visual Studio Code
BlenderBlenderMCP connects Blender to Claude AI through the Model Context Protocol (MCP), allowing Claude to directly interact with and control Blender. This integration enables prompt assisted 3D modeling, scene creation, and manipulation.
DeepChatYour AI Partner on Desktop
Howtocook Mcp基于Anduin2017 / HowToCook (程序员在家做饭指南)的mcp server,帮你推荐菜谱、规划膳食,解决“今天吃什么“的世纪难题; Based on Anduin2017/HowToCook (Programmer's Guide to Cooking at Home), MCP Server helps you recommend recipes, plan meals, and solve the century old problem of "what to eat today"
Jina AI MCP ToolsA Model Context Protocol (MCP) server that integrates with Jina AI Search Foundation APIs.
Baidu Map百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Tavily Mcp
CursorThe AI Code Editor
WindsurfThe new purpose-built IDE to harness magic
Context7Context7 MCP Server -- Up-to-date code documentation for LLMs and AI code editors
Serper MCP ServerA Serper MCP Server
MiniMax MCPOfficial MiniMax Model Context Protocol (MCP) server that enables interaction with powerful Text to Speech, image generation and video generation APIs.