Skip to main content
Glama
Slack MCP Server

Slack MCP Server

by ubie-oss

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 - 在工作区中搜索消息

Related MCP server: Slack MCP Server

快速入门

安装

npm install @ubie-oss/slack-mcp-server

注意:它现在托管在 GitHub Registry 中,因此您需要您的 PAT。

配置

您需要设置以下环境变量:

  • SLACK_BOT_TOKEN :Slack Bot 用户 OAuth 令牌

  • SLACK_USER_TOKEN :Slack 用户 OAuth 令牌(消息搜索等某些功能所需)

您还可以创建一个.env文件来设置这些环境变量:

SLACK_BOT_TOKEN=xoxb-your-bot-token
SLACK_USER_TOKEN=xoxp-your-user-token

用法

启动 MCP 服务器

直接地:

npx @ubie-oss/slack-mcp-server

或者,使用节点运行已安装的模块:

node node_modules/.bin/slack-mcp-server

编辑客户端的 MCP 配置 json:

{
  "slack": {
    "command": "npx",
    "args": [
      "-y",
      "@ubie-oss/slack-mcp-server"
    ],
    "env": {
      "NPM_CONFIG_//npm.pkg.github.com/:_authToken": "<your-github-pat>",
      "SLACK_BOT_TOKEN": "<your-bot-token>",
      "SLACK_USER_TOKEN": "<your-user-token>"
    }
  }
}

实现模式

本服务器采用如下实现模式:

  1. 使用 Zod 模式定义请求/响应

    • 请求模式:定义输入参数

    • 响应模式:定义仅限于必要字段的响应

  2. 实施流程:

    • 使用 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 问题

贡献

  1. 分叉存储库

  2. 创建你的功能分支

  3. 运行测试和 lint: npm run lint

  4. 提交你的更改

  5. 推送到分支

  6. 创建拉取请求

Available Tools

11 tools
slack_add_reactionA

Add a reaction emoji to a message

Inputs: reaction (required), timestamp (required), channel_id (required).

slack_get_channel_historyA

Get messages from a channel in chronological order. Use this when: 1) You need the latest conversation flow without specific filters, 2) You want ALL messages including bot/automation messages, 3) You need to browse messages sequentially with pagination. Do NOT use if you have specific search criteria (user, keywords, dates) - use slack_search_messages instead.

Inputs: channel_id (required), limit, cursor.

slack_get_thread_repliesB

Get all replies in a message thread

Inputs: thread_ts (required), channel_id (required), limit, cursor.

slack_get_user_profilesB

Get multiple users profile information in bulk

Inputs: user_ids (required).

slack_get_usersB

Retrieve basic profile information of all users in the workspace

Inputs: limit, cursor.

slack_list_channelsA

List public channels in the workspace with pagination

Inputs: limit, cursor.

slack_post_messageC

Post a new message to a Slack channel

Inputs: text (required), channel_id (required), format.

slack_reply_to_threadC

Reply to a specific message thread in Slack

Inputs: text (required), thread_ts (required), channel_id (required), format.

slack_search_channelsA

Search for channels by partial name match. Use this when you need to find channels containing specific keywords in their names. Returns up to the specified limit of matching channels.

Inputs: query (required), limit, include_archived.

slack_search_messagesA

Search for messages with specific criteria/filters. Use this when: 1) You need to find messages from a specific user, 2) You need messages from a specific date range, 3) You need to search by keywords, 4) You want to filter by channel. This tool is optimized for targeted searches. For general channel browsing without filters, use slack_get_channel_history instead.

Inputs: on, page, sort, after, +8 more.

slack_search_usersA

Search for users by partial name match across username, display name, and real name. Use this when you need to find users containing specific keywords in their names. Returns up to the specified limit of matching users.

Inputs: query (required), limit, include_bots.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.6/5.0

    Scored across 11 tools

    Disambiguation4/5

    Most tools target distinct actions (post, reply, react, list, search), and the history-vs-search-messages pair is explicitly disambiguated in the descriptions. The main overlap is slack_get_users (all users, basic info) versus slack_get_user_profiles (bulk profile info) versus slack_search_users, where the boundary between the first two is unclear.

    Naming Consistency5/5

    All tools use a uniform slack_<verb>_<noun> snake_case convention (slack_post_message, slack_list_channels, slack_search_users), with verbs chosen sensibly for the action. No mixed casing or inconsistent prefixes.

    Tool Count5/5

    Eleven tools is well within a reasonable range for a Slack integration and each tool maps to a recognizable Slack operation. Nothing feels padded or missing at the count level.

    Completeness3/5

    Core read/write workflows (post, reply, react, read history/threads, search, list channels/users) are covered, but the message lifecycle is incomplete: no update_message, delete_message, or remove_reaction, and there is no direct-message or channel-management (create/join) coverage. These are notable gaps that would force agents into dead ends for common Slack tasks.

    Maintenance

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      B
      quality
      D
      maintenance
      A 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.
      9
      65 npm
      2
      Apache 2.0
    • F
      license
      Not graded
      quality
      D
      maintenance
      A 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.
      1
      -
    • A
      license
      Not graded
      quality
      D
      maintenance
      A simple Model Context Protocol server for Slack integration that enables messaging, channel management, and workspace search capabilities.
      MIT
    • F
      license
      Not graded
      quality
      D
      maintenance
      A Model Context Protocol server that enables LLMs to interact with Slack workspaces through OAuth 2.0 authentication. It provides tools for listing channels and posting messages while supporting secure token persistence and dynamic client registration.
      -