多平台通知交互服务

NotifyMeMaybe是一个基于MCP协议的多平台通知和交互AI工作流服务,支持Telegram集成、Webhook通知和交互式提示引擎,适用于AI助手与用户的实时交互和任务通知。

  • by keoy7am
  • TypeScript
  • 本地部署
  • 2 星标
  • 更新于
在 GitHub 查看 keoy7am/NotifyMeMaybe

使用说明

通知我也许

用于多平台通知和交互式AI工作流的强大MCP(模型上下文协议)服务器

🚀 TLDR-快速入门

2分钟后开始:

  1. 创建电报机器人:

    • 消息 @植物学家 在Telegram上
    • 使用 /newbot 创建一个机器人并获取您的 BOT_TOKEN
    • 开始与您的机器人聊天,并获得您的 CHAT_ID
  2. 添加到MCP配置:

    {
      "mcpServers": {
        "notify-me-maybe": {
          "command": "npx",
          "args": ["-y", "notify-me-maybe-mcp"],
          "env": {
            "TELEGRAM_BOT_TOKEN": "your_bot_token_here",
            "TELEGRAM_CHAT_ID": "your_chat_id_here",
            "TELEGRAM_PROMPT_ENABLED": "true",
            "TELEGRAM_INTERACTION_ENABLED": "true",
            "DEFAULT_NOTIFICATION_SERVICE": "telegram",
            "LANGUAGE": "en"
          }
        }
      }
    }
    
  3. 重新启动您的AI助手:

    • 克劳德桌面:重新启动应用程序
    • 光标:重新启动并激活MCP配置
  4. 测试:让你的AI助手给你发一个通知!

就是这样! 🎉 无需安装,无需克隆,无需构建。


🌐 语言支持

🤖 AI助手集成(代理提示)

准备好与您的AI助手集成了吗? 根据您的需求选择正确的提示配置:

📋 可用的代理提示配置

提示类型 描述 最适合 关键工具
仅通知 简单任务完成通知 基本通知需求 send_notification, broadcast_notification
交互式基础 电报交互+通知 用户输入和确认 request_interaction_sync, send_notification
交互式高级 带有后续提示的连续工作流程 复杂的多步骤任务 get_telegram_prompts, process_telegram_prompt, request_interaction_sync

🎯 AI助手快速入门

  1. 在下面选择提示类型
  2. 复制完整的提示配置
  3. 添加到您的AI助手系统提示(Cursor、Claude等)
  4. 配置您的NotifyMeMaybe服务
  5. 开始收到通知和互动!

特性

🔔 多通道通知

  • 电报集成:直接向Telegram聊天发送通知
  • Webhook 支持:用于自定义集成的HTTP webhook通知
  • 优先级:高、正常和低优先级通知
  • 元数据:将自定义数据附加到通知中

🤖 交互式提示引擎

NotifyMeMaybe的核心功能是其复杂的提示引擎,可实现AI系统和用户之间的双向通信:

交互类型

  • 确认请求:使用按钮界面做出是/否决定
  • 文本提示:收集用户的文本输入
  • 选择菜单:带有自定义按钮的多选选项
  • 同步和异步:实时和排队交互

AI工作流集成

  • MCP(模型上下文协议)兼容:与Claude和其他AI系统无缝集成
  • 超时管理:具有回退处理的可配置超时
  • 队列管理:处理多个并发用户交互
  • 响应验证:确保用户响应格式正确

高级功能

  • 自动拒绝:自动处理过期的交互
  • 广播通知:同时发送到所有活动频道
  • 服务健康监测:所有通知服务的实时状态
  • 国际化:多语言支持(英语、繁体中文、简体中文)

代理提示配置

1.📢 仅通知模式

为您的AI助手复制此提示配置:

## NotifyMeMaybe Notification-Only Mode Configuration

### When to use NotifyMeMaybe tools:
- **ALWAYS** notify when tasks are completed
- Send progress updates for long-running operations
- Notify on errors or important status changes

