Slack MCP Server

Slack MCP servers enable AI models to interact with Slack workspaces, providing capabilities for channel management, message posting, thread handling, and team collaboration workflows.

GitHub starsnpm version

Overview

The Slack MCP Server enables AI models to interact with Slack workspaces through the Model Context Protocol. This server provides comprehensive access to channels, messages, threads, reactions, and user information for team collaboration and workflow automation.

Official Server (Archived) + Community:

Official: Developed by Anthropic (now archived)

Community: korotovsky/slack-mcp-server - Enhanced implementation with DMs, search, and multiple transport support

Key Features

💬

Message Management

Post messages, reply to threads, and manage conversations across channels

📋

Channel Operations

List, search, and retrieve channel information and history

🔍

Message Search

Search messages across channels, DMs, and threads with filters

👥

User Management

Access user profiles, lists, and team member information

Available Tools

Quick Reference

ToolPurposeCategory
slack_list_channelsList workspace channelsChannels
slack_post_messageSend message to channelMessaging
slack_reply_to_threadReply to message threadMessaging
slack_add_reactionAdd emoji reactionReactions
slack_get_channel_historyRetrieve channel messagesHistory
slack_get_thread_repliesGet thread responsesThreads
slack_get_usersList workspace usersUsers
slack_get_user_profileGet user detailsUsers
slack_search_messagesSearch across workspaceSearch

Detailed Usage

slack_list_channels

Retrieve list of public channels in the workspace with pagination support.

// List all channels (default: 100)
use_mcp_tool({
  server_name: "slack",
  tool_name: "slack_list_channels",
  arguments: {}
});

// List channels with custom limit
use_mcp_tool({
  server_name: "slack",
  tool_name: "slack_list_channels",
  arguments: {
    limit: 50
  }
});

// Paginate through channels
use_mcp_tool({
  server_name: "slack",
  tool_name: "slack_list_channels",
  arguments: {
    limit: 100,
    cursor: "dXNlcjpVMDYxTkZUVDI="
  }
});

Returns channel IDs, names, and basic metadata.

slack_post_message

Post a message to a specific channel.

// Simple text message
use_mcp_tool({
  server_name: "slack",
  tool_name: "slack_post_message",
  arguments: {
    channel_id: "C1234567890",
    text: "Hello from Claude!"
  }
});

// Message with formatting
use_mcp_tool({
  server_name: "slack",
  tool_name: "slack_post_message",
  arguments: {
    channel_id: "C1234567890",
    text: "*Bold text*, _italic text_, and `code`"
  }
});

// Message with blocks (rich formatting)
use_mcp_tool({
  server_name: "slack",
  tool_name: "slack_post_message",
  arguments: {
    channel_id: "C1234567890",
    text: "Fallback text",
    blocks: [
      {
        type: "section",
        text: {
          type: "mrkdwn",
          text: "Project *Alpha* is ready for review"
        }
      }
    ]
  }
});

Returns message timestamp and channel ID.

slack_reply_to_thread

Reply to an existing message thread.

use_mcp_tool({
  server_name: "slack",
  tool_name: "slack_reply_to_thread",
  arguments: {
    channel_id: "C1234567890",
    thread_ts: "1234567890.123456",
    text: "This is a reply to the thread"
  }
});

// Reply and broadcast to channel
use_mcp_tool({
  server_name: "slack",
  tool_name: "slack_reply_to_thread",
  arguments: {
    channel_id: "C1234567890",
    thread_ts: "1234567890.123456",
    text: "Important update for everyone",
    reply_broadcast: true
  }
});

Returns reply message timestamp.

slack_add_reaction

Add an emoji reaction to a message.

// Add thumbs up
use_mcp_tool({
  server_name: "slack",
  tool_name: "slack_add_reaction",
  arguments: {
    channel_id: "C1234567890",
    timestamp: "1234567890.123456",
    reaction: "thumbsup"
  }
});

// Add custom emoji
use_mcp_tool({
  server_name: "slack",
  tool_name: "slack_add_reaction",
  arguments: {
    channel_id: "C1234567890",
    timestamp: "1234567890.123456",
    reaction: "rocket"
  }
});

Returns success confirmation.

slack_get_channel_history

Retrieve recent messages from a channel.

// Get last 10 messages (default)
use_mcp_tool({
  server_name: "slack",
  tool_name: "slack_get_channel_history",
  arguments: {
    channel_id: "C1234567890"
  }
});

// Get last 50 messages
use_mcp_tool({
  server_name: "slack",
  tool_name: "slack_get_channel_history",
  arguments: {
    channel_id: "C1234567890",
    limit: 50
  }
});

// Get messages with time range
use_mcp_tool({
  server_name: "slack",
  tool_name: "slack_get_channel_history",
  arguments: {
    channel_id: "C1234567890",
    oldest: "1234567890.000000",
    latest: "1234567900.000000"
  }
});

Returns array of messages with timestamps, text, and user IDs.

slack_get_thread_replies

Retrieve all replies in a message thread.

use_mcp_tool({
  server_name: "slack",
  tool_name: "slack_get_thread_replies",
  arguments: {
    channel_id: "C1234567890",
    thread_ts: "1234567890.123456"
  }
});

// Get replies with pagination
use_mcp_tool({
  server_name: "slack",
  tool_name: "slack_get_thread_replies",
  arguments: {
    channel_id: "C1234567890",
    thread_ts: "1234567890.123456",
    limit: 100
  }
});

Returns array of thread messages in chronological order.

slack_get_users

List all users in the workspace with basic profile information.

