slack-mcp-服务器
用于访问 Slack API 的MCP(模型上下文协议)服务器。该服务器允许 AI 助手通过标准化接口与 Slack API 进行交互。
特征
可用工具:
slack_list_channels- 使用分页列出工作区中的公共频道slack_post_message- 向 Slack 频道发布新消息slack_reply_to_thread- 回复 Slack 中的特定消息线程slack_add_reaction- 在消息中添加反应表情符号slack_get_channel_history- 获取频道的最新消息slack_get_thread_replies- 获取消息线程中的所有回复slack_get_users- 检索工作区中所有用户的基本个人资料信息slack_get_user_profile- 获取用户的个人资料信息slack_search_messages- 在工作区中搜索消息
快速入门
安装
注意:它现在托管在 GitHub Registry 中,因此您需要您的 PAT。
配置
您需要设置以下环境变量:
SLACK_BOT_TOKEN:Slack Bot 用户 OAuth 令牌SLACK_USER_TOKEN:Slack 用户 OAuth 令牌(消息搜索等某些功能所需)
您还可以创建一个.env文件来设置这些环境变量:
用法
启动 MCP 服务器
直接地:
或者,使用节点运行已安装的模块:
编辑客户端的 MCP 配置 json:
实现模式
本服务器采用如下实现模式:
使用 Zod 模式定义请求/响应
请求模式:定义输入参数
响应模式:定义仅限于必要字段的响应
实施流程:
使用 Zod 模式验证请求
调用 Slack WebAPI
使用 Zod 模式解析响应以限制必要的字段
以 JSON 形式返回
例如, slack_list_channels实现使用ListChannelsRequestSchema解析请求,调用slackClient.conversations.list ,并返回使用ListChannelsResponseSchema解析的响应。
发展
可用脚本
npm run dev- 使用热重载以开发模式启动服务器npm run build构建生产项目npm run start启动生产服务器npm run lint- 运行 linting 检查(ESLint 和 Prettier)npm run fix- 自动修复 linting 问题
贡献
分叉存储库
创建你的功能分支
运行测试和 lint:
npm run lint提交你的更改
推送到分支
创建拉取请求
remote-capable server
The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.
实现模型上下文协议的服务器,使AI助手能够通过标准化接口与Slack API进行交互,提供消息传递、频道管理、用户信息检索等工具。
Related Resources
Related MCP Servers
- Asecurity-licenseAqualityA Model Context Protocol server implementation that enables AI assistants to interact with Slack workspaces, allowing them to browse channels, send messages, reply to threads, add reactions, and retrieve user information.Last updated -9102Apache 2.0
- -security-license-qualityA comprehensive Model Context Protocol server implementation that enables AI assistants to interact with file systems, databases, GitHub repositories, web resources, and system tools while maintaining security and control.Last updated -361
- -security-license-qualityEnables AI assistants to interact with Slack workspaces through the Model Context Protocol, providing tools for reading/sending messages, managing channels, and accessing Slack API functionality.
- -security-license-qualityA Model Context Protocol server that integrates with Slack API, allowing users to send messages, view channel history, manage channels, send direct messages, and retrieve user lists from Slack workspaces.Last updated -1