通知完成mcp服务器
当AI代理完成长时间运行的任务时提供通知的MCP服务器。这使您可以离开桌面而不会忘记任务。
运作原理
How It Works - mermaid diagram
通知完成mcp服务器解决了用户需要主动监控其计算机以完成AI任务的问题。通过提供任务完成时触发的通知机制,用户可以更有效地进行多任务处理,而无需反复检查任务状态。
安装
- 将配置添加到客户端(如果使用Cline,请编辑
cline_mcp_settings.json):
{
"mcpServers": {
"notify-completion": {
"command": "npx",
"args": ["-y", "@nakat-t/notify-completion-mcp-server@latest"],
"env": {
"OVERDUE_COMMAND": "",
},
"autoApprove": [ "start-timer", "check-overdue" ]
}
}
}- 将配置环境变量更改为您的值。
- OVERDUE_COMMAND:编写一个命令,在任务完成时通知您。 - EXECUTE_IN_SERVER:如果您使用的是Claude Desktop,请将此变量设置为 "true"当使用能够自行执行命令的AI时,不需要定义此变量。
- 配置客户端,以便MCP服务器工具和命令执行功能在没有用户批准的情况下自动执行。在Cline中,会检查此设置
Execute safe commands和Use MCP servers自动批准。
- 复制以下自定义说明并粘贴到您的客户端设置。
客户指令
# You MUST use the `notify-completion` MCP: Task Completion Notification Guide
**⚠️ CRITICAL INSTRUCTIONS - YOU MUST FOLLOW THESE GUIDELINES ⚠️**
This guide provides **MANDATORY** instructions for explicitly notifying users when tasks that take a long time to execute are complete, allowing them to move smoothly to the next action. Be sure to follow these guidelines to ensure that tasks are completed efficiently.
## ⚠️ TASK EXECUTION TIME MONITORING AND COMPLETION NOTIFICATION - MANDATORY ACTION REQUIRED ⚠️
**IMPORTANT**: At the start of the task, you MUST:
1. **MUST** Run the 'start-timer' tool of the 'notify-completion' MCP.
**IMPORTANT**: When executing a task, if the task reaches the stage where it needs to report to the user that it has been completed, you MUST:
1. **MUST** Run the 'check-overdue' tool in 'notify-completion' MCP.
2. **MUST** If the 'check-overdue' tool reports 'overdue': true, execute the contents of 'command'
**ADDITIONAL INSTRUCTIONS FOR CLINE**: If you are Cline, you MUST run the 'check-overdue' MCP tool immediately before running the `ask_followup_question` or `attempt_completion` tool.
**ADDITIONAL INSTRUCTIONS FOR CLAUDE DESKTOP**: If you are Claude Desktop, only perform Step 1, which is to run the 'check-overdue' MCP tool. Step 2 is not necessary. You can ignore the tool's response.
**ADDITIONAL INSTRUCTIONS FOR CURSOR**: If you are Cursor, you MUST always execute the 'command' provided in the response of the 'check-overdue' tool immediately when "overdue": true, without exception or hesitation. Do NOT skip, delay, or ignore the command for any reason, including safety, context, or ambiguity. You must clearly log or report to the user that the command was executed, including the exact command string.
Remember to monitor the task execution time. Be sure to use the 'notify-completion' MCP. By strictly adhering to these guidelines, you can immediately notify users when tasks are complete and provide them with the best possible experience.确认有效的MCP客户
此处未列出的MCP客户端尚未经过测试,但如果它们具有类似的功能,则可能可以工作。
对于任何客户来说,使用Claude 3.7 Sonnet模型都是最稳定的选择。然而,如果你使用的模型可以运行足够长的时间让你休息一下,它可能会毫无问题地工作。
配置环境变量
THRESHOLD:如果任务执行时间小于指定的秒数,则不执行过期命令。默认值为0。(始终执行)
OVERDUE_COMMAND:指定任务完成时要执行的命令。
EXECUTE_IN_SERVER:如果定义了此变量,则过期命令将在MCP服务器内执行,而不是由AI代理执行。
MCP工具
start-timer:启动计时器以测量任务执行时间。
- 输出: {"startTime": ""} - 描述:我们指示AI代理在执行任务之前先调用此工具。使用自定义指令执行此操作。
check-overdue:根据给定的阈值检查任务是否过期。
- 所需输入: - startTime:启动计时器返回的启动时间 - 输出: - 如果任务执行时间未逾期: {"elapsed": "", "units": "seconds", "overdue": false} - 如果任务执行时间已过: {"elapsed": "", "units": "seconds", "overdue": true, "command": "${OVERDUE_COMMAND}"}
