Slack Notifications MCP Server

Slack Notifications MCP Server

Enables sending customizable Slack notifications from Claude, supporting rich formatting, task completion alerts, and priority levels for development workflows.

Category
访问服务器

README

🚀 Slack Notifications MCP Server

A powerful Model Context Protocol (MCP) server that brings Slack notifications to Claude AI workflows. Perfect for getting notified when long-running tasks complete, errors occur, or when user input is needed.

Slack Notification Example MCP Compatible TypeScript

✨ Features

  • 📱 Rich Slack Messages: Formatted messages with attachments, colors, and fields
  • 🎯 Task Completion Notifications: Specialized notifications for development workflows
  • 🔧 Webhook Configuration: Easy setup with Slack webhook URLs
  • 🌈 Color-Coded Status: Visual indicators for success, error, warning, and info
  • 🎨 Customizable: Channel selection, bot username, emojis, and priority levels
  • 🚀 Zero Config: Works with environment variables or runtime configuration

🛠️ Tools

send_slack_notification

Send a customizable Slack notification with full formatting options.

Parameters:

  • title (required): The notification title
  • message (required): The notification message
  • webhook_url (optional): Slack webhook URL (if not configured globally)
  • channel (optional): Target channel (e.g., #general, @username)
  • username (optional): Bot username (default: "Claude Code")
  • icon_emoji (optional): Bot emoji (default: ":robot_face:")
  • color (optional): Message color (good, warning, danger, info, or hex)
  • priority (optional): Priority level (low, normal, high, urgent)

slack_task_completion_notification

Send a specialized notification for task completion with intelligent formatting.

Parameters:

  • status (required): success, error, warning, or info
  • taskType (optional): Type of task (e.g., "Build", "Deploy", "Test")
  • duration (optional): How long the task took
  • summary (optional): Brief summary of accomplishment
  • url (optional): Related URL (e.g., localhost development server)
  • webhook_url (optional): Slack webhook URL (if not configured globally)
  • channel (optional): Target channel

configure_slack_webhook

Configure global Slack webhook settings for the session.

Parameters:

  • webhook_url (required): Your Slack webhook URL
  • default_channel (optional): Default channel for notifications

🚀 Quick Start

1. Create Slack Webhook

  1. Go to Slack API: Visit api.slack.com
  2. Create New App: Click "Create New App" > "From scratch"
  3. Configure Incoming Webhooks:
    • Go to "Incoming Webhooks" in the sidebar
    • Activate incoming webhooks
    • Click "Add New Webhook to Workspace"
    • Choose your channel and authorize
    • Copy the webhook URL (starts with https://hooks.slack.com/services/...)

2. Installation

  1. Clone this repository: ```bash git clone https://github.com/chiuchau-cyril/mcp-slack-notifications.git cd mcp-slack-notifications ```

  2. Install dependencies: ```bash npm install ```

  3. Build the project: ```bash npm run build ```

3. Configuration

For Claude Code

Add to your Claude Code MCP configuration:

```json { "mcpServers": { "slack-notifications": { "command": "node", "args": ["/Users/cyril/Documents/git/mcp-servers/slack-notifications/dist/index.js"], "env": { "SLACK_WEBHOOK_URL": "https://hooks.slack.com/services/YOUR/WEBHOOK/URL" } } } } ```

For Claude App

Add to your Claude App MCP settings:

```json { "slack-notifications": { "command": "node", "args": ["/Users/cyril/Documents/git/mcp-servers/slack-notifications/dist/index.js"], "env": { "SLACK_WEBHOOK_URL": "https://hooks.slack.com/services/YOUR/WEBHOOK/URL" } } } ```

4. Testing

Run the test suite to verify everything works:

```bash node test-slack-notifications.js ```

📱 Usage Examples

Basic Notification

```javascript // Simple notification { "title": "🎉 Task Complete", "message": "Your build finished successfully!", "channel": "#development", "color": "good" } ```

Development Workflow

```javascript // Task completion with details { "status": "success", "taskType": "React Build", "duration": "2 minutes", "summary": "Compiled 45 components successfully", "url": "http://localhost:3000", "channel": "#dev-notifications" } ```

Error Notification

```javascript // Error with high priority { "title": "❌ Build Failed", "message": "TypeScript compilation errors detected", "color": "danger", "priority": "urgent", "channel": "#alerts" } ```

Configuration

```javascript // Set up webhook for the session { "webhook_url": "https://hooks.slack.com/services/YOUR/WEBHOOK/URL", "default_channel": "#claude-notifications" } ```

🎯 Smart Notification Logic

This MCP server implements the same intelligent notification timing as the macOS version:

⚠️ Immediate Notifications (User Action Required)

  • Commands waiting for confirmation (Do you want to proceed?)
  • Password prompts
  • Any user input required
  • Priority: urgent with red color

Completion Notifications (Task Finished)

  • Build processes completed
  • Tests finished running
  • Deployments completed
  • Color: Green (success) / Red (error) / Orange (warning)

🔇 No Notifications

  • Simple queries (ls, pwd)
  • Commands still running normally
  • Quick operations (< 30 seconds)

🎨 Slack Message Features

Color Coding

  • Green (good): Success, completed tasks
  • Orange (warning): Warnings, partial failures
  • Red (danger): Errors, critical issues
  • Blue (info): Information, status updates
  • Custom: Any hex color code (e.g., #FF5733)

Priority Levels

  • Low: #cccccc (gray)
  • Normal: #0099cc (blue)
  • High: #ff9500 (orange)
  • Urgent: #ff0000 (red)

Rich Formatting

  • Attachments: Structured message layout
  • Fields: Key-value pairs with short/long display
  • Timestamps: Automatic message timing
  • Footer: "Claude Code" branding

🛡️ Requirements

  • Node.js 18+
  • Slack workspace with webhook permissions
  • Internet connection for webhook delivery

🧪 Environment Variables

Set these for easier configuration:

```bash export SLACK_WEBHOOK_URL="https://hooks.slack.com/services/YOUR/WEBHOOK/URL" export SLACK_DEFAULT_CHANNEL="#claude-notifications" ```

📖 Claude Rules Integration

For automatic notification behavior, add these rules to your Claude configuration:

```markdown

Automatically notify on task completion via Slack

When a task takes longer than 2 minutes or requires user input, send a Slack notification using the appropriate tool.

Notification timing:

  • User input needed → Immediate notification with urgent priority
  • Task completed → Result notification with appropriate status
  • Errors occurred → Error notification with danger color ```

🔒 Security Notes

  • Webhook URLs contain secrets - keep them private
  • Don't commit webhook URLs to version control
  • Use environment variables for production deployments
  • Limit webhook permissions to necessary channels only

🤝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.

📄 License

MIT License - see LICENSE file for details.

🙋‍♂️ Support

🔗 Related Projects


Made with ❤️ for the Claude AI ecosystem

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选