### Required MCP Tools Usage:

#### Task Completion Notifications:
Use `send_notification` or `broadcast_notification` when:
- Any task is completed successfully
- An error occurs during task execution
- Important milestones are reached

Parameters:
- service: "telegram" (or use broadcast_notification for all services)
- title: Clear, concise summary of what was accomplished
- message: Detailed results, file paths, URLs, or error details
- priority: "high" (errors), "normal" (completions), "low" (progress updates)
- metadata: Include relevant context like file paths, timestamps, etc.

#### Example Usage:
send_notification(
  service="telegram",
  title="Task Completed: Code Analysis",
  message="Successfully analyzed 15 files and found 3 potential issues. Results saved to /reports/analysis.json",
  priority="normal",
  metadata={"files_analyzed": 15, "issues_found": 3, "report_path": "/reports/analysis.json"}
)

### Service Health Check:
Use `test_services` periodically to ensure services are available.

2.🔄 交互模式

为您的AI助手复制此提示配置:

## NotifyMeMaybe Interactive Mode Configuration

### When to use NotifyMeMaybe tools:
- Request user input when clarification is needed
- Ask for confirmations before major operations
- Provide selection menus for user choices
- Send completion notifications

### Required MCP Tools Usage:

#### User Interaction Requests:
Use `request_interaction_sync` when:
- You need user confirmation before proceeding
- You require text input from the user
- You want to offer multiple choice options

Parameters:
- type: "confirmation" (Yes/No), "prompt" (text input), "selection" (multiple choice)
- message: Clear question or request for user
- options: Array of choices (only for type="selection")
- timeout: 60000 (60 seconds) or appropriate timeout

#### Examples:

Confirmation Request:
request_interaction_sync(
  type="confirmation",
  message="Do you want to proceed with deleting 5 files from the project directory?"
)

Text Input Request:
request_interaction_sync(
  type="prompt",
  message="Please provide the target deployment environment (staging/production):"
)

Selection Menu:
request_interaction_sync(
  type="selection",
  message="Choose the deployment strategy:",
  options=["Blue-Green Deployment", "Rolling Update", "Canary Release"]
)

#### Completion Notifications:
Always send completion notifications using `send_notification` after tasks finish.

#### Error Handling:
- Handle interaction timeouts gracefully
- Provide fallback responses if user doesn't respond
- Use high priority notifications for critical errors

3.🚀 高级交互模式

为您的AI助手复制此完整的提示配置:

## NotifyMeMaybe Advanced Interactive Mode Configuration

### Core Agent Behavior Rules:
- **ALWAYS** check for new Telegram prompts at session start
- **NEVER** end a session without asking for additional requests
- **ALWAYS** process pending prompts before starting new tasks
- **ALWAYS** send progress notifications for long operations

### Required MCP Tools Usage Protocol:

#### 1. Session Start Protocol:
ALWAYS execute at the beginning of each session:

1. Check for pending prompts:
   get_telegram_prompts()

2. If prompts exist, process each one:
   process_telegram_prompt(
     promptId="<prompt_id>",
     response="Received your request. Processing now..."
   )

3. Send status notification:
   send_notification(
     service="telegram",
     title="AI Session Started",
     message="Processing your Telegram requests. Session active.",
     priority="normal"
   )

#### 2. Task Execution Protocol:
During task execution:

1. Send progress updates for long operations:
   send_notification(
     service="telegram",
     title="Progress Update",
     message="Step 2/5 completed: Database backup finished",
     priority="normal",
     metadata={"step": 2, "total_steps": 5}
   )

2. Use interactions when user input needed:
   request_interaction_sync(
     type="confirmation",
     message="Ready to proceed with database migration. Continue?"
   )

3. Handle errors with high priority:
   send_notification(
     service="telegram",
     title="Error Occurred",
     message="Database connection failed. Retrying in 30 seconds...",
     priority="high"
   )

