关于 MCP Wait Server
MCP Wait Server 为 Claude Desktop 等 MCP 客户端提供时间相关工具,可按指定时长暂停执行,并以 ISO 8601 格式返回当前日期和时间。
主要功能
- 01按指定时长暂停执行
- 02返回当前日期和时间
- 03配置最长等待时长
适用场景
- 01等待长时间运行的脚本
- 02暂停后检查进程状态
- 03在 API 调用间添加延迟
- 04获取日志时间戳
MCP 相关
它向 MCP 客户端提供 `wait` 和 `get_datetime` 工具。最长等待时长和工具说明可通过环境变量配置。
配置
本地服务的配置在各客户端中通用,复制后粘贴到客户端的 MCP 配置文件即可。
我们还没有获取到这个服务的安装包或远程地址,请按项目 README 中的说明安装。
工具
本地服务需要在你的电脑上运行后才能读取工具,维护者暂未提供工具列表。
详细介绍
MCP Wait 服务
简单的模型上下文协议服务,为 Claude Desktop 和其他 MCP 客户端提供时间相关工具:
wait- 暂停执行指定秒数,适用于需要等待长时间运行的操作完成的情况get_datetime- 以 ISO 8601 格式返回当前日期和时间
实现
- 使用 TypeScript 编写
- 位于
src/index.ts(源代码)和build/index.js(编译后) - 使用以下命令运行:
npm start,或直接运行node build/index.js
安装
选项 1:使用 npx(推荐——无需安装)
最简单的方法是使用 npx 运行软件包,无需安装。按照下方“用法”部分的说明配置 Claude Desktop。
选项 2:从 npm 安装
如果你希望安装此软件包:
# Install globally
npm install -g mcp-wait-server
选项 3:克隆并从源代码构建
用于开发或自定义:
# Clone repository
git clone https://github.com/Amico1285/mcp-wait-server.git
cd mcp-wait-server
# Install dependencies
npm install
# Build the project
npm run build
# You can run it directly
npm start
在 Claude Desktop 中使用
-
创建或编辑 Claude Desktop 配置文件:
- macOS/Linux 上的位置:
~/.anthropic/config.json - Windows 上的位置:
%APPDATA%\anthropic\config.json - 如有需要,请创建目录/文件
- macOS/Linux 上的位置:
-
推荐方法:使用 npx(无需安装)
这是适用于所有环境的最简单方法,无需全局安装:
{
"mcpServers": {
"wait_server": {
"command": "npx",
"args": [
"mcp-wait-server@latest"
],
"env": {
"MCP_WAIT_MAX_DURATION_SECONDS": "210",
"MCP_WAIT_TOOL_DESCRIPTION": "Waits for a specified number of seconds. Use this to create a delay after starting a long-running operation (like a script or download via another tool), allowing it time to complete before you proceed or check its status."
}
}
}
}
- 其他方法:
如果你进行了全局安装:
{
"mcpServers": {
"wait_server": {
"command": "mcp-wait-server",
"env": {
"MCP_WAIT_MAX_DURATION_SECONDS": "210",
"MCP_WAIT_TOOL_DESCRIPTION": "Waits for a specified number of seconds. Use this to create a delay after starting a long-running operation (like a script or download via another tool), allowing it time to complete before you proceed or check its status."
}
}
}
}
如果你从源代码安装:
{
"mcpServers": {
"wait_server": {
"command": "/path/to/your/mcp-wait-server/build/index.js",
"env": {
"MCP_WAIT_MAX_DURATION_SECONDS": "210",
"MCP_WAIT_TOOL_DESCRIPTION": "Waits for a specified number of seconds. Use this to create a delay after starting a long-running operation (like a script or download via another tool), allowing it time to complete before you proceed or check its status."
}
}
}
}
-
重启 Claude Desktop
-
Claude Desktop 现在即可使用
wait和get_datetime工具
环境变量
MCP_WAIT_MAX_DURATION_SECONDS- 单次等待调用的最长时间(默认值:210 秒)MCP_WAIT_TOOL_DESCRIPTION- 自定义 wait 工具的描述
工作原理
Wait 工具
为 Claude 提供 wait 工具后,它便可使用该工具等待指定秒数。这在以下场景中特别有用:
- 等待长时间运行的脚本完成
- 在检查进程状态前暂停
- 在 API 调用之间增加延迟,以避免触发速率限制
- 留出时间等待下载或上传完成
该工具的单次最长等待时间有限(默认值为 210 秒),但会自动处理更长的等待时间,方法是指示 Claude 使用剩余时间再次调用该工具。
Get DateTime 工具
get_datetime 工具以 ISO 8601 格式提供当前日期和时间。适用于:
- 为操作或事件添加时间戳
- 计算时间差
- 安排计划或进行基于时间的决策
- 使用准确的时间戳记录日志
开发
- 需要 Node.js 18+
- 安装依赖项:
npm install - 构建:
npm run build - 运行:
npm start
评论
一个开放协议,规定了 AI 应用如何以统一方式连接外部工具与数据源。客户端负责与模型对话,MCP 服务负责提供工具、资源和提示模板,两者通过标准消息通信,同一个服务可以被不同客户端复用。