Slack MCP Server

Slack MCP server provides AI assistants with full Slack workspace integration including channel management, messaging, threads, reactions, and user presence.

May 4, 2025
MCP ServerCommunication & EmailSlack MCP Server
GitHub starsnpm version

Overview

The Slack MCP Server connects AI assistants to your Slack workspace, enabling natural language interaction with channels, messages, threads, and users. Originally part of the official Anthropic MCP servers collection, it provides comprehensive access to Slack's API for team communication and collaboration.

Official MCP Server:

Originally from the official Anthropic modelcontextprotocol/servers collection (now archived). For a maintained alternative with DMs, message search, and multiple transports, see the korotovsky/slack-mcp-server community implementation.

Key Features

📨

Send & Receive Messages

Post messages to any channel or direct message conversation in your workspace

🧵

Thread Replies

Reply in threads to keep conversations organized and follow discussion history

📋

Channel Management

List, join, create channels, and manage channel membership and topics

🔍

Message Search

Search across all channels and messages to find specific information quickly

👤

User Presence

Check user status, presence, and profile information for team awareness

😄

Reactions & Emoji

Add and remove emoji reactions to messages for lightweight feedback

Available Tools

Quick Reference

ToolPurpose
send_messageSend a message to a channel or DM
reply_in_threadReply to a message in a thread
list_channelsList all channels in the workspace
get_channel_historyGet recent messages from a channel
search_messagesSearch across all Slack messages
get_user_infoGet user profile and presence information
add_reactionAdd an emoji reaction to a message

Detailed Usage

send_message

Send a message to any channel or direct message conversation.

{
  "channel": "C0123456789",
  "text": "Hello team! Here's the update on the project..."
}
search_messages

Search across your entire Slack workspace for messages matching your query.

{
  "query": "deployment timeline Q2",
  "count": 10
}
get_channel_history

Retrieve recent messages from a channel to catch up on conversations.

{
  "channel": "C0123456789",
  "limit": 50
}
get_user_info

Get user profile information and current presence status.

{
  "user": "U0123456789"
}

Installation

{
  "mcpServers": {
    "slack": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-slack"],
      "env": {
        "SLACK_BOT_TOKEN": "xoxb-your-bot-token",
        "SLACK_TEAM_ID": "T0123456789"
      }
    }
  }
}

Slack App Required:

Create a Slack app with the required scopes and install it to your workspace. Get your bot token from the Slack API dashboard.

Setup Guide

1. Create Slack App

  1. Go to Slack API Apps
  2. Click "Create New App"
  3. Choose "From scratch"
  4. Enter app name and select workspace
  5. Click "Create App"

2. Configure OAuth Scopes

Navigate to OAuth & Permissions and add these Bot Token Scopes:

Required Scopes:

  • channels:history - View messages in public channels
  • channels:read - View basic channel information
  • chat:write - Send messages as the bot
  • reactions:write - Add emoji reactions
  • users:read - View users in workspace
  • users:read.email - View user email addresses

Optional Scopes:

  • groups:history - View messages in private channels
  • groups:read - View private channel information
  • im:history - View direct messages
  • mpim:history - View group direct messages
  • files:read - View files shared in channels

3. Install App to Workspace

  1. Scroll to OAuth Tokens for Your Workspace
  2. Click "Install to Workspace"
  3. Review permissions and click "Allow"
  4. Copy the Bot User OAuth Token (starts with xoxb-)

4. Get Team ID

Option A: From Workspace URL

  • Your Slack URL: https://yourworkspace.slack.com
  • Team ID appears in workspace settings

Option B: Using API

curl https://slack.com/api/team.info \
  -H "Authorization: Bearer xoxb-your-token"

5. Configure MCP Server

Add the bot token and team ID to your MCP configuration as shown in the Installation section.

Use Cases

Team Updates

Ask AI to post standup summaries, project updates, or announcements to specific channels.

Information Retrieval

Search conversations to find decisions, references, or discussions from past messages.

Onboarding Assistant

Help new team members catch up on channel history and find relevant conversations.

