slack-mcp
A Model Context Protocol (MCP) server that enables AI assistants to interact with Slack workspaces. This server provides a bridge between AI tools and Slack, allowing you to read messages, post content, and manage Slack channels programmatically through MCP-compatible clients.
What is this and why should I use it?
This MCP server transforms your Slack workspace into an AI-accessible environment. It provides 21+ tools for comprehensive Slack interaction:
Message & Thread Operations
- Read channel history with date filtering and thread support
- Post messages and replies to threads
- Search messages across workspace or within specific channels
- Execute Slack commands
Channel Management
- List, join, create, and rename channels
- Look up channel IDs by name
- Invite users to channels
Reactions & Users
- Add and view emoji reactions
- Send direct messages and group DMs
- Manage usergroups (clear members)
Utility
- Check authentication status
- Cache management for performance
Key Benefits
- Seamless Integration: Connect your AI assistant directly to Slack without manual copy-pasting
- Automated Workflows: Build AI-powered Slack bots that can read, analyze, and respond to messages
- Enhanced Productivity: Let AI help manage notifications, summarize conversations, or automate routine Slack tasks
- Real-time Collaboration: Enable AI assistants to participate in team discussions and provide instant insights
Use Cases
- Team Assistant: Have an AI that can read team updates and provide summaries
- Notification Manager: Automatically categorize and respond to incoming messages
- Knowledge Base: AI that can search through channel history and provide context
- Meeting Scheduler: AI that can read meeting requests and help coordinate schedules
Setting Up with Claude Code
This repo ships as a Claude Code plugin with a guided setup skill. Claude will walk you through the entire process — no manual config editing required.
Run the setup script. It handles everything — venv, Playwright, token extraction, wrapper script, and Claude Code registration. The only interaction required is logging in to Slack when the browser opens, and entering a channel ID for server logs.
python3 <(curl -fsSL https://raw.githubusercontent.com/redhat-community-ai-tools/slack-mcp/main/scripts/setup-slack-mcp.py)
Or clone the repo first and run it locally:
git clone https://github.com/redhat-community-ai-tools/slack-mcp
python3 slack-mcp/scripts/setup-slack-mcp.py
Options:
| Flag | Description |
|---|
--logs-channel DXXXXXXXXX | Slack channel ID for server logs (prompted if omitted) |
--workspace https://myco.slack.com | Specific Slack workspace to open |
--refresh-tokens | Re-extract tokens when they expire (skips all other steps) |
--skip-verify | Skip the post-setup smoke test |
When tokens expire, just run:
python3 slack-mcp/scripts/setup-slack-mcp.py --refresh-tokens
Desktop App Token Refresh (Linux)
If you have the Slack desktop app installed, you can refresh tokens without opening a browser:
slack-mcp/scripts/slack-refresh-tokens --validate
This reads tokens directly from the desktop app's local storage on disk — no DevTools, no Playwright, no manual steps. Requires the Slack app to be signed in.
| Flag | Description |
|---|
--validate | Verify tokens against Slack's API after extraction |
--env | Print tokens as env vars to stdout (for piping into other tools) |
--output FILE | Write tokens to a custom path (default: ~/.local/share/slack-mcp/tokens.env) |
Requirements: python3, python3-cryptography, secret-tool (libsecret/gnome-keyring), curl, jq
This is useful for CI hooks or session startup scripts that need to silently refresh tokens before launching the MCP server.
Bot token authentication (recommended)
For better security, use a Slack App bot token (xoxb-) instead of browser session tokens. Bot tokens provide:
- Scoped access — only the OAuth permissions you grant, not full user access
- Distinct identity — actions appear as the bot, not as your user account
- Central management — IT can audit and revoke via the Slack admin panel
- No browser DevTools — tokens are generated once in the Slack App settings
Setup
- Create a Slack App at api.slack.com/apps
- Add OAuth scopes:
channels:read, channels:history, channels:manage, groups:read, groups:history, groups:write, chat:write, reactions:read, reactions:write, search:read, users:read, commands, mpim:write
- Install to your workspace and copy the Bot User OAuth Token (
xoxb-...)
- Invite the bot to channels it needs access to
Running with a bot token
Set SLACK_BOT_TOKEN instead of SLACK_XOXC_TOKEN/SLACK_XOXD_TOKEN: