CommunicationΒ·
intermediate
Β·11 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 seamlessly.

Slackmessagingteam communicationautomationworkspace
Interactive Tool
1-Click Export

Generate & Test Slack MCP Server Config

One-click export with environment variables & path locators for Claude Desktop, Cursor, Windsurf, and OpenAI Codex CLI.

Open in Generator

Connect Slack to AI Agents with MCP

The Slack MCP server enables AI agents to interact directly with your Slack workspace. By acting as an automated participant, your agent can read channel histories, post structured updates, manage conversations, and even react to messages with emojis.

Prerequisites

  • β–ΈSlack workspace Administrator or App Manager access.
  • β–ΈA Slack Bot Token (xoxb-...).
  • β–ΈNode.js 18+ installed on your host machine.

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:
    • β–Έchannels:history β€” Read public channel messages
    • β–Έchannels:read β€” List available channels
    • β–Έchat:write β€” Post messages as the bot
    • β–Έusers:read β€” View user profiles
    • β–Έreactions:write β€” Add emoji reactions
  4. β–ΈClick Install to Workspace.
  5. β–ΈCopy the generated Bot User OAuth Token.

Configuration Setup

Add the integration to your MCP client config file:

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

Available Tools

  • β–Έlist_channels β€” Browse workspace channels.
  • β–Έpost_message β€” Send messages to channels or individuals.
  • β–Έreply_to_thread β€” Reply inside existing message threads.
  • β–Έadd_reaction β€” React to messages with emojis.
  • β–Έget_channel_history β€” Read recent messages from a channel.
  • β–Έget_thread_replies β€” Read deep thread conversations.
  • β–Έsearch_messages β€” Full-text search across the workspace.

Example Workflows

  • β–ΈDaily Standup Summary: "Summarize today's messages in the #engineering channel and highlight any action items or blockers."
  • β–ΈCross-Channel Analysis: "Search for all mentions of 'deployment' across all channels in the last week and create a summary."
  • β–ΈAutomated Responses: "Post a message to #general summarizing the key architectural decisions we just made in this chat."

Best Practices & Troubleshooting

  • β–ΈPrinciple of Least Privilege: Only grant the OAuth scopes your specific use case requires. Do not grant groups:history (private channels) unless absolutely necessary.
  • β–ΈBot Not In Channel Error: A Slack bot cannot read or post to a channel until it is explicitly invited. Type /invite @YourBotName inside the Slack channel you want it to access.
  • β–ΈUse Threads: Instruct your agent to use the reply_to_thread tool rather than post_message when responding to existing conversations to avoid flooding the channel feed.

Using with OpenAI Codex

You can use this MCP server with the OpenAI Codex CLI by adding it to your configuration:

bash
codex mcp add --name slack --command "npx -y @modelcontextprotocol/server-slack" --env SLACK_BOT_TOKEN=xoxb-your-token

For a full list of recommended servers, see Best MCP Servers for OpenAI Codex.

Ready to Deploy?

Build your full agent toolstack in the Visual Generator

Combine How to Connect Slack to AI Agents with the Slack with databases, search APIs, and memory graphs in a single configuration file.

Customize in Generator

Related Guides