dogonthehorizon/slack-notifier-mcp
If you are the rightful owner of slack-notifier-mcp and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to dayong@mcphub.com.
The Slack Notifier MCP Server is a tool designed to facilitate communication between AI agents and team members by sending progress updates to Slack channels.
Slack Notifier MCP Server
[!WARNING] This is preview software and is not intended for production use. Use at your own risk.
A Model Context Protocol (MCP) server that provides a tool for sending progress update notifications to a pre-configured Slack channel using OAuth bot tokens. This server is designed to help AI agents communicate their task completion status and progress updates to a designated team channel via the Slack Web API.
Features
- Single Tool:
slack-progress-update- Send formatted progress notifications to a pre-configured Slack channel - OAuth Bot Token Authentication: Secure authentication using Slack bot tokens with proper scopes
- Rich Formatting: Uses Slack's Block Kit for well-formatted messages with emojis and structured content
- Static Channel Configuration: Messages sent to a single channel configured via environment variable
- Thread Support: Optional thread replies for organized conversations
- Multiple Status Types: Support for completed, failed, in_progress, warning, info, success, error, and running statuses
- Environment-based Configuration: Secure bot token configuration via environment variables
- Stdio Transport: Runs locally using stdio transport for easy integration
- Comprehensive Logging: Detailed logging for debugging and monitoring
- Connection Testing: Built-in connection validation on startup
Installation
Prerequisites
- Python 3.10 or higher
- A Slack workspace with app creation permissions
- UV package manager (recommended) or pip
Install Dependencies
Using UV (recommended):
cd slack-notifier-mcp
uv sync
Using pip:
cd slack-notifier-mcp
pip install -e .
Configuration
1. Create a Slack App and Get Bot Token
- Go to https://api.slack.com/apps
- Click "Create New App" → "From scratch"
- Enter an app name (e.g., "Agent Progress Notifier") and select your workspace
- In the sidebar, go to "OAuth & Permissions"
- Under "Bot Token Scopes", add these scopes:
chat:write(required) - Send messages as the botchat:write.public(optional) - Post to channels without joining them first
- Click "Install to Workspace" and authorize the app
- Copy the "Bot User OAuth Token" (starts with
xoxb-)
2. Add Bot to Channels
For the bot to send messages to channels, it needs to be added:
- Go to the Slack channel where you want notifications
- Type
/invite @YourBotNameor use the channel settings to add the bot - Alternatively, use the
chat:write.publicscope to post without joining
3. Set Environment Variables
Set the required environment variables:
export SLACK_BOT_TOKEN="xoxb-your-bot-token-here"
export SLACK_CHANNEL="general" # or your preferred channel name/ID
Or create a .env file:
echo "SLACK_BOT_TOKEN=xoxb-your-bot-token-here" >> .env
echo "SLACK_CHANNEL=general" >> .env
Usage
Running the Server
Start the MCP server using stdio transport:
# Using UV
uv run slack-notifier-mcp
# Or using the module directly
python -m slack_notifier_mcp.server
# Or using the convenient run script
python run.py # Production mode
python run.py --dev # Development mode with MCP Inspector
Using with MCP Clients
Once the server is running, MCP clients can connect to it and use the slack-progress-update tool.
Tool: slack-progress-update
Sends a progress update notification to the pre-configured Slack channel.
Parameters:
summary(required): Brief summary of what was accomplishedagent_name(required): Name of the agent performing the taskproject_name(required): Name of the projectdetails(optional): Detailed information about the taskstatus(optional): Status of the task - one of:completed(default) - ✅failed- ❌in_progress- 🔄warning- ⚠️info- ℹ️success- ✅error- ❌running- 🔄
timestamp(optional): ISO timestamp string (defaults to current time)task_id(optional): Task identifier for trackingthread_ts(optional): Thread timestamp to reply in a thread
Example Usage:
# Basic usage
result = client.call_tool("slack-progress-update", {
"summary": "Successfully processed 150 customer records",
"agent_name": "DataProcessor",
"project_name": "CustomerAnalytics",
"status": "completed"
})
# Detailed usage with all parameters
result = client.call_tool("slack-progress-update", {
"summary": "Data analysis pipeline completed",
"agent_name": "DataAnalysisAgent",
"project_name": "CustomerInsights",
"details": "Processed 1,250 rows, identified 23 anomalies, generated 5 reports",
"status": "completed",
"task_id": "TASK-2024-001",
"timestamp": "2024-01-15T10:30:00Z"
})
# Error notification with thread reply
result = client.call_tool("slack-progress-update", {
"summary": "Failed to connect to external API",
"agent_name": "APIConnectorAgent",
"project_name": "DataIntegration",
"details": "Connection timeout after 30 seconds. Will retry in 5 minutes.",
"status": "failed",
"thread_ts": "1642251234.123456" # Reply in existing thread
})
Example Slack Message Output
The tool generates rich, formatted messages in Slack that look like this:
CustomerInsights • DataAnalysisAgent
═══════════════════════════════════════
Project: CustomerInsights Agent: DataAnalysisAgent
Status: ✅ Completed Timestamp: 2024-01-15 10:30:00 UTC
Task ID: TASK-2024-001
Summary:
Data analysis pipeline completed
Details:
Processed 1,250 rows, identified 23 anomalies, generated 5 reports
Key Benefits for Multi-Project Workflows:
- Required identification: Every message must include both project and agent names
- Header shows project and agent for instant identification
- Project field clearly indicates which project the update relates to
- Agent field shows which agent performed the work
- Easy filtering in Slack search by project or agent name
- Consistent reporting ensures no messages are sent without proper context
Integration with Zed Editor
Zed is a modern code editor with built-in AI capabilities that supports MCP servers. You can integrate this Slack Notifier MCP server with Zed to send progress updates directly from your AI assistant sessions.
Prerequisites: Installing uvx
The recommended way to run this MCP server with Zed is using uvx, which allows you to run Python applications in isolated environments without manual installation.
Install UV (which includes uvx):
# On macOS and Linux
curl -LsSf https://astral.sh/uv/install.sh | sh
# On Windows
powershell -c "irm https://astral.sh/uv/install.sh | iex"
# Or using pip
pip install uv
Verify installation:
uvx --version
Why uvx?
- ✅ Automatic dependency management: uvx handles all Python dependencies automatically
- ✅ Isolated environments: No conflicts with your system Python or other projects
- ✅ Simple configuration: Just specify the package name, no paths needed
- ✅ Always up-to-date: Can automatically use the latest published version
Testing uvx with the package:
Before configuring Zed, test that uvx can run the package:
# Test that uvx can find and run the package
SLACK_BOT_TOKEN="test" SLACK_CHANNEL="test" uvx slack-notifier-mcp --help
# If the package isn't published yet, you can install from the local directory
uvx --from /path/to/slack-notifier-mcp slack-notifier-mcp --help
Note: If you're using an unpublished local version, you'll need to use the local development configuration in Zed (see Alternative configuration below).
Setting Up in Zed
Zed supports MCP servers through custom server configuration in your settings.json file. Here's how to set it up:
1. Configure the MCP Server (Recommended: uvx)
Add the following configuration to your Zed settings.json file (accessible via Cmd/Ctrl + , or the Command Palette → zed: open settings):
{
"context_servers": {
"slack-notifier": {
"source": "custom",
"command": "uvx",
"args": ["slack-notifier-mcp"],
"env": {
"SLACK_BOT_TOKEN": "xoxb-your-bot-token-here",
"SLACK_CHANNEL": "general"
}
}
}
}
This configuration:
- Uses
uvxto automatically handle dependencies - Runs the published
slack-notifier-mcppackage - Sets required environment variables for Slack integration
2. Alternative: Local Development
If you're working with a local development version:
{
"context_servers": {
"slack-notifier": {
"source": "custom",
"command": "python",
"args": ["/path/to/slack-notifier-mcp/run.py"],
"env": {
"SLACK_BOT_TOKEN": "xoxb-your-bot-token-here",
"SLACK_CHANNEL": "general"
}
}
}
}
3. Verify Installation
- Open Zed and access the Agent Panel (
Cmd/Ctrl + Shift + A) - Go to the Agent Panel settings (gear icon in top-right)
- Look for "slack-notifier" in the server list
- Check that the indicator dot is green, meaning "Server is active"
4. Using the Tool
Once configured, you can use the Slack notification tool in your AI conversations:
- Mention the server by name: "Use the slack-notifier to send a progress update"
- The AI assistant will use the
slack-progress-updatetool to send formatted messages to your configured Slack channel
5. Tool Approval Settings
By default, Zed may require approval for tool actions. To configure this:
{
"agent": {
"always_allow_tool_actions": true
}
}
Set to false if you want to manually approve each tool call.
6. Custom Profile (Optional)
For dedicated Slack notification workflows, you can create a custom profile that focuses on the Slack tools:
{
"agent": {
"profiles": {
"slack-notifications": {
"name": "Slack Notifications",
"tools": {
"thinking": true,
"fetch": false,
"terminal": false,
"edit_file": false
},
"enable_all_context_servers": false,
"context_servers": {
"slack-notifier": {
"tools": {
"slack-progress-update": true
}
}
}
}
}
}
}
Zed Troubleshooting
If you encounter issues with the Slack Notifier MCP server in Zed, try these solutions:
Server Not Active (Red/Yellow Indicator)
- Check uvx installation: Ensure
uvxis installed and available in your system PATH (uvx --version) - Verify environment variables: Make sure
SLACK_BOT_TOKENandSLACK_CHANNELare properly set in theenvsection - Test uvx manually: Try running
uvx slack-notifier-mcpin your terminal to see if it works - Check package availability: Ensure the
slack-notifier-mcppackage can be found by uvx - Review Zed logs: Open the Command Palette and run
zed: open log fileto see detailed error messages
Tool Not Being Used by AI Assistant
- Mention the server explicitly: Say "Use the slack-notifier to send an update" in your prompts
- Check tool approval settings: Ensure
always_allow_tool_actionsis set appropriately - Verify server is active: The indicator dot should be green in Agent Panel settings
- Try a custom profile: Create a dedicated profile that only enables the Slack notification tool
Configuration Issues
Command Problems:
// ❌ Wrong - using python directly
"command": "python",
"args": ["/some/path/run.py"]
// ✅ Correct - using uvx (recommended)
"command": "uvx",
"args": ["slack-notifier-mcp"]
// ✅ Alternative - local development
"command": "python",
"args": ["/absolute/path/to/slack-notifier-mcp/run.py"]
Package Name Issues:
// ❌ Wrong - incorrect package name
"args": ["slack-notifier"]
// ✅ Correct - exact package name
"args": ["slack-notifier-mcp"]
Environment Variable Problems:
// ❌ Wrong - missing required variables
"env": {
"SLACK_BOT_TOKEN": "xoxb-token"
// Missing SLACK_CHANNEL
}
// ✅ Correct - both variables set
"env": {
"SLACK_BOT_TOKEN": "xoxb-your-token",
"SLACK_CHANNEL": "general"
}
Testing the Integration
You can test if everything is working by asking the AI assistant:
"Please use the slack-notifier to send a test progress update saying 'Zed integration test completed' with status 'success'"
The assistant should use the slack-progress-update tool and you should see the message appear in your configured Slack channel.
Manual Testing
You can also test the uvx command directly:
# Set your environment variables
export SLACK_BOT_TOKEN="xoxb-your-token"
export SLACK_CHANNEL="general"
# Test the command that Zed will run
uvx slack-notifier-mcp
# The server should start and show connection confirmation
# Press Ctrl+C to stop
If this works in your terminal, it should work in Zed as well.
Development
Running in Development Mode
For development and testing, you can use the MCP development server:
uv run mcp dev src/slack_notifier_mcp/server.py
This will start the server with the MCP Inspector for easy testing.
Project Structure
slack-notifier-mcp/
├── src/
│ └── slack_notifier_mcp/
│ ├── __init__.py
│ └── server.py # Main server implementation
├── pyproject.toml # Project configuration
├── run.py # Convenient run script
├── README.md # This file
├── .env.example # Environment template
├── LICENSE # MIT license
└── .gitignore
Troubleshooting
Common Issues
-
"Slack bot token not configured" error
- Make sure the
SLACK_BOT_TOKENenvironment variable is set - Verify the bot token starts with
xoxb- - Check that the token hasn't been regenerated in your Slack app settings
- Make sure the
-
"Slack channel not configured" error
- Make sure the
SLACK_CHANNELenvironment variable is set - Use the channel name (without #) or channel ID
- Make sure the
-
"Channel not found" error
- Verify the configured channel name or ID is correct
- Make sure the bot has been added to the channel
- For private channels, the bot must be explicitly invited
-
"Not in channel" error
- Add the bot to the configured channel:
/invite @YourBotName - Or add the
chat:write.publicscope to post without joining
- Add the bot to the configured channel:
-
"Missing scope" error
- Go to your Slack app's "OAuth & Permissions" page
- Add the
chat:writescope under "Bot Token Scopes" - Reinstall the app to your workspace
-
"Invalid auth" error
- Your bot token may be expired or invalid
- Regenerate the token in your Slack app settings
- Update the
SLACK_BOT_TOKENenvironment variable
Debug Mode
Enable debug logging by setting the log level:
export PYTHONPATH=src
python -c "
import logging
logging.basicConfig(level=logging.DEBUG)
from slack_notifier_mcp.server import main
main()
"
Testing Connection
The server automatically tests the Slack connection on startup. You'll see a message like:
✅ Connected to Slack as: your-bot-name on team Your Team Name
Channel Configuration
The server sends messages to a single channel configured via the SLACK_CHANNEL environment variable.
Supported channel formats:
- Channel name:
general(without # prefix) - Channel ID:
C1234567890(recommended for reliability) - Private channels: Use channel ID, and bot must be invited
To find a channel ID:
- Right-click on the channel in Slack
- Select "Copy link"
- The channel ID is the part after
/archives/in the URL
Security Considerations
- Bot Token: Keep your Slack bot token secure and never commit it to version control
- Environment Variables: Use environment variables or secure secret management for bot tokens
- Scopes: Only grant necessary OAuth scopes to your bot
- Network: The server makes outbound HTTPS requests to Slack's API
Required Slack Scopes
Your Slack bot needs these OAuth scopes:
chat:write(required) - Send messages as the botchat:write.public(optional) - Post to public channels without joining
Contributing
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
License
This project is licensed under the MIT License. See the LICENSE file for details.