| name | slack-mcp-server |
| description | MCP server enabling Claude Code to send messages, read channels, manage threads, and search Slack workspaces with HITL approval for external communications. Use when Claude needs Slack integration for team communication, notifications, or workflow automation. |
Slack MCP Server
Overview
The Slack MCP Server is a Model Context Protocol (MCP) server built with FastMCP that enables Claude Code to interact with Slack workspaces. It provides secure, human-monitored access to Slack functionality with Human-in-the-Loop (HITL) enforcement for sensitive operations such as messaging external channels, sending DMs to new users, file uploads, and bulk messaging.
Prerequisites
Slack Bot Token
- Create a Slack App at https://api.slack.com/apps
- Navigate to OAuth & Permissions
- Add the following Bot Token Scopes:
| Scope | Purpose |
|---|
channels:read | List and get info about public channels |
channels:history | Read messages in public channels |
groups:read | List and get info about private channels |
groups:history | Read messages in private channels |
chat:write | Send messages as the bot |
files:write | Upload files |
files:read | Read file metadata |
reactions:write | Add emoji reactions |
reactions:read | Read emoji reactions |
search:read | Search messages in the workspace |
users:read | Read user profiles |
im:history | Read DM history |
im:write | Open DM channels |
- Install the app to your workspace
- Copy the Bot User OAuth Token (starts with
xoxb-)
Environment Variables
SLACK_BOT_TOKEN=xoxb-your-bot-token
SLACK_APP_TOKEN=xapp-your-app-token
SLACK_DEFAULT_CHANNEL=general
SLACK_SIGNING_SECRET=your-signing-secret
Quick Start
pip install -r .claude/skills/slack-mcp-server/assets/requirements.txt
export SLACK_BOT_TOKEN=xoxb-your-bot-token
python .claude/skills/slack-mcp-server/scripts/slack_mcp_server.py
MCP Tools
Available Operations
| Tool | Description | HITL Required |
|---|
send_message | Send a message to a channel or thread | External channels only |
read_channel | Read recent messages from a channel | No |
search_messages | Search messages across the workspace | No |
list_channels | List channels in the workspace | No |
get_channel_info | Get detailed channel information | No |
upload_file | Upload a file to a channel | Always |
add_reaction | Add an emoji reaction to a message | No |
get_thread | Get all replies in a thread | No |
Python Usage
from slack_mcp_server import create_slack_mcp_server
server = create_slack_mcp_server()
server.run()
Tool Examples
await send_message(channel="#general", text="Hello from Claude!")
await send_message(channel="#general", text="Reply here", thread_ts="1234567890.123456")
messages = await read_channel(channel="#general", limit=10)
results = await search_messages(query="deployment update", count=5)
await upload_file(channel="#general", content="Report data...", filename="report.txt", title="Daily Report")
await add_reaction(channel="#general", timestamp="1234567890.123456", emoji="thumbsup")
thread = await get_thread(channel="#general", thread_ts="1234567890.123456")
HITL Controls
Approval Matrix
| Action | Condition | HITL Required |
|---|
| Send message | Internal channel | No |
| Send message | External/shared channel | Yes |
| Send DM | Previously messaged user | No |
| Send DM | New user (first contact) | Yes |
| Upload file | Any channel | Yes |
| Bulk messages | More than 3 in 60 seconds | Yes |
| Add reaction | Any message | No |
| Read channel | Any channel | No |
| Search messages | Any query | No |
Approval Workflow
- Claude requests a HITL-gated operation
- An approval request is written to
Pending_Approval/ directory
- Human reviews and approves or rejects via the approval file
- On approval, the operation executes and result is returned
- All decisions are audit-logged
Configuration
config_manager.py Settings
@dataclass
class SlackConfig:
bot_token: str
app_token: str
default_channel: str
hitl_enabled: bool
hitl_external_channels: bool
hitl_new_dm_users: bool
hitl_file_uploads: bool
hitl_bulk_threshold: int
hitl_bulk_window_seconds: int
rate_limit_per_minute: int
rate_limit_per_second: int
audit_log_path: str
approval_dir: str
approval_timeout_seconds: int
Rate Limiting
The server enforces Slack API rate limits:
- Tier 1: 1 request per second (most write operations)
- Tier 2: 20 requests per minute (search, list operations)
- Tier 3: 50 requests per minute (read operations)
Custom rate limits can be configured via SlackConfig.
Architecture
slack_mcp_server.py -- FastMCP server with 8 tool endpoints
approval_workflow.py -- HITL approval engine with file-based workflow
config_manager.py -- Configuration dataclass and environment loader
Security Considerations
- Bot tokens are loaded from environment variables, never hardcoded
- All write operations are audit-logged with timestamps and context
- HITL approval is enforced for sensitive operations before execution
- Rate limiting prevents accidental API abuse
- File uploads always require human approval regardless of destination
- The approval directory should have restricted filesystem permissions
Resources
scripts/
Python scripts for the FastMCP server, HITL approval workflow, and configuration management.
assets/
Requirements file and configuration templates.
The Slack MCP server enables secure and compliant Slack workspace operations with appropriate human oversight.