// Get all users
use_mcp_tool({
  server_name: "slack",
  tool_name: "slack_get_users",
  arguments: {}
});

// Get users with pagination
use_mcp_tool({
  server_name: "slack",
  tool_name: "slack_get_users",
  arguments: {
    limit: 100,
    cursor: "dXNlcjpVMDYxTkZUVDI="
  }
});

Returns user IDs, names, real names, and status.

slack_get_user_profile

Get detailed profile information for a specific user.

use_mcp_tool({
  server_name: "slack",
  tool_name: "slack_get_user_profile",
  arguments: {
    user_id: "U1234567890"
  }
});

Returns full profile including email, phone, title, and custom fields.

slack_search_messages

Community Implementation:

This tool is available in community implementations like korotovsky/slack-mcp-server

Search messages across channels, DMs, and threads.

// Search by keyword
use_mcp_tool({
  server_name: "slack",
  tool_name: "slack_search_messages",
  arguments: {
    query: "project alpha"
  }
});

// Search with date range
use_mcp_tool({
  server_name: "slack",
  tool_name: "slack_search_messages",
  arguments: {
    query: "deployment",
    after: "2024-01-01",
    before: "2024-12-31"
  }
});

// Search by user
use_mcp_tool({
  server_name: "slack",
  tool_name: "slack_search_messages",
  arguments: {
    query: "review",
    from: "U1234567890"
  }
});

Returns matching messages with context and metadata.

Installation

Official Slack MCP Server (Archived)

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

Optional: Restrict to specific channels

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

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.

Common Use Cases

1. Automated Status Updates

Post automated updates to team channels:

// Post deployment notification
use_mcp_tool({
  server_name: "slack",
  tool_name: "slack_post_message",
  arguments: {
    channel_id: "C1234567890",
    text: ":rocket: Deployment to production completed successfully!\n\n*Version:* v2.3.0\n*Time:* 14:30 UTC\n*Changes:* 15 commits merged"
  }
});

// Add reaction to confirm
use_mcp_tool({
  server_name: "slack",
  tool_name: "slack_add_reaction",
  arguments: {
    channel_id: "C1234567890",
    timestamp: "1234567890.123456",
    reaction: "white_check_mark"
  }
});

2. Thread-Based Discussions

Manage threaded conversations:

// Get original message context
use_mcp_tool({
  server_name: "slack",
  tool_name: "slack_get_channel_history",
  arguments: {
    channel_id: "C1234567890",
    limit: 1
  }
});

// Reply to thread with summary
use_mcp_tool({
  server_name: "slack",
  tool_name: "slack_reply_to_thread",
  arguments: {
    channel_id: "C1234567890",
    thread_ts: "1234567890.123456",
    text: "Thread summary:\n• Issue identified\n• Fix deployed\n• Tests passing"
  }
});

// Get all thread replies
use_mcp_tool({
  server_name: "slack",
  tool_name: "slack_get_thread_replies",
  arguments: {
    channel_id: "C1234567890",
    thread_ts: "1234567890.123456"
  }
});

3. Team Notifications

Send targeted notifications to team members:

// Get team members
use_mcp_tool({
  server_name: "slack",
  tool_name: "slack_get_users",
  arguments: {}
});

// Post notification with mentions
use_mcp_tool({
  server_name: "slack",
  tool_name: "slack_post_message",
  arguments: {
    channel_id: "C1234567890",
    text: "<@U1234567890> <@U0987654321> Code review needed for PR #123"
  }
});

4. Channel Activity Monitoring

Track channel activity and conversations:

// Get recent channel activity
use_mcp_tool({
  server_name: "slack",
  tool_name: "slack_get_channel_history",
  arguments: {
    channel_id: "C1234567890",
    limit: 50
  }
});

// Search for specific mentions
use_mcp_tool({
  server_name: "slack",
  tool_name: "slack_search_messages",
  arguments: {
    query: "urgent OR priority",
    after: "2024-12-01"
  }
});

5. Onboarding Automation

Automate new team member onboarding:

// Welcome message to general channel
use_mcp_tool({
  server_name: "slack",
  tool_name: "slack_post_message",
  arguments: {
    channel_id: "C1234567890",
    text: "Welcome to the team, <@U1234567890>! :tada:"
  }
});

// Post onboarding checklist
use_mcp_tool({
  server_name: "slack",
  tool_name: "slack_post_message",
  arguments: {
    channel_id: "C1234567890",
    blocks: [
      {
        type: "section",
        text: {
          type: "mrkdwn",
          text: "*Onboarding Checklist*\n:white_large_square: Complete profile\n:white_large_square: Review docs\n:white_large_square: Setup dev environment"
        }
      }
    ]
  }
});

6. Workflow Automation

Create automated workflows and bot interactions:

// Monitor for keywords
use_mcp_tool({
  server_name: "slack",
  tool_name: "slack_get_channel_history",
  arguments: {
    channel_id: "C1234567890",
    limit: 10
  }
});

// Auto-respond to requests
use_mcp_tool({
  server_name: "slack",
  tool_name: "slack_reply_to_thread",
  arguments: {
    channel_id: "C1234567890",
    thread_ts: "1234567890.123456",
    text: "I've created a ticket for this issue: PROJ-1234"
  }
});

// Add status reaction
use_mcp_tool({
  server_name: "slack",
  tool_name: "slack_add_reaction",
  arguments: {
    channel_id: "C1234567890",
    timestamp: "1234567890.123456",
    reaction: "eyes"  // Acknowledge request
  }
});

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.

Security Best Practices

  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