Notification Mcp

Notification Mcp

🚀 Cline 通知服务器

Cline 通知服务器是专为 Cline 设计的 MCP 服务器,它支持借助 Telegram 发送通知并接收回复。当 Cline 需要提问时,会通过 Telegram 消息通知您,同时等待您的回复,极大提升交互效率。

🚀 快速开始

Cline 通知服务器能让 Cline 与您通过 Telegram 高效交互。以下为您介绍使用前的安装和配置步骤。

✨ 主要特性

  • 🔔 发送不同紧急程度的通知(低、中、高),让您根据重要性快速区分消息。
  • ⏳ 自动等待用户回复,确保不错过任何关键信息。
  • ⏰ 可配置超时时间(默认 30 秒),灵活适应不同场景。
  • 🛑 用户不可用时停止 Cline 以防止意外操作,保障系统安全。

📦 安装指南

使用以下命令安装 Cline 通知服务器:

npm install cline-notification-server

📚 详细文档

设置配置

1. 创建 Telegram 机器人

  1. 在 Telegram 中发送消息给 @BotFather
  2. 发送 /newbot 并按照指示操作。
  3. 记录收到的机器人令牌(形如 123456789:ABCdefGHIjklMNOpqrsTUVwxyz)。
  4. 与新机器人开始对话。
  5. 发送 /start 给您的机器人。

2. 获取您的聊天 ID

  1. 向您的机器人发送消息。
  2. 在浏览器中打开以下链接(将 BOT_TOKEN 替换为您的令牌):
    https://api.telegram.org/botBOT_TOKEN/getUpdates
    
  3. 查找 chat 对象并记录其 id 字段,这就是您的聊天 ID。

3. 配置 Cline

在 Cline 配置文件中添加服务器:

对于 VSCode 扩展(cline_mcp_settings.json):

{
"mcpServers": {
"notification": {
"command": "npx",
"args": ["cline-notification-server"],
"env": {
"TELEGRAM_BOT_TOKEN": "your_bot_token",
"TELEGRAM_CHAT_ID": "your_chat_id"
}
}
}
}

对于 Claude 桌面应用程序(claude_desktop_config.json):

{
"mcpServers": {
"notification": {
"command": "npx",
"args": ["cline-notification-server"],
"env": {
"TELEGRAM_BOT_TOKEN": "your_bot_token",
"TELEGRAM_CHAT_ID": "your_chat_id"
}
}
}
}

工作原理

当 Cline 需要提问时:

  1. 它通过 Telegram 机器人发送消息。
  2. 等待最长 30 秒的用户回复。
  3. 如果您在 30 秒内回复,Cline 继续使用您的答案。
  4. 如果您未及时回复,Cline 停止等待直到重新启动。

环境变量

属性 详情
环境变量 详情
TELEGRAM_BOT_TOKEN 您从 BotFather 获得的 Telegram 机器人令牌
TELEGRAM_CHAT_ID 消息发送目标的聊天 ID

💻 使用示例

基础用法

当配置好服务器后,Cline 可以使用它进行提问:

// Cline使用通知工具的示例
const response = await use_mcp_tool({
server_name: "notification",
tool_name: "send_notification",
arguments: {
message: "我应该继续将代码部署到生产环境吗?",
project: " MyApp",
urgency: "high"
}
});

消息格式为:

  • 🚨 高优先级前缀
  • ⚠️ 中等优先级前缀
  • 低优先级无前缀

🤝 贡献

如果您有任何改进建议,欢迎提出问题或提交拉取请求。

📄 许可证

本项目采用 MIT 许可证。

  • 0 关注
  • 0 收藏,12 浏览
  • system 提出于 2025-09-30 09:36

相似服务问题