MCP Server APIs
The MCP (Model Context Protocol) Server APIs provide programmatic interfaces for client libraries and applications to interact with Slack resources through a standardized protocol. For more information about MCP, see the official documentation.
Server Setup & Configuration
Before using the MCP Server APIs, you need to properly configure and deploy the server:
- 📋 Environment Configuration - Environment variables and authentication setup
- 🚀 Deployment Guide - Local, Docker, Kubernetes, and cloud deployment examples
- 🔧 CLI Reference - Complete command-line interface documentation
Deployment Modes
MCP Server supports two operational deployment modes:
- Standalone Mode - Dedicated MCP server for client library integration
- Integrated Mode - Combined MCP + Webhook server for complete Slack platform integration
For detailed deployment options and usage examples, see Server Modes.
Transport Options
MCP Server supports three transport mechanisms:
- stdio - Standard input/output communication (default)
- Server-Sent Events (SSE) - Event-based communication over HTTP
- Streamable HTTP - HTTP-based streaming communication
For detailed transport configuration, see the CLI Reference.
Available Tools
The following MCP tools are available for Slack integration:
- ✅ Post Message - Send text messages to Slack channels
- ✅ Read Channel Messages - Retrieve message history from channels
- ✅ Read Thread Messages - Retrieve messages from specific threads
- ✅ Thread Reply - Send replies to existing threads
- ✅ Read Emojis - Get all available workspace emojis
- ✅ Add Reactions - Add emoji reactions to messages
Tool Categories
Message Operations
slack_post_message- Send messages to channelsslack_thread_reply- Reply to existing threads
Data Retrieval
slack_read_channel_messages- Get channel message historyslack_read_thread_messages- Get thread conversation historyslack_read_emojis- Get workspace emoji information
Interactive Features
slack_add_reactions- Add emoji reactions to messages
Authentication
All MCP tools require a valid Slack bot token set in one of the following environment variables:
SLACK_BOT_TOKEN(recommended)SLACK_TOKEN(fallback)
Required OAuth Scopes
The bot must have appropriate OAuth scopes depending on the tools used:
| Tool | Required Scopes |
|---|---|
| Post Message | chat:write, channels:read |
| Read Channel Messages | channels:history, channels:read |
| Read Thread Messages | channels:history, channels:read |
| Thread Reply | chat:write, channels:read |
| Read Emojis | emoji:read |
| Add Reactions | reactions:write, channels:read |
Usage Examples
Basic Message Sending
{
"channel": "#general",
"text": "Hello from the MCP server!"
}
Reading Channel History
{
"channel": "#general",
"limit": 50
}
Adding Reactions
{
"channel": "#general",
"timestamp": "1234567890.123456",
"emojis": ["thumbsup", "heart"]
}
Error Handling
MCP Server API responses follow Slack's standard format. Successful responses have "ok": true, while errors have "ok": false with error details:
{
"ok": false,
"error": "channel_not_found",
"detail": "Value passed for channel was invalid."
}
Common Error Types
- Authentication Errors:
invalid_auth,not_authed - Permission Errors:
not_in_channel,channel_not_found - Rate Limiting:
rate_limited - Validation Errors:
invalid_ts,msg_too_long
Rate Limiting
Slack enforces rate limits on API endpoints. The server automatically handles retries according to Slack's rate limiting headers. Consider implementing client-side rate limiting for high-frequency operations.
Best Practices
- Error Handling: Always check the
okfield in responses - Channel Format: Use channel IDs (e.g.,
C1234567890) for better reliability - Token Security: Store tokens securely and never expose them in client-side code
- Rate Management: Implement appropriate delays between API calls
- Scope Minimization: Only request necessary OAuth scopes