Skip to main content
Version: 0.0.1

Slack Post Message MCP API

The Slack Post Message MCP API allows you to send text messages to Slack channels using the Model Context Protocol interface. For more information about MCP, see the official documentation.

Tool Informationโ€‹

slack_post_messageโ€‹

  • Tool name: slack_post_message
  • Function: send_slack_message
  • Description: Send text to the given Slack channel. This is the primary tool for delivering textual notifications to Slack channels on behalf of the user.

Input Parametersโ€‹

The tool accepts a SlackPostMessageInput object with the following parameters:

ParameterTypeRequiredDescription
channelstringYesSlack channel ID (e.g., C12345678) or name with # (e.g., #general)
textstringYesThe plain-text message to post (up to 40 kB)

Usage Examplesโ€‹

Basic Messageโ€‹

{
"channel": "#general",
"text": "Hello from the MCP server! This is a test message."
}

Channel ID Formatโ€‹

{
"channel": "C1234567890",
"text": "Build completed successfully! โœ…"
}

Multi-line Messageโ€‹

{
"channel": "#notifications",
"text": "Deployment Status:\nโ€ข Database migration: Complete\nโ€ข Application deployment: Complete\nโ€ข Health checks: Passed"
}

Response Formatโ€‹

The tool returns the raw JSON response from Slack's chat.postMessage API:

{
"ok": true,
"channel": "C1234567890",
"ts": "1234567890.123456",
"message": {
"text": "Hello from the MCP server!",
"user": "U12345678",
"ts": "1234567890.123456",
"team": "T1234567890",
"type": "message"
}
}

Key Response Fieldsโ€‹

FieldDescription
okBoolean indicating if the operation was successful
channelThe channel ID where the message was posted
tsTimestamp of the posted message (used as message ID)
messageThe complete message object that was posted

Error Handlingโ€‹

This function may raise errors in the following situations:

  • Missing or invalid Slack API token
  • Invalid channel name or ID
  • Insufficient permissions to post in the channel
  • Network connectivity issues
  • API rate limiting
  • Message too long (exceeds 40 kB limit)

Error responses will have "ok": false and include an error message:

{
"ok": false,
"error": "channel_not_found",
"detail": "Value passed for channel was invalid."
}

Common Error Codesโ€‹

Error CodeDescriptionSolution
channel_not_foundChannel doesn't exist or bot lacks accessVerify channel name/ID and bot permissions
not_in_channelBot is not a member of the channelInvite the bot to the channel
invalid_authInvalid or missing API tokenCheck SLACK_BOT_TOKEN environment variable
rate_limitedToo many requests sentImplement rate limiting in your application
msg_too_longMessage exceeds 40,000 charactersShorten the message or split into multiple messages

Use Casesโ€‹

Typical scenarios for using slack_post_message:

  • Build/Deployment Notifications: Alert team channels about build or deployment status
  • Automated Reminders: Send scheduled reminders or summaries after completing tasks
  • Event Broadcasting: Share important events like incident reports or announcements
  • Status Updates: Provide real-time updates on long-running processes
  • Integration Alerts: Forward notifications from external systems to Slack

Authenticationโ€‹

This tool requires a valid Slack bot token set in one of the following environment variables:

  • SLACK_BOT_TOKEN (recommended)
  • SLACK_TOKEN (fallback)

The bot must have the following OAuth scopes:

  • chat:write - Required to post messages
  • channels:read - Required to access public channels
  • groups:read - Required to access private channels (if needed)

Rate Limitingโ€‹

Slack enforces rate limits on the chat.postMessage API:

  • Tier 1: 1+ message per second
  • Tier 2: 20+ messages per minute
  • Tier 3: 50+ messages per minute
  • Tier 4: 100+ messages per minute

The server will automatically handle retries according to Slack's rate limiting headers.