trackmcp
Back to directory
SilasReinagel

slack-notify-mcp

View on GitHub

Slack Webhook

0 stars JavaScriptOthers Updated Jul 21, 2025

Documentation

Slack Webhook MCP Server

A Model Context Protocol (MCP) server for posting messages to Slack via webhooks or bot tokens.

Features

  • Two modes of operation: Webhooks or Bot API
  • Post messages to Slack channels
  • Support for channel overrides
  • Configurable bot username and emoji
  • Slack-specific mention support (``, ``, ``)
  • Comprehensive error handling and validation

Installation

bash
bun install

Setup

Option 1: Webhook Mode (Simple)

1. Create a Slack App and Webhook:

    2. Configure MCP Client:

    json
    {
      "mcpServers": {
        "slack-webhook": {
          "command": "bun",
          "args": [
            "run", 
            "src/index.ts",
            "--webhook-url",
            "https://hooks.slack.com/services/YOUR/SLACK/WEBHOOK",
            "--channel",
            "#general"
          ],
          "cwd": "/path/to/slack-webhook-mcp-server"
        }
      }
    }

    Option 2: Bot Token Mode (Advanced)

    1. Create a Slack App with Bot Token:

      2. Get Channel IDs:

        3. Configure MCP Client:

        json
        {
          "mcpServers": {
            "slack-bot": {
              "command": "bun",
              "args": [
                "run", 
                "src/index.ts",
                "--bot-token",
                "xoxb-YOUR-BOT-TOKEN",
                "--channel",
                          "CXXXXXXXXXX",
                "--username",
                "MCP Bot"
              ],
              "cwd": "/path/to/slack-webhook-mcp-server"
            }
          }
        }

        Usage

        Command Line Arguments

        Webhook Mode:

        • `--webhook-url ` - Slack webhook URL (required)
        • `--channel ` - Default channel name (optional, e.g., "#general")

        Bot Mode:

        • `--bot-token ` - Slack bot token (required, starts with `xoxb-`)
        • `--channel ` - Default channel ID (required, e.g., "CXXXXXXXXXX")

        Common Options:

        • `--username ` - Default bot username (optional)
        • `--icon-emoji ` - Default bot emoji (optional, e.g., ":robot_face:")
        • `--help` - Show help message

        Examples

        Webhook Mode:

        bash
        bun run src/index.ts \
          --webhook-url "https://hooks.slack.com/services/T00000000/B00000000/XXXXXXXXXXXXXXXXXXXXXXXX" \
          --channel "#general" \
          --username "Assistant"

        Bot Mode:

        bash
        bun run src/index.ts \
          --bot-token "xoxb-YOUR-BOT-TOKEN" \
          --channel "CXXXXXXXXXX" \
          --username "Assistant"

        Available Tools

        `post_slack_message`

        Post a message to your configured Slack integration.

        Parameters:

        • `message` (required): The message content to send (max 4000 characters)
        • `channel` (optional): Channel to post to (overrides default)
          • Webhook mode: Channel name (e.g., "#random")
          • Bot mode: Channel ID (e.g., "CXXXXXXXXXX")
        • `username` (optional): Override the default username for this message
        • `icon_emoji` (optional): Override the default emoji for this message

        Example usage in MCP client:

        code
        Please post "Hello from MCP!" to the general channel

        Mode Comparison

        FeatureWebhook ModeBot Mode
        SetupSimpleRequires OAuth setup
        Channel ReferenceNames (#general)IDs (CXXXXXXXXXX)
        PermissionsLimited to webhook channelConfigurable scopes
        Rate LimitsHigherStandard API limits
        FeaturesBasic messagingFull API access
        AuthenticationURL-basedToken-based

        Slack-Specific Features

        Mentions

        • User mention: ``
        • Channel notification: ``
        • Here notification: ``

        Channel References

        • Webhook mode: Use `#channel-name` format
        • Bot mode: Use channel IDs like `CXXXXXXXXXX`

        Development

        Scripts

        • `bun run start` - Start the server
        • `bun run dev` - Start with file watching
        • `bun run build` - Build for production

        Project Structure

        code
        slack-webhook-mcp-server/
        ├── package.json          # Dependencies and scripts
        ├── src/
        │   └── index.ts         # Main server implementation  
        ├── types/
        │   └── slack.ts         # TypeScript types and schemas
        └── README.md            # This file

        Error Handling

        The server includes comprehensive error handling for:

        • Invalid webhook URLs and bot tokens
        • Network connectivity issues
        • Slack API errors (different handling for webhook vs bot)
        • Message length validation (4000 char limit)
        • Channel ID validation (bot mode)
        • Malformed requests

        License

        MIT

        Frequently asked questions

        What is slack-notify-mcp?

        slack-notify-mcp is Slack Webhook

        How do I install slack-notify-mcp?

        Open the GitHub repository and follow its README. Most MCP servers are added to your client's MCP config, then called by your agent.

        Is slack-notify-mcp open source?

        Yes — it is hosted on GitHub at https://github.com/SilasReinagel/slack-notify-mcp.

        Related MCP tools

        Run your own MCP server? See who uses it and what to fix.

        Measure it with TrackMCP