Automated Responses

Set up AI to answer common questions in support or FAQ channels automatically.

Message Formatting

Markdown Support

Slack supports mrkdwn formatting:

  • *bold* - bold text
  • _italic_ - italic text
  • ~strikethrough~ - strikethrough text
  • `code` - inline code
  • ```code block``` - code block
  • <https://example.com|link text> - hyperlinks
  • <@U1234567890> - user mentions
  • <#C1234567890> - channel mentions

Block Kit

For rich message formatting:

{
  "blocks": [
    {
      "type": "header",
      "text": {
        "type": "plain_text",
        "text": "Deployment Report"
      }
    },
    {
      "type": "section",
      "text": {
        "type": "mrkdwn",
        "text": "*Status:* Success\n*Version:* 2.3.0"
      }
    },
    {
      "type": "divider"
    },
    {
      "type": "context",
      "elements": [
        {
          "type": "mrkdwn",
          "text": "Deployed by CI/CD Pipeline"
        }
      ]
    }
  ]
}

Best Practices

  1. Rate Limiting: Respect Slack API rate limits (1+ request per second)
  2. Channel Permissions: Only post to channels where the bot is a member
  3. Thread Etiquette: Use threads for follow-up discussions to keep channels organized
  4. Reaction Consistency: Use consistent emoji reactions for status indicators
  5. Message Formatting: Use Block Kit for rich, structured messages
  6. Error Handling: Check for API errors and handle gracefully
  7. User Privacy: Don't access DMs unless explicitly permitted

OAuth Scopes Reference

Bot Token Scopes (xoxb-)

ScopePermissionUse Case
channels:historyRead public channel messagesGet channel history
channels:readView public channelsList channels
chat:writeSend messagesPost messages
reactions:writeAdd reactionsAdd emoji reactions
reactions:readView reactionsSee message reactions
users:readView usersList workspace users
users:read.emailView user emailsGet user profiles
groups:historyRead private channel messagesAccess private channels
im:historyRead DMsAccess direct messages
mpim:historyRead group DMsAccess group messages
files:readView filesAccess shared files

Security Considerations

Token Security:

Never commit Slack tokens to version control. Use environment variables or secure credential management.

  1. Token Storage: Store tokens securely using environment variables
  2. Scope Minimization: Request only necessary OAuth scopes
  3. Channel Whitelisting: Restrict message posting to specific channels
  4. Token Rotation: Regenerate tokens periodically
  5. Audit Logging: Monitor bot activity for unexpected behavior
  6. User Privacy: Respect user privacy when accessing DMs
  7. Workspace Permissions: Ensure bot has appropriate workspace-level permissions

Troubleshooting

Common Issues

Issue: "not_in_channel" error

  • Invite the bot to the channel first: /invite @BotName
  • Ensure bot has channels:history scope

Issue: "missing_scope" error

  • Add required OAuth scope in Slack app settings
  • Reinstall app to workspace to apply new scopes

Issue: Messages not appearing

  • Verify channel ID is correct
  • Check bot is member of channel
  • Ensure chat:write scope is granted

Issue: Cannot read channel history

  • Bot must be invited to channel
  • Verify channels:history scope exists
  • Check channel type (public vs private)

Issue: Rate limit errors

  • Implement exponential backoff
  • Reduce request frequency
  • Batch operations when possible

Performance Tips

  1. Cache User Data: Store user list locally to reduce API calls
  2. Batch Requests: Combine multiple operations when possible
  3. Use Pagination: Retrieve large datasets in chunks
  4. Filter Channels: Restrict to relevant channels only
  5. Optimize History Requests: Request only necessary message count
  6. Implement Caching: Cache channel metadata and user profiles

Limitations

  • Rate Limits: Tier-based rate limits (1+ req/sec for tier 1)
  • Message Size: Messages limited to 40,000 characters
  • Channel Access: Bot must be invited to private channels
  • File Upload: Limited file upload capabilities
  • DM Access: Requires specific scopes and user permissions
  • App Mentions: Requires events API for real-time mentions

Resources

Sources