Slack
频道管理和消息功能
简介
Slack MCP 服务器使 Claude 能够与 Slack 工作区进行交互,包括查看频道、发送消息和添加反应等功能。
快速设置
-
创建 Slack 应用
- 访问 Slack Apps 页面
- 点击"创建新应用"→"从头开始"
- 命名应用并选择工作区
-
配置权限
- 导航到"OAuth & Permissions"
- 添加以下权限范围:
channels:history, channels:read, chat:write, reactions:write, users:read
-
安装并获取凭证
- 安装应用到工作区
- 保存 Bot Token (以
xoxb-
开头) - 获取团队 ID (以
T
开头)
-
配置 Claude Desktop
将以下内容添加到
claude_desktop_config.json
,使用您的实际凭证:{ "mcpServers": { "slack": { "command": "npx", "args": [ "-y", "@modelcontextprotocol/server-slack" ], "env": { "SLACK_BOT_TOKEN": "xoxb-your-bot-token", "SLACK_TEAM_ID": "T01234567" } } } }
主要功能
工具 | 描述 | 关键参数 |
---|---|---|
slack_list_channels | 列出公共频道 | limit (可选) |
slack_post_message | 发送新消息 | channel_id , text |
slack_reply_to_thread | 回复线程 | channel_id , thread_ts , text |
slack_add_reaction | 添加表情反应 | channel_id , timestamp , reaction |
slack_get_channel_history | 获取频道消息 | channel_id , limit (可选) |
slack_get_thread_replies | 获取线程回复 | channel_id , thread_ts |
slack_get_users | 获取用户列表 | cursor (可选), limit (可选) |
slack_get_user_profile | 获取用户资料 | user_id |
故障排除
如遇权限错误,请检查:
- 所有权限范围已正确添加
- 应用已安装到工作区
- 令牌和工作区 ID 正确无误
- 应用已添加到需要访问的频道中
许可证
MIT 许可证