slack-fast-mcp
A Slack MCP server that gives AI assistants tools to read, search, and interact with Slack workspaces.
README
slack-fast-mcp
A Slack MCP server built with FastMCP that gives AI assistants tools to read, search, and interact with Slack workspaces. Python 3.13+, fully async.
Features
Read tools (always available):
conversations_history— Get messages from a channel or DMconversations_replies— Get a thread of messagesconversations_search_messages— Search messages with filters (requires user token)channels_list— List channelsusers_search— Search users by name, email, or display nameattachment_get_data— Download file attachments (up to 5MB)
Write tools (disabled by default, opt-in via env vars):
conversations_add_message— Post a message to a channel or DMreactions_add/reactions_remove— Add or remove emoji reactions
Resources:
slack://{workspace}/users— User directoryslack://{workspace}/channels— Channel directory
Authentication
Three authentication methods are supported, in priority order:
1. User token (recommended)
Requires a Slack app with user token scopes. Supports all features including message search.
export SLACK_MCP_XOXP_TOKEN=xoxp-...
2. Bot token
Requires a Slack app with bot token scopes. Cannot search messages.
export SLACK_MCP_XOXB_TOKEN=xoxb-...
3. Browser cookie auth (no app install required)
Uses your existing Slack browser session. No Slack app installation or workspace admin approval needed — useful when your workspace restricts app installs.
export SLACK_MCP_XOXC_TOKEN=xoxc-...
export SLACK_MCP_XOXD_TOKEN=xoxd-...
Both values must be set together. To extract them:
- Open your Slack workspace in a browser and log in
- Open DevTools (F12)
- xoxc token — paste this in the browser console:
JSON.parse(localStorage.localConfig_v2).teams[document.location.pathname.match(/^\/client\/([A-Z0-9]+)/)[1]].token - xoxd token — go to Application > Cookies >
https://app.slack.com, copy the value of the cookie namedd
Caveats:
- Tokens are tied to your browser session and will expire when you log out or Slack rotates sessions. You'll need to re-extract them periodically.
- All API calls appear as your user account, not a bot.
- This uses standard Slack API endpoints with session cookies — it does not use undocumented internal APIs.
Installation
uv sync --all-extras
Usage
export SLACK_MCP_XOXP_TOKEN=xoxp-... # or xoxb/xoxc+xoxd (see above)
uv run python -m slack_fast_mcp
Claude Desktop / Claude Code
Add to your MCP config:
{
"mcpServers": {
"slack": {
"command": "uv",
"args": ["run", "--project", "/path/to/slack-fast-mcp", "python", "-m", "slack_fast_mcp"],
"env": {
"SLACK_MCP_XOXP_TOKEN": "xoxp-..."
}
}
}
}
Configuration
All configuration is via environment variables.
Token (required — one of)
| Variable | Description |
|---|---|
SLACK_MCP_XOXP_TOKEN |
User OAuth token (priority 1) |
SLACK_MCP_XOXB_TOKEN |
Bot OAuth token (priority 2) |
SLACK_MCP_XOXC_TOKEN |
Browser session token (priority 3, requires XOXD too) |
SLACK_MCP_XOXD_TOKEN |
Browser d cookie value (priority 3, requires XOXC too) |
Write tool gating (optional)
Write tools are disabled by default. Enable them with these env vars. Each accepts:
"true"or"1"— enable for all channels- Comma-separated channel IDs — allowlist (e.g.
C001,C002) !-prefixed channel IDs — blocklist (e.g.!C003,!C004)
| Variable | Controls |
|---|---|
SLACK_MCP_ADD_MESSAGE_TOOL |
conversations_add_message |
SLACK_MCP_REACTION_TOOL |
reactions_add / reactions_remove |
SLACK_MCP_ATTACHMENT_TOOL |
attachment_get_data |
Other options
| Variable | Default | Description |
|---|---|---|
SLACK_MCP_LOG_LEVEL |
info |
Log level (debug, info, warning, error) |
SLACK_MCP_CACHE_TTL |
3600 |
Cache TTL in seconds, or duration string (1h, 30m, 3600s) |
SLACK_MCP_ADD_MESSAGE_MARK |
false |
Mark channel as read when sending a message |
SLACK_MCP_ADD_MESSAGE_UNFURLING |
"" |
Control link unfurling in sent messages |
SLACK_MCP_USERS_CACHE |
auto | Path to persistent users cache file |
SLACK_MCP_CHANNELS_CACHE |
auto | Path to persistent channels cache file |
Development
make build # Install dependencies
make test # Run unit tests
make format # Format code (ruff)
make lint # Lint code (ruff)
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。