Slack MCP Server
Send messages and interact with Slack workspaces.
Overview
| Property | Value |
|---|---|
| Package | @modelcontextprotocol/server-slack |
| Source | GitHub |
| Transport | stdio |
Installation
npx -y @modelcontextprotocol/server-slack
Configuration
mcp_servers:
- name: slack
command: npx
args: ["-y", "@modelcontextprotocol/server-slack"]
env:
SLACK_BOT_TOKEN: ${SLACK_BOT_TOKEN}
SLACK_TEAM_ID: ${SLACK_TEAM_ID}
Required Environment Variables
SLACK_BOT_TOKEN: Bot User OAuth Token (starts withxoxb-)SLACK_TEAM_ID: Your Slack workspace ID
Bot Token Scopes
Your Slack app needs these OAuth scopes:
channels:history- View messages in public channelschannels:read- View basic channel infochat:write- Send messagesreactions:write- Add reactionsusers:read- View users
Tools
slack_list_channels
List all channels in the workspace.
Parameters: None
Returns: Array of channel objects with id, name, and topic
slack_post_message
Post a message to a channel.
Parameters:
channel_id(string, required): Channel IDtext(string, required): Message text
Example:
{
"tool": "slack_post_message",
"arguments": {
"channel_id": "C01234ABCDE",
"text": "Deployment completed successfully! :rocket:"
}
}
slack_reply_to_thread
Reply to a thread.
Parameters:
channel_id(string, required): Channel IDthread_ts(string, required): Thread timestamptext(string, required): Reply text
slack_add_reaction
Add a reaction to a message.
Parameters:
channel_id(string, required): Channel IDtimestamp(string, required): Message timestampreaction(string, required): Emoji name (without colons)
Example:
{
"tool": "slack_add_reaction",
"arguments": {
"channel_id": "C01234ABCDE",
"timestamp": "1234567890.123456",
"reaction": "white_check_mark"
}
}
slack_get_channel_history
Get recent messages from a channel.
Parameters:
channel_id(string, required): Channel IDlimit(number, optional): Number of messages (default: 10)
slack_get_thread_replies
Get replies to a thread.
Parameters:
channel_id(string, required): Channel IDthread_ts(string, required): Thread timestamp
slack_get_users
List users in the workspace.
Parameters: None
Returns: Array of user objects
slack_get_user_profile
Get a user's profile.
Parameters:
user_id(string, required): User ID
Use Cases
Alert Notifier Agent
apiVersion: aof.sh/v1alpha1
kind: Agent
metadata:
name: alert-notifier
spec:
model: google:gemini-2.5-flash
mcp_servers:
- name: slack
command: npx
args: ["-y", "@modelcontextprotocol/server-slack"]
env:
SLACK_BOT_TOKEN: ${SLACK_BOT_TOKEN}
SLACK_TEAM_ID: ${SLACK_TEAM_ID}
system_prompt: |
You send alert notifications to Slack:
1. Format alerts clearly with severity indicators
2. Use appropriate emojis for alert types
3. Include actionable information
4. Thread follow-up messages
Incident Coordinator
apiVersion: aof.sh/v1alpha1
kind: Agent
metadata:
name: incident-coordinator
spec:
model: google:gemini-2.5-flash
mcp_servers:
- name: slack
command: npx
args: ["-y", "@modelcontextprotocol/server-slack"]
env:
SLACK_BOT_TOKEN: ${SLACK_BOT_TOKEN}
SLACK_TEAM_ID: ${SLACK_TEAM_ID}
system_prompt: |
You coordinate incidents via Slack:
- Create incident threads
- Post status updates
- Tag relevant team members
- Track resolution progress
- Post postmortem summaries
Deployment Announcer
apiVersion: aof.sh/v1alpha1
kind: Agent
metadata:
name: deploy-announcer
spec:
model: google:gemini-2.5-flash
mcp_servers:
- name: slack
command: npx
args: ["-y", "@modelcontextprotocol/server-slack"]
env:
SLACK_BOT_TOKEN: ${SLACK_BOT_TOKEN}
SLACK_TEAM_ID: ${SLACK_TEAM_ID}
system_prompt: |
You announce deployments to Slack:
- Pre-deployment notifications
- Progress updates
- Success/failure notifications
- Rollback alerts
Format messages with:
- Environment name
- Version being deployed
- Expected duration
- Rollback plan
Message Formatting
Basic Formatting
*bold* _italic_ ~strikethrough~ `code`
Code Blocks
```python
print("Hello, World!")
```
Links
<https://example.com|Link Text>
User Mentions
<@U01234ABCDE> mentioned you
Channel Links
Check <#C01234ABCDE|channel-name>
Creating a Slack App
- Go to https://api.slack.com/apps
- Click "Create New App"
- Choose "From scratch"
- Name your app and select workspace
- Go to "OAuth & Permissions"
- Add required Bot Token Scopes
- Install app to workspace
- Copy Bot User OAuth Token
Rate Limits
Slack API has rate limits:
- Tier 1: 1+ per minute (basic reads)
- Tier 2: 20+ per minute (common operations)
- Tier 3: 50+ per minute (posting messages)
- Tier 4: 100+ per minute (high-volume)
The server handles rate limiting with automatic retries.
Troubleshooting
Invalid Token
Verify your token is correct:
curl -H "Authorization: Bearer $SLACK_BOT_TOKEN" \
https://slack.com/api/auth.test
Missing Scopes
Check app permissions at: https://api.slack.com/apps/YOUR_APP_ID/oauth
Channel Not Found
Ensure the bot is invited to the channel:
/invite @your-bot-name
Rate Limited
Wait for the retry-after period or reduce request frequency.