#### 3. Session End Protocol:
**MANDATORY**: Never end without this sequence:

1. Send completion notification:
   send_notification(
     service="telegram",
     title="Task Completed Successfully",
     message="All requested operations completed. Summary: [detailed results]",
     priority="normal"
   )

2. ALWAYS ask for additional requests:
   request_interaction_sync(
     type="prompt",
     message="Task completed successfully. Do you have any additional instructions or follow-up requests?",
     timeout=60000
   )

3. Continue interaction loop until user indicates completion
4. Only stop when user explicitly says "finished", "done", "no more tasks", or similar

#### 4. Telegram Prompt Monitoring:
Regularly check for new prompts:
- Use get_telegram_prompts() to check queue
- Process immediately with process_telegram_prompt()
- Prioritize user prompts over automated tasks

#### 5. Service Health Monitoring:
Periodically verify services:
test_services()
get_service_status(service="telegram")

### Advanced Mode Benefits:
- Users can send tasks anytime via Telegram
- AI automatically processes queued requests
- Continuous workflow without manual intervention
- Comprehensive progress tracking
- Error recovery with user guidance

📦 安装和设置

🌟 方法1:NPX(推荐)

添加到MCP配置文件中:

配置文件位置:

  • 视窗: %APPDATA%\Claude\claude_desktop_config.json
  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Linux: ~/.config/Claude/claude_desktop_config.json
{
  "mcpServers": {
    "notify-me-maybe": {
      "command": "npx",
      "args": ["-y", "notify-me-maybe-mcp"],
      "env": {
        "TELEGRAM_BOT_TOKEN": "your_bot_token_here",
        "TELEGRAM_CHAT_ID": "your_chat_id_here",
        "TELEGRAM_PROMPT_ENABLED": "true",
        "TELEGRAM_INTERACTION_ENABLED": "true",
        "DEFAULT_NOTIFICATION_SERVICE": "telegram",
        "LANGUAGE": "en"
      }
    }
  }
}

⚠️ 重要:配置后,完全重新启动您的AI助手。

🛠️ 方法二:地方发展

对于想要修改代码的开发人员:

git clone https://github.com/keoy7am/NotifyMeMaybe.git
cd NotifyMeMaybe
npm install
npm run build

📱 获取Telegram凭据

  1. 创建机器人:留言 @植物学家 → /newbot
  2. 获取聊天ID:向您的机器人发送消息,访问 https://api.telegram.org/bot<TOKEN>/getUpdates

🔧 配置

必需变量

TELEGRAM_BOT_TOKEN=your_bot_token_here
TELEGRAM_CHAT_ID=your_chat_id_here

可选变量

TELEGRAM_PROMPT_ENABLED=true
TELEGRAM_INTERACTION_ENABLED=true
DEFAULT_NOTIFICATION_SERVICE=telegram
LANGUAGE=en

🛠️ MCP工具

  • send_notification:发送到特定服务
  • broadcast_notification:发送到所有服务
  • request_interaction_sync:同步用户交互
  • test_services:健康检查所有服务
  • get_telegram_prompts:检索待处理的提示
  • process_telegram_prompt:处理电报提示

🤝 贡献

欢迎投稿!拜托:

  1. 分叉存储库
  2. 创建要素分支
  3. 提交拉取请求

📄 许可证

MIT许可证-请参阅 许可证 文件以获取详细信息。

🎯 准备好开始了吗?

快速入门(推荐)

  1. 获取 Telegram机器人令牌
  2. 添加 MCP配置
  3. 重启你的AI助手
  4. 测试通知!

高级设置

  1. 选择一个 代理提示配置
  2. 复制到您的AI助手系统提示
  3. 配置高级功能
  4. 构建交互式工作流程!

📦 NPM包

npm view notify-me-maybe-mcp
npx notify-me-maybe-mcp  # Use directly

通知我也许 -让人工智能与人类的互动无缝对接! 🚀

💡 专业提示:配置完成后,别忘了重新启动您的AI助手!