Skip to main content
Glama

Slack MCP Server

Slack MCP 服务器

用于 Slack API 的 MCP 服务器,使 Claude 能够与 Slack 工作区进行交互。

工具

  1. slack_list_channels
    • 列出工作区中的公共或预定义频道
    • 可选输入:
      • limit (数字,默认值:100,最大值:200):返回的最大通道数
      • cursor (字符串):下一页的分页光标
    • 返回:频道列表及其 ID 和信息
  2. slack_post_message
    • 向 Slack 频道发布新消息
    • 必需输入:
      • channel_id (string): 要发布到的频道的 ID
      • text (字符串):要发布的消息文本
    • 返回:消息发布确认和时间戳
  3. slack_reply_to_thread
    • 回复特定消息线程
    • 必需输入:
      • channel_id (字符串):包含线程的通道
      • thread_ts (字符串):父消息的时间戳
      • text (字符串):回复文本
    • 返回:回复确认和时间戳
  4. slack_add_reaction
    • 在消息中添加表情符号反应
    • 必需输入:
      • channel_id (字符串):包含消息的频道
      • timestamp (字符串):需要响应的消息时间戳
      • reaction (字符串):不带冒号的表情符号名称
    • 返回:反应确认
  5. slack_get_channel_history
    • 获取频道的最新消息
    • 必需输入:
      • channel_id (字符串):频道 ID
    • 可选输入:
      • limit (数字,默认值:10):要检索的消息数量
    • 返回:消息及其内容和元数据的列表
  6. slack_get_thread_replies
    • 获取消息线程中的所有回复
    • 必需输入:
      • channel_id (字符串):包含线程的通道
      • thread_ts (字符串):父消息的时间戳
    • 返回:回复列表及其内容和元数据
  7. slack_get_users
    • 获取具有基本个人资料信息的工作区用户列表
    • 可选输入:
      • cursor (字符串):下一页的分页光标
      • limit (数字,默认值:100,最大值:200):返回的最大用户数
    • 返回:用户及其基本资料的列表
  8. slack_get_user_profile
    • 获取特定用户的详细个人资料信息
    • 必需输入:
      • user_id (字符串):用户的 ID
    • 返回:详细的用户资料信息

设置

  1. 创建 Slack 应用程序:
    • 访问Slack 应用页面
    • 点击“创建新应用”
    • 选择“从头开始”
    • 命名您的应用并选择您的工作区
  2. 配置机器人令牌范围:导航到“OAuth 和权限”并添加以下范围:
    • channels:history - 查看公共频道中的消息和其他内容
    • channels:read - 查看基本频道信息
    • chat:write - 以应用程序身份发送消息
    • reactions:write - 在消息中添加表情符号反应
    • users:read - 查看用户及其基本信息
    • users.profile:read - 查看用户的详细资料
  3. 将应用程序安装到工作区:
    • 点击“安装到工作区”并授权应用程序
    • 保存以xoxb-开头的“Bot User OAuth Token”
  4. 按照本指南获取您的团队 ID(以T开头)

与 Claude Desktop 一起使用

将以下内容添加到您的claude_desktop_config.json中:

NPX
{ "mcpServers": { "slack": { "command": "npx", "args": [ "-y", "@modelcontextprotocol/server-slack" ], "env": { "SLACK_BOT_TOKEN": "xoxb-your-bot-token", "SLACK_TEAM_ID": "T01234567", "SLACK_CHANNEL_IDS": "C01234567, C76543210" } } } }
码头工人
{ "mcpServers": { "slack": { "command": "docker", "args": [ "run", "-i", "--rm", "-e", "SLACK_BOT_TOKEN", "-e", "SLACK_TEAM_ID", "-e", "SLACK_CHANNEL_IDS", "mcp/slack" ], "env": { "SLACK_BOT_TOKEN": "xoxb-your-bot-token", "SLACK_TEAM_ID": "T01234567", "SLACK_CHANNEL_IDS": "C01234567, C76543210" } } } }

与 VS Code 一起使用

为了快速安装,请单击下面的安装按钮之一...

