notify_me_mcp
Enables sending rich notifications to Discord and/or Slack webhooks with automatic service detection, retry logic, and support for embeds, blocks, and attachments. Provides secure webhook management with comprehensive input validation and rate limiting.
README
notify_me_mcp
TypeScript MCP server for sending notifications to Discord and/or Slack webhooks
A powerful Model Context Protocol (MCP) server that provides webhook notification capabilities to AI agents and LLM applications. Send rich notifications to Discord and Slack with automatic service detection, retry logic, and comprehensive security features.
✨ Features
- 🔧 Three MCP Tools:
send_notification,validate_webhook,list_services - 🎯 Multi-Service Support: Discord, Slack, or both simultaneously
- 🛡️ Security First: Webhook URLs never exposed in logs or process lists
- 📱 Rich Content: Discord embeds and Slack blocks/attachments support
- 🔄 Robust Retry Logic: Handles rate limiting with exponential backoff
- ⚡ Service Auto-Detection: Automatically selects available services
- 🔍 Input Validation: Comprehensive schema validation with Zod
- 📊 Structured Logging: Secure logging with automatic URL redaction
🚀 Quick Start
Prerequisites
- Node.js ≥ 23.7.0
- npm ≥ 10.9.2
- Discord and/or Slack webhook URLs
Installation
-
Clone the repository
git clone https://github.com/thesammykins/notifyme_mcp.git cd notifyme_mcp -
Install dependencies
npm install -
Configure webhooks
cp .env.example .env # Edit .env and replace webhook placeholders -
Build the project
npm run build
Configuration
Create a .env file with your webhook URLs:
# Discord webhook URL (optional)
DISCORD_WEBHOOK_URL="https://discord.com/api/webhooks/YOUR_ID/YOUR_TOKEN"
# Slack webhook URL (optional)
SLACK_WEBHOOK_URL="https://hooks.slack.com/services/T00/B00/XXXX"
# Optional: Custom .env file location
# NOTIFY_ME_ENV_FILE="/path/to/custom/.env"
# NOTIFY_ME_ENV_DIR="/path/to/directory"
Getting Webhook URLs:
Discord:
- Go to Server Settings → Integrations → Webhooks
- Click "Create Webhook" → Copy webhook URL
Slack:
- Create a Slack app at https://api.slack.com/apps
- Enable "Incoming Webhooks" → Add to workspace
- Copy the webhook URL
🔧 Usage with MCP Clients
Claude Desktop Configuration
Add to your Claude Desktop claude_desktop_config.json:
{
"mcpServers": {
"notify_me_mcp": {
"command": "node",
"args": ["path/to/notifyme_mcp/dist/index.js"],
"env": {
"DISCORD_WEBHOOK_URL": "your_discord_webhook_url",
"SLACK_WEBHOOK_URL": "your_slack_webhook_url"
}
}
}
}
Other MCP Clients
Use the built server at dist/index.js with any MCP-compatible client over stdio transport.
🛠️ Available Tools
send_notification
Send notifications to Discord and/or Slack webhooks.
Parameters:
message(string, optional): Plain text messageservice(string, optional): "discord", "slack", or "both" (auto-detected if not specified)embed_json(object/array/string, optional): Rich content (Discord embeds, Slack blocks)username(string, optional): Override display usernameavatar_url(string, optional): Override avatar/icon URLtts(boolean, optional): Enable text-to-speech (Discord only)
Examples:
// Simple notification
{"message": "Task completed successfully ✅"}
// Target specific service
{"message": "Deploy finished", "service": "slack", "username": "CI Bot"}
// Discord embed
{
"service": "discord",
"embed_json": {
"title": "Build Status",
"description": "All tests passed",
"color": 65280
}
}
// Slack blocks
{
"service": "slack",
"embed_json": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "*Deploy Complete* 🚀\nAll systems operational"
}
}
]
}
validate_webhook
Test webhook connectivity by sending a test message.
Parameters:
service(string, optional): "discord", "slack", or "both"message(string, optional): Custom test message
list_services
List configured webhook services and auto-detected default.
No parameters required.
🏗️ Service Auto-Detection
The server automatically detects which services to use:
- Only Discord configured →
discord - Only Slack configured →
slack - Both configured →
discord(default for backward compatibility) - Use
service: "both"→ Send to all configured services
🔒 Security Features
- Webhook Protection: URLs never appear in logs, errors, or process lists
- Secure Logging: Automatic redaction of sensitive information
- Input Validation: All inputs validated with Zod schemas
- Rate Limiting: Automatic retry on 429 responses with
Retry-Aftersupport - Temporary Files: Created with restrictive permissions (077)
🎨 Rich Content Support
Discord Embeds
Supports Discord's native embed objects:
{
"title": "Deployment Status",
"description": "Production deployment completed",
"color": 65280,
"fields": [
{"name": "Version", "value": "v1.2.3", "inline": true},
{"name": "Duration", "value": "3m 42s", "inline": true}
],
"timestamp": "2024-01-15T10:30:00.000Z"
}
Slack Blocks & Attachments
Supports Slack's block kit and legacy attachments:
// Blocks (recommended)
[
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "*Deployment Complete* 🚀\nVersion v1.2.3 deployed successfully"
}
}
]
// Attachments (legacy)
{
"attachments": [
{
"color": "good",
"title": "✅ Success",
"text": "All tests passed",
"fields": [
{"title": "Environment", "value": "Production", "short": true}
]
}
]
}
📊 Common Colors
| Status | Discord (decimal) | Slack (hex/keyword) |
|---|---|---|
| Success | 65280 |
#36a64f or good |
| Error | 16711680 |
#ff0000 or danger |
| Warning | 16753920 |
#ffa500 or warning |
| Info | 3447003 |
#3498db |
🧪 Development
Run in Development Mode
npm run dev # Uses tsx with watch mode
Build
npm run build # Compiles TypeScript to dist/
Start Production Server
npm start # Runs compiled JavaScript
Testing
npm test # Run tests once
npm run test:watch # Run tests in watch mode
📁 Project Structure
notify_me_mcp/
├── src/
│ ├── index.ts # MCP server entry point
│ ├── config.ts # Environment loading & service detection
│ ├── payload.ts # Discord/Slack payload builders
│ ├── senders.ts # HTTP senders with retry logic
│ ├── logger.ts # Secure logging with redaction
│ ├── types.ts # TypeScript interfaces & Zod schemas
│ └── utils.ts # Helper functions
├── dist/ # Compiled JavaScript
├── .env.example # Environment template
├── package.json # Node.js configuration
├── tsconfig.json # TypeScript configuration
└── README.md # This file
🔧 Environment Variables
| Variable | Description | Example |
|---|---|---|
DISCORD_WEBHOOK_URL |
Discord webhook URL | https://discord.com/api/webhooks/... |
SLACK_WEBHOOK_URL |
Slack webhook URL | https://hooks.slack.com/services/... |
NOTIFY_ME_ENV_FILE |
Custom .env file path | /path/to/.env |
NOTIFY_ME_ENV_DIR |
Custom .env directory | /path/to/config |
🐛 Troubleshooting
Common Issues
"No webhook URLs configured"
- Ensure
.envfile exists with valid webhook URLs - Check environment variable names match exactly
"Discord message exceeds 2000 character limit"
- Discord has a 2000 character limit for message content
- Use embeds for longer content or split messages
"Invalid JSON in embed_json"
- Validate JSON syntax before sending
- Use proper escaping for quotes in JSON strings
Connection timeouts
- Check network connectivity to Discord/Slack APIs
- Verify webhook URLs are correct and active
Debug Mode
For troubleshooting, you can run with verbose logging:
DEBUG=* npm start
🤝 Contributing
- Fork the repository
- Create a feature branch:
git checkout -b feature/my-feature - Make your changes
- Build and test:
npm run build && npm test - Commit your changes:
git commit -am 'Add some feature' - Push to the branch:
git push origin feature/my-feature - Submit a pull request
📄 License
This project is licensed under the MIT License - see the LICENSE file for details.
🔗 Related Projects
- notify_me.sh - The original bash script that inspired this MCP server
- Model Context Protocol - Official MCP documentation
- Discord Webhooks - Discord webhook documentation
- Slack Webhooks - Slack incoming webhook documentation
🙋♂️ Support
- Issues: Report bugs and request features on GitHub Issues
- Documentation: Check this README and inline code comments
- MCP Protocol: Refer to MCP documentation for client setup
Built with ❤️ using TypeScript and the Model Context Protocol
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。