Skip to main content
Glama
yentsun

yt-slack-mcp

by yentsun

yt-slack-mcp

用于 Slack 的 MCP 服务器 — 读取永久链接、线程和频道历史;回复线程;添加表情反应。

实现了 Model Context Protocol 规范:它通过 stdio 传输运行,使用 JSON-RPC 2.0 通信,在 initialize 时协商协议版本,声明 tools 能力,并用 JSON Schema 描述每个工具。协议版本协商由 @modelcontextprotocol/sdkServer 类处理,该类默认使用最新支持的版本。

工具

工具

描述

slack_read_permalink

从永久链接读取消息或线程(包括 PDF/图片)

slack_get_replies

按频道 ID + 时间戳读取线程的回复

slack_get_history

读取最近的频道历史

slack_reply_to_thread

回复线程(仅限于允许的频道)

slack_add_reaction

添加表情反应(仅限于允许的频道)

读取工具使用私有的 Slack 浏览器会话 API(通过 xoxc / xoxd 令牌),因此可以获取私有文件内容 — PDF 会被下载并提取文本(最多 50 页 / 100k 字符),图片则以内联方式返回。

Related MCP server: Slack MCP Server

设置

1. 获取浏览器会话令牌

  • xoxc:Slack 网页版 localStorage 令牌(来自你已登录的浏览器会话)。

  • xoxd:名为 d 的 Slack Cookie。

当 Slack 轮换/失效会话时,这些令牌可能需要刷新。

2. 放置密钥

将每个令牌保存为单行文件:

~/.config/opencode/secrets/slack-xoxc.txt
~/.config/opencode/secrets/slack-xoxd.txt

或者通过配置文件或环境变量覆盖路径。

3. (可选)配置允许写入的频道和路径

所有配置都可以放在 JSON 配置文件中,路径为 ~/.config/yt-slack-mcp/config.json(可通过 SLACK_MCP_CONFIG 覆盖):

{
  "secretsDir": "~/.config/opencode/secrets",
  "xoxcPath": "~/.config/opencode/secrets/slack-xoxc.txt",
  "xoxdPath": "~/.config/opencode/secrets/slack-xoxd.txt",
  "allowedWriteChannels": ["C0123456789", "C0987654321"],
  "userAgent": "Mozilla/5.0"
}

默认情况下,写入工具(slack_reply_to_threadslack_add_reaction) 是锁定的 — 没有任何频道可写。每个字段都是可选的;如果 文件缺失,则仅表示使用默认值。环境变量始终覆盖配置文件。

配置

配置解析顺序:内置默认值 → 配置文件 → 环境变量。

配置文件键

环境变量

默认值

描述

secretsDir

SLACK_MCP_SECRETS_DIR

~/.config/opencode/secrets

存放令牌文件的目录

xoxcPath

SLACK_MCP_XOXC_PATH

$SECRETS_DIR/slack-xoxc.txt

xoxc 令牌的路径

xoxdPath

SLACK_MCP_XOXD_PATH

$SECRETS_DIR/slack-xoxd.txt

xoxd 令牌的路径

allowedWriteChannels

SLACK_MCP_ALLOWED_WRITE_CHANNELS

(无)

允许写入工具的频道 ID(在环境变量中以逗号分隔)

userAgent

SLACK_MCP_USER_AGENT

Mozilla/5.0

HTTP User-Agent 请求头

(配置文件路径)

SLACK_MCP_CONFIG

~/.config/yt-slack-mcp/config.json

JSON 配置文件的路径

MCP 主机配置

opencode

{
  "mcp": {
    "slack": {
      "type": "local",
      "command": ["npx", "yt-slack-mcp"]
    }
  }
}

Claude Desktop

{
  "mcpServers": {
    "slack": {
      "command": "npx",
      "args": ["yt-slack-mcp"]
    }
  }
}

许可证

MIT

A
license - permissive license
Not graded
quality - not tested
C
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

  • A
    license
    Not graded
    quality
    B
    maintenance
    A production-ready MCP server for the Slack API that enables searching, listing channels, reading history, inspecting users, fetching threads, and sending messages through controlled Slack tools.
    16,956
    MIT
  • A
    license
    Not graded
    quality
    B
    maintenance
    MCP server for interacting with Slack using a user token. It allows reading channels, DMs, threads, search, and posting messages as the authenticated user.
    25
    MIT
  • A
    license
    A
    quality
    C
    maintenance
    MCP server that reads Slack through your own browser session, authenticating as you rather than a bot. Provides tools to search messages, retrieve channel/DM/thread history, resolve users, and post messages (write disabled by default).
    10
    MIT

View all related MCP servers

Related MCP Connectors

View all MCP Connectors

Latest Blog Posts

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/yentsun/slack-mcp'

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