Date Tool MCP
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
Date Tool MCP — 三种传输方式演示
用同一个工具(get_today,返回当前日期)演示 MCP 的三种传输方式,并用 LangChain Agent 作为客户端调用:
传输方式 | 服务端 | 客户端连接地址 |
stdio |
| 由客户端自动拉起子进程,无地址 |
SSE |
|
|
Streamable HTTP |
|
|
目录结构
001/
├── server.py # 发布用 stdio 入口(python server.py)
├── mcp_server_stdio.py # stdio 传输示例
├── mcp_server_sse.py # SSE 传输
├── mcp_server_streamable.py # Streamable HTTP 传输
├── mcp_client.py # LangChain + MCP 客户端
├── chatmcp.yaml # ChatMCP 安装配置
├── LAUNCHGUIDE.md # MCP Marketplace 提交信息
├── llms-install.md # 供 Cline 等 AI Agent 自动安装
├── assets/logo.png # 400×400 项目图标
├── requirements.txt
└── LICENSERelated MCP server: datetime-mcp-server
作为 MCP 服务端安装
服务端本身不需要任何 API Key。stdio 配置如下(详见 llms-install.md,供 Cline 等 AI Agent 自动安装):
{
"mcpServers": {
"date-tool-mcp": {
"command": "python",
"args": ["server.py"],
"cwd": "/absolute/path/to/sjy-tool-mcp"
}
}
}环境要求
Python 3.10+
一个可用的 DashScope API Key(仅运行
mcp_client.py演示时需要,服务端不需要)
安装
pip install -r requirements.txt在项目根目录或本目录创建 .env:
DASHSCOPE_API_KEY=your_api_key_here运行
三个服务端暴露的工具完全相同,一次只验证一种传输方式。
1. stdio(最简单,不用手动启服务端)
客户端会以子进程方式自动启动 mcp_server_stdio.py:
python mcp_client.py2. SSE
先启动服务端,再另开一个终端运行客户端:
# 终端 1
python mcp_server_sse.py
# 终端 2
python mcp_client.py在 mcp_client.py 中启用 SSE 配置:
"date-tool-sse": {"transport": "sse", "url": "http://127.0.0.1:8000/sse"},3. Streamable HTTP
# 终端 1
python mcp_server_streamable.py
# 终端 2
python mcp_client.py在 mcp_client.py 中启用对应的 HTTP 配置:
"date-tool-streamable": {"transport": "streamable_http", "url": "http://127.0.0.1:8000/mcp"},客户端说明
mcp_client.py 使用 MultiServerMCPClient 管理多个 MCP 服务端,流程为:
client.get_tools()获取所有服务端提供的工具init_chat_model("qwen-plus", ...)通过 DashScope 的 OpenAI 兼容接口初始化模型create_agent(model, tools)构造 Agent提问「今天几号?」,模型自动调用
get_today工具并输出最终回答
stdio 配置使用 sys.executable 和脚本所在目录,因此在任意机器/目录下都能直接运行,无需修改路径。
输出示例
--- [0] HumanMessage ---
--- [1] AIMessage ---
工具调用: get_today {} id: call_xxx
--- [2] ToolMessage ---
工具返回: get_today call_xxx -> 2026-11-26
--- [3] AIMessage ---
最终回答: 今天是 2026 年 11 月 26 日。常见问题
McpError: Session terminated / 连接失败
客户端里同时启用了未启动的 HTTP 服务端。只保留当前要验证的那一种 transport,其余注释掉。
端口被占用
mcp_server_sse.py 和 mcp_server_streamable.py 默认都使用 8000 端口,不能同时运行。需要同时启动时,请修改其中一个的 port 并同步修改客户端 URL。
No module named 'langchain_mcp_adapters'
装依赖时用错了解释器,确认 pip install -r requirements.txt 与运行 python mcp_client.py 是同一个环境。
401 invalid_api_key
DASHSCOPE_API_KEY 无效或未生效,检查 .env 内容及是否已加载到环境变量中。
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Current time, timezone conversion & date math for AI agents. On Cloudflare Workers.
The official Model Context Protocol server for Ambee. It gives any MCP-compatible AI assistant — Claude, ChatGPT, Cursor, VS Code, Ollama, and more direct access to live air quality, pollen, and weather data. To get started, including information on signing up and obtaining your Ambee key, check out the Ambee documentation on https://docs.ambeedata.com
Exposes FEDLIN's public security scanners as agent-callable tools over Streamable HTTP.
Time and date math for AI agents: Unix timestamp conversion, DST-correct time zone conversion, durations, epoch arithmetic, cron schedules, and holiday countdowns. Eight tools, no key.
Related MCP Servers
- AlicenseAqualityDmaintenanceA 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.9MIT
- AlicenseAqualityDmaintenanceProvides a tool to retrieve the current date and time with customizable formatting placeholders for year, month, day, hour, minute, and second. It supports both stdio and HTTP transport modes for integration with Model Context Protocol clients.116 npmMIT
- FlicenseNot gradedqualityBmaintenanceMinimal MCP server exposing a single tool, run_date, to execute the local date command via a Streamable HTTP endpoint.-
- AlicenseAqualityCmaintenanceProvides a single MCP tool that returns the current time for a requested timezone, connectable to Claude Code and Claude desktop over stdio or Streamable HTTP.2ISC