masseater/slack-webhook-mcp
If you are the rightful owner of slack-webhook-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 henry@mcphub.com.
A Model Context Protocol (MCP) server that facilitates sending messages from LLM applications to Slack channels using incoming webhooks.
Slack Webhook MCP Server
A Model Context Protocol (MCP) server that enables LLM applications like Claude Desktop to send messages to Slack channels via incoming webhooks.
Features
- Send plain text or markdown-formatted messages to Slack
- Simple and secure webhook URL management
- Built with Deno for modern TypeScript development
- Full test coverage
Installation
Prerequisites
- Deno installed on your system
- A Slack workspace with incoming webhooks enabled
- Claude Desktop (or another MCP-compatible client)
Setup
-
Clone this repository:
git clone https://github.com/yourusername/slack-webhook-mcp.git cd slack-webhook-mcp
-
Create a Slack incoming webhook:
- Go to your Slack workspace's App Directory
- Search for "Incoming WebHooks" and add it
- Choose a channel and create a webhook URL
- Copy the webhook URL (it should look like
https://hooks.slack.com/services/T00000000/B00000000/XXXXXXXXXXXXXXXXXXXXXXXX
)
-
Configure your environment:
cp .env.example .env # Edit .env and add your webhook URL
Configuration
Claude Desktop
Add this server to your Claude Desktop configuration file:
~/Library/Application Support/Claude/claude_desktop_config.json
{
"mcpServers": {
"slack-webhook": {
"command": "deno",
"args": ["run", "--allow-net", "--allow-env", "--allow-read", "/path/to/slack-webhook-mcp/src/index.ts"],
"env": {
"SLACK_WEBHOOK_URL": "https://hooks.slack.com/services/YOUR/WEBHOOK/URL"
}
}
}
}
Using Compiled Binary
You can also compile the server to a standalone executable:
deno task build
Then use the binary in your configuration:
{
"mcpServers": {
"slack-webhook": {
"command": "/path/to/slack-webhook-mcp/slack-webhook-server",
"env": {
"SLACK_WEBHOOK_URL": "https://hooks.slack.com/services/YOUR/WEBHOOK/URL"
}
}
}
}
Usage
Once configured, you can use the following tool in Claude Desktop:
send_slack_message
Send a message to your configured Slack channel.
Parameters:
message
(required): The message text to sendwebhook_url
(optional): Override the default webhook URLformat
(optional): Message format - "text" or "markdown" (default: "markdown")
Examples:
- "Send a Slack message saying the deployment was successful"
- "Notify the team on Slack that the tests are passing"
- "Send 'Build failed: timeout in test suite' to Slack with plain text format"
Development
Available Commands
# Run in development mode with auto-reload
deno task dev
# Run tests
deno task test
# Run tests with coverage
deno task test:coverage
# Type checking
deno task check
# Linting
deno task lint
# Format code
deno task fmt
# Build standalone executable
deno task build
Project Structure
slack-webhook-mcp/
āāā src/
ā āāā index.ts # Entry point
ā āāā server.ts # MCP server implementation
ā āāā tools/
ā ā āāā slack_webhook.ts # Slack webhook tool
ā ā āāā slack_webhook_test.ts # Tool tests
ā āāā types.ts # TypeScript types
ā āāā index_test.ts # Integration tests
āāā deno.json # Deno configuration
āāā README.md # This file
āāā .env.example # Environment variables example
Security
- Never commit your
.env
file or webhook URLs to version control - Webhook URLs are validated to ensure they match Slack's format
- All errors are handled gracefully without exposing sensitive information
Contributing
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature
) - Run tests and ensure they pass (
deno task test
) - Commit your changes (
git commit -m 'Add amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
License
This project is licensed under the MIT License - see the LICENSE file for details.
Acknowledgments
- Built using the Model Context Protocol SDK
- Powered by Deno
- Integrates with Slack Incoming Webhooks