用于 Slack API 的 MCP 服务器,使 Claude 能够作为用户与 Slack 工作区进行交互。
<a href="https://glama.ai/mcp/servers/wc0u5519qh"><img width="380" height="200" src="https://gips2.baidu.com/it/u=4246174547,731134760&fm=3081&app=3081&f=PNG?w=760&h=400" alt="Slack 用户服务器 MCP 服务器" /></a>
slack_list_channels
limit(数字,默认:100,最大:200):返回的最大频道数cursor(字符串):分页游标,用于下一页slack_post_message
channel_id(字符串):要发布的频道IDtext(字符串):要发布的消息文本slack_reply_to_thread
channel_id(字符串):包含线程的频道thread_ts(字符串):父消息的时间戳text(字符串):回复文本slack_add_reaction
channel_id(字符串):包含消息的频道timestamp(字符串):要反应的消息时间戳reaction(字符串):不带冒号的表情名称slack_get_channel_history
channel_id(字符串):频道IDlimit(数字,默认:10):要检索的消息数量slack_get_thread_replies
channel_id(字符串):包含线程的频道thread_ts(字符串):父消息的时间戳slack_get_users
cursor(字符串):分页游标,用于下一页limit(数字,默认:100,最大:200):返回的最大用户数slack_get_user_profile
user_id(字符串):用户的ID创建 Slack 应用:
配置用户令牌范围: 导航到“OAuth 和权限”并添加以下范围:
channels:history - 查看公共频道中的消息和其他内容channels:read - 查看基本频道信息chat:write - 以自己身份发送消息reactions:write - 在消息上添加表情反应users:read - 查看用户及其基本信息将应用安装到工作区:
xoxp- 开头的“用户 OAuth 令牌”获取您的团队ID(以 T 开头),请参阅 此指南
在您的 claude_desktop_config.json 中添加以下内容:
首先安装并构建服务器:
git clone https://github.com/lars-hagen/slack-user-mcp.git
cd slack-user-mcp
npm install
npm run build
然后配置 Claude Desktop:
{
"mcpServers": {
"slack": {
"command": "npm",
"args": [
"run",
"--prefix",
"/path/to/slack-user-mcp",
"start"
],
"env": {
"SLACK_TOKEN": "xoxp-your-user-token",
"SLACK_TEAM_ID": "T01234567"
}
}
}
}
{
"mcpServers": {
"slack": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-slack-user"
],
"env": {
"SLACK_TOKEN": "xoxp-your-user-token",
"SLACK_TEAM_ID": "T01234567"
}
}
}
}
{
"mcpServers": {
"slack": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"-e",
"SLACK_TOKEN",
"-e",
"SLACK_TEAM_ID",
"mcp/slack-user"
],
"env": {
"SLACK_TOKEN": "xoxp-your-user-token",
"SLACK_TEAM_ID": "T01234567"
}
}
}
}
要通过 Smithery 自动安装 Slack 用户服务器给 Claude Desktop:
npx -y @smithery/cli install @lars-hagen/slack-user-mcp2 --client claude
如果您遇到权限错误,请验证:
Docker 构建:
docker build -t mcp/slack-user -f src/slack/Dockerfile .
此 MCP 服务器根据 MIT 许可证发布。这意味着您可以自由地使用、修改和分发该软件,但需遵守 MIT 许可证的条款和条件。如需更多详情,请参见项目存储库中的 LICENSE 文件。