Labsco
SilasReinagel logo

Slack Webhook

from SilasReinagel

Post messages to Slack channels using incoming webhooks or bot tokens.

πŸ”₯πŸ”₯πŸ”₯βœ“ VerifiedFreeAdvanced setup

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 (<!channel>, <!here>, <@USERID>)
  • Comprehensive error handling and validation

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: <@U1234567890>
  • Channel notification: <!channel>
  • Here notification: <!here>

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

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