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.
claude_desktop_config.json{
"mcpServers": {
"slack": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-slack"
],
"env": {
"SLACK_BOT_TOKEN": "xoxb-xxxxxxxx",
"SLACK_TEAM_ID": "T01234567"
}
}
}
}Generate & Test Slack MCP Server Config
One-click export with environment variables & path locators for Claude Desktop, Cursor, Windsurf, and OpenAI Codex CLI.
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
- ▸Visit api.slack.com/apps (opens in a new tab).
- ▸Click Create New App → From scratch.
- ▸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
- ▸
- ▸Click Install to Workspace.
- ▸Copy the generated Bot User OAuth Token.
Configuration Setup
Add the integration to your MCP client config file:
{
"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
#engineeringchannel 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
#generalsummarizing 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 @YourBotNameinside the Slack channel you want it to access. - ▸Use Threads: Instruct your agent to use the
reply_to_threadtool rather thanpost_messagewhen responding to existing conversations to avoid flooding the channel feed.
Using with OpenAI Codex
Add this server to the OpenAI Codex CLI:
codex mcp add --name slack-mcp-server-setup --command "npx" --args "-y @modelcontextprotocol/server-slack@2025.4.25"The version above is pinned to the release this guide was verified against. Check for a newer one before upgrading:
npm view @modelcontextprotocol/server-slack versionReference: Configuring MCP servers with OpenAI Codex.
Weekly Protocol Diffs & Verified Drops
New server guides, benchmarks, and security audits. No spam. Unsubscribe anytime.
Zero marketing spam. 1-click unsubscribe anytime.
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.
Did this setup guide work with your AI host?
Help test this configuration across Claude, Cursor, and Codex CLI. Be the first to report:
How to Connect Slack to AI Agents with the Slack MCP Server FAQ
What is the 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.
How do I configure How to Connect Slack to AI Agents with the Slack MCP Server in Claude Desktop or Cursor?
You can copy the configuration JSON from our guide or launch the interactive MCP Codex Config Generator at https://mcp-codex.com/generator to export valid configs in 1 click.
Can I use How to Connect Slack to AI Agents with the Slack MCP Server with the OpenAI Codex CLI?
Yes, OpenAI Codex CLI supports Model Context Protocol. You can add it directly to ~/.codex/config.toml or pass arguments to codex mcp add.
Specializing in Model Context Protocol (MCP) integrations, autonomous AI agent orchestration, and distributed developer toolchains. Researches and benchmarks production MCP client-server architectures across OpenAI Codex, Claude, and Cursor.
Related Guides
Multi-Client SSE Remote Connections in MCP
Implement remote multi-client SSE transports in Model Context Protocol. Manage per-session HTTP streams, CORS boundaries, and reverse proxy buffering.
CommunicationEmail Automation Workflows: Orchestrating Gmail and Resend Safely with MCP
Create secure email flows. Whitelist recipient domains, compose email templates, and trigger Gmail drafts programmatically with MCP.