Cline通知服务器
Cline的MCP服务器,能够通过Telegram发送通知和接收响应。当Cline需要提问时,它会向您发送一条Telegram消息并等待您的回复。
特性
- 发送不同紧急程度(低、中、高)的通知
- 自动等待用户响应
- 可配置超时(默认为30秒)
- 当用户不可用时停止Cline,以防止不必要的操作
安装
npm install cline-notification-server设置
1.创建Telegram Bot
- 消息 @植物学家 在Telegram上
- 发送
/newbot并遵循指示 - 保存您收到的机器人令牌(看起来像
123456789:ABCdefGHIjklMNOpqrsTUVwxyz) - 与您的新机器人开始聊天
- 消息
/start到你的机器人
2.获取您的聊天ID
- 向您的机器人发送消息
- 在浏览器中打开此URL(用您的令牌替换BOT_TOKEN):
https://api.telegram.org/botBOT_TOKEN/getUpdates- 寻找
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需要问你一个问题时:
- 它使用您的机器人通过Telegram发送消息
- 等待您的回复最多30秒
- 如果你在30秒内做出回应,克莱恩会继续回答你的问题
- 如果你在30秒内没有回应,Cline会停下来等待你重新启动它
示例用法
配置此服务器后,Cline可以使用它向您提问:
// Example of how Cline uses the notification tools
const response = await use_mcp_tool({
server_name: "notification",
tool_name: "send_notification",
arguments: {
message: "Should I proceed with deploying to production?",
project: "MyApp",
urgency: "high"
}
});邮件格式为:
- 🚨 高紧急性前缀
- ⚠️ 中等紧急程度前缀
- 低紧急程度没有前缀
环境变量
TELEGRAM_BOT_TOKEN:您从BotFather获得的Telegram机器人令牌TELEGRAM_CHAT_ID:发送消息的Telegram聊天ID
贡献
如果您有改进建议,请随时打开问题或提交拉取请求。
许可证
麻省理工学院