如需手动安装,请将以下 JSON 块添加到 VS Code 中的“用户设置 (JSON)”文件中。您可以按下Ctrl + Shift + P并输入Preferences: Open Settings (JSON)来完成此操作。

或者,您可以将其添加到工作区中名为.vscode/mcp.json的文件中。这样您就可以与其他人共享该配置。

请注意.vscode/mcp.json文件中不需要mcp键。

NPX
{ "mcp": { "inputs": [ { "type": "promptString", "id": "slack_bot_token", "description": "Slack Bot Token (starts with xoxb-)", "password": true }, { "type": "promptString", "id": "slack_team_id", "description": "Slack Team ID (starts with T)" } ], "servers": { "slack": { "command": "npx", "args": ["-y", "@modelcontextprotocol/server-slack"], "env": { "SLACK_BOT_TOKEN": "${input:slack_bot_token}", "SLACK_TEAM_ID": "${input:slack_team_id}" } } } } }
Docker
{ "mcp": { "inputs": [ { "type": "promptString", "id": "slack_bot_token", "description": "Slack Bot Token (starts with xoxb-)", "password": true }, { "type": "promptString", "id": "slack_team_id", "description": "Slack Team ID (starts with T)" } ], "servers": { "slack": { "command": "docker", "args": ["run", "-i", "--rm", "mcp/slack"], "env": { "SLACK_BOT_TOKEN": "${input:slack_bot_token}", "SLACK_TEAM_ID": "${input:slack_team_id}" } } } } }

环境变量

  1. SLACK_BOT_TOKEN :必需。以xoxb-开头的机器人用户 OAuth 令牌。
  2. SLACK_TEAM_ID :必填。您的 Slack 工作区 ID,以T开头。
  3. SLACK_CHANNEL_IDS :可选。以逗号分隔的频道 ID 列表,用于限制频道访问权限(例如,“C01234567、C76543210”)。如果未设置,则将列出所有公开频道。

故障排除

如果遇到权限错误,请验证:

  1. 所有必需的范围都已添加到您的 Slack 应用中
  2. 该应用程序已正确安装到您的工作区
  3. 令牌和工作区 ID 已正确复制到您的配置中
  4. 该应用已添加到需要访问的频道

建造

Docker 构建:

docker build -t mcp/slack -f src/slack/Dockerfile .

执照

此 MCP 服务器采用 MIT 许可证。这意味着您可以自由使用、修改和分发该软件,但须遵守 MIT 许可证的条款和条件。更多详情,请参阅项目仓库中的 LICENSE 文件。

Deploy Server
A
security – no known vulnerabilities
A
license - permissive license
A
quality - confirmed to work

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.

用于 Slack API 的 MCP 服务器,使 Claude 能够与 Slack 工作区进行交互。

  1. 工具
    1. 设置
      1. 与 Claude Desktop 一起使用
      2. 与 VS Code 一起使用
      3. 环境变量
      4. 故障排除
    2. 建造
      1. 执照

        Related MCP Servers

        • A
          security
          A
          license
          A
          quality
          An MCP server that enables saving and sharing Claude Desktop conversations, allowing users to store chats privately or make them public through a web interface.
          Last updated -
          11
          MIT License
          • Apple
        • -
          security
          F
          license
          -
          quality
          An MCP server that enables LLMs to access Slack's search functionality to retrieve users, channels, messages, and thread replies from a Slack workspace.
          Last updated -
          3
        • -
          security
          F
          license
          -
          quality
          An MCP server that connects to Claude Desktop and provides access to Slack actions through ActionKit, allowing users to interact with Slack via their authenticated Paragon credentials.
          Last updated -
          1
          • Apple
        • A
          security
          F
          license
          A
          quality
          An MCP server that allows Claude to interact with Discord by providing tools for sending/reading messages and managing server resources through Discord's API.
          Last updated -
          19
          29

        View all related MCP servers

        MCP directory API

        We provide all the information about MCP servers via our MCP API.

        curl -X GET 'https://glama.ai/api/mcp/v1/servers/modelcontextprotocol/slack'

        If you have feedback or need assistance with the MCP directory API, please join our Discord server