A Slack MCP server lets your AI coding agent read messages, search conversations, and post updates to Slack without you switching windows. This guide covers the three main implementations, exact setup commands for Claude Code and Cursor, OAuth scopes, safety controls, and troubleshooting.
What Is a Slack MCP Server
The Model Context Protocol (MCP) is an open standard for connecting AI tools to external systems. An MCP server exposes a set of tools that an AI client (Claude Code, Claude Desktop, Cursor, VS Code) can call during a conversation.
A Slack MCP server exposes Slack operations as those tools. When you ask your AI assistant to "check what the team said about the API migration in #backend," it calls conversations_history or slack_get_channel_history directly. When you want to post a deployment summary, it calls a message posting tool with the channel ID and text.
The practical result: your AI agent has real-time access to team conversations. It does not hallucinate what someone said last Tuesday. It reads the actual messages.
MCP servers work across AI clients
A Slack MCP server is not tied to one AI tool. The same server configuration works with Claude Code, Claude Desktop, Cursor, Windsurf, and any other MCP-compatible client. You configure it once and every AI tool in your workflow can read and write to Slack.
The Three Implementations
Three Slack MCP servers cover different needs. The choice depends on whether you need search, how you feel about write safety, and which token type you can use.
korotovsky/slack-mcp-server
The most capable option. 15 tools including message search, user groups, DMs, and unread tracking. Written in Go. Supports browser session tokens (xoxc/xoxd) for full API access. Write operations disabled by default. 1,400+ stars.
Official Archived Server
The original Anthropic implementation. 8 tools: list channels, post messages, reply to threads, add reactions, get history, get thread replies, list users, get user profiles. Bot token only (xoxb-). Archived May 2025, still functional.
Zencoder Fork
Maintained fork of the official server. Same 8 tools with updated MCP SDK (v1.13.2), Zod schema validation, improved error handling, and HTTP transport support. Available via npm as @zencoderai/slack-mcp-server.
Why the original was archived
Anthropic archived the official Slack MCP server in May 2025 as part of moving community-maintained servers out of the core repository. The code still works. Zencoder picked up maintenance with SDK updates. The korotovsky server was built independently and has become the most popular option by star count.
Creating a Slack App
All three servers need Slack API credentials. For bot token setups (the official and Zencoder servers), you create a Slack app and grant OAuth scopes. The korotovsky server can also use browser session tokens, which skip this step entirely.
Bot Token Setup (xoxb-)
Go to api.slack.com/apps and create a new app. Under OAuth & Permissions, add these scopes:
| Scope | Required For | Server |
|---|---|---|
| channels:history | Reading channel messages | All |
| channels:read | Listing channels | All |
| chat:write | Posting messages | All |
| reactions:write | Adding emoji reactions | All |
| users:read | Listing workspace users | All |
| users.profile:read | Reading user profiles | All |
| search:read | Searching messages (user token only) | ubie-oss |
| usergroups:read | Listing user groups | korotovsky |
| usergroups:write | Creating/updating user groups | korotovsky |
| groups:history | Private channel history | korotovsky |
| im:history | Direct message history | korotovsky |
| mpim:history | Group DM history | korotovsky |
Install the app to your workspace. Copy the Bot User OAuth Token (starts with xoxb-) and your Team ID (starts with T, visible in your workspace URL or under Settings).
Browser Session Token Setup (xoxc/xoxd)
The korotovsky server supports browser session tokens for full API access including search. Extract these from your browser's developer tools while logged into Slack:
- Open Slack in your browser (not the desktop app)
- Open DevTools (F12) and go to the Network tab
- Look for any API request to
api.slack.com - Copy the
tokenparameter from the request body (starts withxoxc-) - Copy the
dcookie value from the request headers (starts withxoxd-)
Token capabilities
Bot tokens (xoxb-) are stable but limited: no search, only invited channels, no DMs. Browser session tokens (xoxc/xoxd) can do everything you can do in Slack, but they expire periodically. For development and personal use, browser tokens are more capable. For team or CI/CD use, bot tokens are more reliable.
Setup for Claude Code
Claude Code supports MCP servers via the CLI or a .mcp.json file. The CLI approach is fastest for personal setup. The file approach shares configuration with your team.
Official Archived Server (via npx)
Add official Slack MCP server to Claude Code
claude mcp add slack \
-e SLACK_BOT_TOKEN=xoxb-your-bot-token \
-e SLACK_TEAM_ID=T0123456789 \
-- npx -y @modelcontextprotocol/server-slackkorotovsky Server (via Docker)
Add korotovsky Slack MCP server to Claude Code
# With browser session tokens (full access including search)
claude mcp add slack \
-e SLACK_MCP_XOXC_TOKEN=xoxc-your-token \
-e SLACK_MCP_XOXD_TOKEN=xoxd-your-cookie \
-e SLACK_MCP_ADD_MESSAGE_TOOL=true \
-- docker run -i --rm ghcr.io/korotovsky/slack-mcp-server:latest
# With bot token (limited, no search)
claude mcp add slack \
-e SLACK_MCP_XOXB_TOKEN=xoxb-your-bot-token \
-e SLACK_MCP_ADD_MESSAGE_TOOL=true \
-- docker run -i --rm ghcr.io/korotovsky/slack-mcp-server:latestProject-Scoped Configuration (.mcp.json)
For team-shared configuration, add a .mcp.json file to your project root. Token values reference environment variables so secrets stay out of version control.
.mcp.json (official server)
{
"mcpServers": {
"slack": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-slack"],
"env": {
"SLACK_BOT_TOKEN": "${SLACK_BOT_TOKEN}",
"SLACK_TEAM_ID": "${SLACK_TEAM_ID}"
}
}
}
}.mcp.json (korotovsky server with Docker)
{
"mcpServers": {
"slack": {
"command": "docker",
"args": ["run", "-i", "--rm",
"-e", "SLACK_MCP_XOXC_TOKEN",
"-e", "SLACK_MCP_XOXD_TOKEN",
"-e", "SLACK_MCP_ADD_MESSAGE_TOOL=true",
"ghcr.io/korotovsky/slack-mcp-server:latest"
],
"env": {
"SLACK_MCP_XOXC_TOKEN": "${SLACK_MCP_XOXC_TOKEN}",
"SLACK_MCP_XOXD_TOKEN": "${SLACK_MCP_XOXD_TOKEN}"
}
}
}
}Setup for Claude Desktop and Cursor
Claude Desktop
Edit your claude_desktop_config.json (found in ~/Library/Application Support/Claude/ on macOS or %APPDATA%\Claude\ on Windows).
claude_desktop_config.json (official server)
{
"mcpServers": {
"slack": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-slack"],
"env": {
"SLACK_BOT_TOKEN": "xoxb-your-bot-token",
"SLACK_TEAM_ID": "T0123456789"
}
}
}
}claude_desktop_config.json (korotovsky server)
{
"mcpServers": {
"slack": {
"command": "docker",
"args": [
"run", "-i", "--rm",
"-e", "SLACK_MCP_XOXC_TOKEN=xoxc-your-token",
"-e", "SLACK_MCP_XOXD_TOKEN=xoxd-your-cookie",
"-e", "SLACK_MCP_ADD_MESSAGE_TOOL=true",
"ghcr.io/korotovsky/slack-mcp-server:latest"
]
}
}
}Cursor
Open Cursor Settings, navigate to the MCP section, and add a new server. The JSON format matches Claude Desktop. You can also edit .cursor/mcp.json in your project root.
.cursor/mcp.json
{
"mcpServers": {
"slack": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-slack"],
"env": {
"SLACK_BOT_TOKEN": "xoxb-your-bot-token",
"SLACK_TEAM_ID": "T0123456789"
}
}
}
}Available Tools
The number and capability of tools varies by implementation. The korotovsky server has the broadest coverage.
Official Archived Server (8 tools)
| Tool | Description | Key Parameters |
|---|---|---|
| slack_list_channels | List public channels with pagination | limit (max 200), cursor |
| slack_post_message | Post a message to a channel | channel_id, text |
| slack_reply_to_thread | Reply in a thread | channel_id, thread_ts, text |
| slack_add_reaction | Add an emoji reaction | channel_id, timestamp, reaction |
| slack_get_channel_history | Get recent messages | channel_id, limit (default 10) |
| slack_get_thread_replies | Get all replies in a thread | channel_id, thread_ts |
| slack_get_users | List workspace members | cursor, limit |
| slack_get_user_profile | Get detailed user profile | user_id |
korotovsky Server (15 tools)
| Tool | Description | Token Required |
|---|---|---|
| conversations_history | Fetch channel messages (by time or count) | Any |
| conversations_replies | Get thread replies with pagination | Any |
| conversations_add_message | Post messages (disabled by default) | Any |
| conversations_search_messages | Search messages with filters | xoxc/xoxp only |
| conversations_unreads | Get unread messages across channels | xoxc/xoxp only |
| conversations_mark | Mark channel as read (disabled by default) | Any |
| channels_list | List channels with sorting | Any |
| reactions_add | Add emoji reaction | Any |
| reactions_remove | Remove emoji reaction | Any |
| users_search | Find users by name or email | Any |
| usergroups_list | List user groups | Any |
| usergroups_create | Create a user group | xoxc/xoxp only |
| usergroups_update | Update group metadata | xoxc/xoxp only |
| usergroups_users_update | Update group membership | xoxc/xoxp only |
| usergroups_me | Join/leave user groups | xoxc/xoxp only |
Resource endpoints (korotovsky only)
The korotovsky server also exposes two MCP resources: slack://workspace/channels (CSV of all channels with member counts) and slack://workspace/users (CSV of workspace users). These give the AI a full directory of your workspace without making repeated API calls.
Comparison of Implementations
| Feature | korotovsky | Official Archived | Zencoder Fork |
|---|---|---|---|
| Stars | 1,400+ | N/A (archived) | 62 |
| Language | Go | TypeScript | TypeScript |
| Tools | 15 | 8 | 8 |
| Message Search | Yes (xoxc/xoxp) | No | No |
| DM Support | Yes | No | No |
| User Groups | Yes | No | No |
| Unread Tracking | Yes | No | No |
| Bot Token (xoxb) | Yes | Yes | Yes |
| Browser Token (xoxc) | Yes | No | No |
| User OAuth (xoxp) | Yes | No | No |
| Write Safety Controls | Disabled by default | Enabled by default | Enabled by default |
| Channel Whitelisting | Yes (per env var) | Yes (SLACK_CHANNEL_IDS) | No |
| Docker Image | Yes | Yes | Yes |
| HTTP Transport | Yes (SSE + HTTP) | Stdio only | Yes (Stdio + HTTP) |
| GovSlack Support | Yes | No | No |
| Last Updated | Active | May 2025 (archived) | Active |
The korotovsky server wins on features, safety defaults, and maintenance. The official archived server wins on simplicity: fewer moving parts, straightforward bot token auth, and the npx install works without Docker. If you need search, DMs, or granular write controls, use korotovsky. If you need basic channel reading and posting, the official server is fine.
Safety and Write Controls
Giving an AI agent write access to your team's Slack workspace is a legitimate concern. An agent posting to the wrong channel or accidentally marking hundreds of messages as read can cause real disruption.
korotovsky Server Safety Model
Write operations are off by default. You explicitly enable each one:
Enabling write operations (environment variables)
# Enable posting to ALL channels
SLACK_MCP_ADD_MESSAGE_TOOL=true
# Enable posting to SPECIFIC channels only (safer)
SLACK_MCP_ADD_MESSAGE_TOOL=C0123456789,C9876543210
# Blacklist specific channels (post to all except these)
SLACK_MCP_ADD_MESSAGE_TOOL=!C0123456789
# Enable mark-as-read
SLACK_MCP_MARK_TOOL=true
# Auto-mark messages as read after sending
SLACK_MCP_ADD_MESSAGE_MARK=true
# Whitelist domains for link unfurling
SLACK_MCP_ADD_MESSAGE_UNFURLING=github.com,slack.comRead-Only Mode (Default)
Start with read-only access. The agent can list channels, read history, search messages, and look up users. No messages sent, no reactions added, nothing marked as read. Safe for exploring what the server can do.
Scoped Write Access
Enable posting to specific channels by ID. The agent can read everything but only write to channels you have explicitly approved. Good for deployment notification channels or team-specific channels.
Official server has no safety controls
The official archived server enables all write operations by default. Any channel the bot has been invited to is writable. The optional SLACK_CHANNEL_IDS environment variable restricts which channels are visible (and therefore writable), but there is no separate read/write permission model. If safety matters, use the korotovsky server.
Common Use Cases
Deployment Notifications
Your coding agent finishes a deploy and posts a summary to #deployments with the commit hash, changed files, and any test results. No manual copy-paste from terminal to Slack.
Context Gathering Before Code Changes
Before modifying a feature, the agent searches Slack for recent discussions about it. It reads the #product channel thread where the PM described the requirements and the #backend thread where the team discussed the API contract.
Standup Automation
The agent reads your recent git commits and open PRs, then posts a formatted standup update to #daily-standup. It cross-references Slack threads you participated in to add context about what you were working on.
Bug Investigation
When a bug report comes in via Slack, the agent reads the thread, searches for related messages, checks the relevant code via a git MCP server, identifies the issue, and posts its analysis back to the thread.
Multi-Server Workflows
The Slack MCP server is most powerful when paired with other MCP servers. A typical development workflow uses three:
- Git MCP server for repository operations (diff, commit, branch, log)
- GitHub MCP server for platform operations (issues, PRs, Actions)
- Slack MCP server for team communication (reading context, posting updates)
The agent reads a Slack thread about a bug, checks the relevant code via git, creates a fix on a new branch, opens a PR on GitHub, and posts the PR link back to the Slack thread. Four MCP servers, one continuous workflow.
For codebases over 50k lines, adding WarpGrep as an MCP server gives the agent semantic code search. Instead of grep-style string matching, it finds code by meaning: "where is the payment retry logic?" returns the right files even if the code never uses the word "retry." The combination of Slack context + semantic code search lets the agent go from a Slack bug report to the relevant code in seconds.
Troubleshooting
403 Errors on Specific Operations
Missing OAuth scopes. Each tool requires specific scopes. If slack_get_channel_history returns 403, your bot is missing channels:history. Go to your Slack app settings, add the scope, and reinstall the app to the workspace.
Empty Channel History
Bot tokens (xoxb-) can only read channels the bot has been invited to. If a channel returns empty, invite the bot: type /invite @your-bot-name in that channel. Browser session tokens (xoxc/xoxd) do not have this limitation.
Search Not Working
The Slack search API is not available to bot tokens. If you need search, use the korotovsky server with browser session tokens (xoxc/xoxd) or user OAuth tokens (xoxp). The official archived server does not include a search tool at all.
Rate Limiting
Slack's API rate limits hit at roughly 1 request per second for most Web API methods. Tier 1 methods (like chat.postMessage) allow 1 request per second. Tier 3 methods (like conversations.history) allow 50+ per minute. If the agent hits rate limits during heavy use, the server will receive 429 Too Many Requests responses. The korotovsky server handles retry logic internally.
Browser Token Expiration
xoxc/xoxd tokens expire when your Slack browser session expires. If the server suddenly stops working after days/weeks, extract fresh tokens from your browser. Some users automate this with a browser extension, but there is no official supported method for long-lived xoxc tokens.
Docker Connection Issues
If Docker-based setup fails with connection errors, verify Docker is running and the image pulls successfully. Run docker run --rm ghcr.io/korotovsky/slack-mcp-server:latest --version to test. For network issues behind a corporate proxy, set SLACK_MCP_PROXY to your proxy URL.
Frequently Asked Questions
What is a Slack MCP server?
A Slack MCP server is a Model Context Protocol server that gives AI assistants direct access to your Slack workspace. It exposes tools for listing channels, reading message history, posting messages, searching conversations, adding reactions, and looking up user profiles. AI clients like Claude Code, Cursor, and Claude Desktop call these tools during conversations.
Which Slack MCP server should I use?
For most developers, korotovsky/slack-mcp-server (1,400+ stars) is the best option. It has 15 tools, supports message search, user groups, and DMs, and disables write operations by default. The official archived server is simpler (8 tools, bot token only) and works well for basic read/post workflows.
What OAuth scopes do I need?
Minimum for the official server: channels:history, channels:read, chat:write, reactions:write, users:read, users.profile:read. The korotovsky server with browser session tokens inherits your existing permissions, so no additional scopes are needed.
Can the Slack MCP server search messages?
Only with the right token type and server. Bot tokens (xoxb-) cannot access Slack's search API. The korotovsky server supports search via conversations_search_messages using browser session tokens (xoxc/xoxd) or user OAuth tokens (xoxp). The official archived server has no search tool.
Is it safe to give an AI agent write access to Slack?
The korotovsky server disables write operations by default. You explicitly enable posting via SLACK_MCP_ADD_MESSAGE_TOOL and can restrict it to specific channel IDs. This prevents accidental messages to the wrong channel. The official server enables writes by default, so the korotovsky server is safer for production use.
What is the difference between xoxb and xoxc tokens?
xoxb- tokens are bot tokens: stable, require explicit OAuth scopes, limited to invited channels, no search. xoxc- tokens are browser session tokens: inherit your full permissions, support search, access all visible channels, but expire periodically. Use xoxb for team/production use, xoxc for personal development.
Can I use this with Cursor or VS Code?
Yes. Both support MCP server configuration. The JSON format is identical to Claude Desktop. Add it to .cursor/mcp.json for Cursor or VS Code MCP settings. The server binary runs the same way regardless of the client.
How do I restrict which channels the agent can access?
The official server supports SLACK_CHANNEL_IDS as a comma-separated list of channel IDs. The korotovsky server's channel caching includes all visible channels, but write operations can be restricted to specific channel IDs via SLACK_MCP_ADD_MESSAGE_TOOL=C123,C456.
Related MCP Server Guides
Add Semantic Code Search to Your MCP Stack
WarpGrep indexes your codebase and works as an MCP server alongside Slack, Git, and GitHub. Find code by meaning, not keywords. Go from a Slack bug report to the relevant code in seconds.