SuperAPI AI 工具集

slack

编程与开发

查看项目

更新于 10-15 22:15

技能介绍

用途:通过直接调用 Slack API 获取 Slack 线程、频道历史与搜索结果,无需 MCP 服务器。适用于用户给出 Slack 消息 URL、要求“读取这个 Slack 线程”,或需要抓取频道最新消息(如机器人私信)与按条件检索消息的场景。

主要能力:支持解析 archives 格式消息 URL 与 app.slack.com/client 格式频道 URL;调用 conversations.replies 获取线程、conversations.history 获取频道历史或单条消息、search.messages 搜索消息。搜索支持 in:#channel、from:@user、after/before 日期等过滤条件,以及 count、sort、sort_dir 参数。输出按用户 ID、消息文本、时间戳展示。

使用方式:需先设置环境变量 SLACK_MCP_XOXC_TOKEN 与 SLACK_MCP_XOXD_TOKEN。消息 URL 中 C 开头为频道 ID,p 后数字为时间戳(去掉 p,在末 6 位前插入小数点)。示例:curl -s "https://slack.com/api/conversations.replies?channel=${CHANNEL}&ts=${TS}" -H "Authorization: Bearer ${SLACK_MCP_XOXC_TOKEN}" -H "Cookie: d=${SLACK_MCP_XOXD_TOKEN}" | jq '.messages[] | {user, text, ts}'。频道历史示例:curl -s -X POST "https://slack.com/api/conversations.history" -H "Authorization: Bearer $SLACK_MCP_XOXC_TOKEN" -H "Cookie: d=$SLACK_MCP_XOXD_TOKEN" -d "channel=${CHANNEL}" -d "limit=20"。

限制:若响应 ok: false 需展示错误信息,常见错误包括 channel_not_found、thread_not_found、invalid_auth、enterprise_is_restricted;Enterprise Grid 可能限制 search.messages API。搜索 count 默认 20、最大 100。其他收费、平台与效果信息暂未提供。