SlackBotMcp
一个MCP(模型上下文协议)服务器,允许Claude与Slack交互——作为机器人发送消息、读取通道和读取线程。
](https://lobehub.com/mcp/agimaulana-slackbotmcp)
工具
| 工具 | 说明 |
|---|---|
send_message | 向通道或DM发送消息(可选地在线程中回复) |
read_channel | 从频道或DM读取最近的消息 |
read_thread | 阅读帖子中的回复 |
search_channels | 按名称搜索频道 |
先决条件
- Python 3.11+
- Slack机器人令牌(
xoxb-...)具有以下OAuth作用域:
- chat:write - channels:history, groups:history, im:history, mpim:history - channels:read, groups:read - conversations.replies (channels:history)
安装
pip install -r requirements.txt配置
将服务器添加到您的Claude Code MCP配置中(通常 ~/.claude/mcp.json 或者你的项目 .mcp.json):
{
"mcpServers": {
"slack-bot-direct": {
"command": "python3",
"args": ["/path/to/SlackBotMcp/server.py"],
"env": {
"SLACK_BOT_TOKEN": "xoxb-your-token-here"
}
}
}
}替换 /path/to/SlackBotMcp/server.py 与实际路径和 xoxb-your-token-here 使用您的Slack机器人令牌。
手动运行
SLACK_BOT_TOKEN=xoxb-your-token-here python3 server.py获取Slack Bot令牌
- 首选 api.slack.com/apps 并创建一个新的应用程序。
- 在...之下 OAuth和权限,添加上面列出的所需bot令牌范围。
- 将应用程序安装到您的工作区。
- 复制 Bot用户OAuth令牌 (
xoxb-...).
