Back to Codex
Communication·
intermediate
·10 min read·Apr 4, 2026

How to Connect Slack to AI Agents with the Slack MCP Server

Integrate Slack with your AI agent using MCP. Read messages, post updates, manage channels, and automate Slack workflows.

Slackmessagingteam communicationautomationworkspace

Connect Slack to AI Agents with MCP

The Slack MCP server enables AI agents to interact with your Slack workspace — reading channels, posting messages, and managing conversations.

Prerequisites

  • Slack workspace admin access
  • A Slack Bot Token (
    code
    xoxb-...
    )
  • Node.js 18+

Creating a Slack Bot Token

  1. Visit api.slack.com/apps
  2. Click Create New App → From scratch
  3. Under OAuth & Permissions, add these Bot Token Scopes:
    • code
      channels:history
      — Read channel messages
    • code
      channels:read
      — List channels
    • code
      chat:write
      — Post messages
    • code
      users:read
      — View user info
    • code
      reactions:write
      — Add reactions
  4. Install the app to your workspace
  5. Copy the Bot User OAuth Token

Configuration

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

Available Tools

  • code
    list_channels
    — Browse workspace channels
  • code
    post_message
    — Send messages to channels
  • code
    reply_to_thread
    — Reply in message threads
  • code
    add_reaction
    — React to messages with emoji
  • code
    get_channel_history
    — Read recent messages
  • code
    get_thread_replies
    — Read thread conversations
  • code
    search_messages
    — Full-text search across workspace
  • code
    get_users
    — List workspace members
  • code
    get_user_profile
    — Get user details

Example Workflows

Daily Standup Summary

code
"Summarize today's messages in the #engineering channel and highlight action items"

Cross-Channel Analysis

code
"Search for all mentions of 'deployment' across channels in the last week and create a summary"

Automated Responses

code
"Post a message to #general summarizing the key decisions from #leadership-sync"

Best Practices

  1. Principle of least privilege: Only grant the scopes your use case requires
  2. Audit bot actions: Monitor what the bot posts
  3. Use threads: Reply in threads to avoid flooding channels
  4. Rate limiting: Slack has API rate limits; the server handles retries automatically