本地时间获取服务
About
为 LLM 提供了获取“当前”时间、日期、星期等信息的能力。有了它,LLM 回答“现在”、“最近”相关问题时,终于可以获得真正的“现在”——不再停留在模型训练的过去!
Details
- Author
- panpeter2024
- Downloads
- 197
- Categories
- Other
Jump to
- Provides current date in YYYY-MM-DD format
- Provides current time in HH:MM:SS format
- Returns weekday name in Chinese
- Returns current Unix timestamp in seconds
- Returns current date and time in ISO 8601 format
Setting up with Highlight
This MCP is not yet compatible with Highlight’s one-click setup. However, you can still use it with Highlight by following these steps:
- Download and install Highlight from highlightai.com/download
- Navigate to the plugins tab and select "Add Custom Plugin"
-
Configure the plugin with the settings below
Plugin Name
本地时间获取服务Command (node, npx, python, etc.)Please refer to the README for specific instructions on how to obtain API keys or other required environment variables.
- Enable "Start Automatically" if you want the plugin to start when Highlight launches
From the repository
Requires Python 3.8+ with a virtual environment. Clone the repository, install the fastmcp dependency, and run server_date.py. In Cherry Studio, configure a new MCP service with SSE transport at http://127.0.0.1:9000/sse and leave authentication blank.
Claude Desktop / Cursor
Paste into your MCP client config file to install this server.
{
"mcpServers": {
"\u672c\u5730\u65f6\u95f4\u83b7\u53d6\u670d\u52a1": {
"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": []
}
}
}
}
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": []
}
}
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。Sign in to leave a review
Use Google, GitHub, or an email account so ratings stay tied to real people.
No reviews posted yet.



