slack-mcp

slack-mcp

Provides LLMs full access to Slack: messages, channels, files, canvases, lists, search, reactions, and more via 220 tools and 36 API families.

Category
访问服务器

README

<div align="center">

Slack MCP

Your entire Slack workspace — available to any AI.

Python License

A Model Context Protocol server that gives LLMs full access to Slack.<br> Messages, channels, files, canvases, lists, search, reactions — all of it.

220 tools · 36 API families · Every Slack feature

</div>


Quick Start

1. Create a Slack App

  1. Go to api.slack.com/apps > Create New App > From a manifest
  2. Paste the contents of manifest.json
  3. Install to your workspace
  4. Copy the User OAuth Token (xoxp-...) from OAuth & Permissions

2. Add to your AI client

<details> <summary><strong>Claude Code</strong></summary>

claude mcp add slack -- uvx --from git+https://github.com/karbassi/slack-mcp.git slack-mcp

Then set SLACK_XOXP_TOKEN in your shell environment.

</details>

<details> <summary><strong>Claude Desktop</strong></summary>

Add to ~/Library/Application Support/Claude/claude_desktop_config.json:

{
  "mcpServers": {
    "slack": {
      "type": "stdio",
      "command": "uvx",
      "args": ["--from", "git+https://github.com/karbassi/slack-mcp.git", "slack-mcp"],
      "env": {
        "SLACK_XOXP_TOKEN": "xoxp-..."
      }
    }
  }
}

</details>

<details> <summary><strong>Cursor</strong></summary>

Add to ~/.cursor/mcp.json:

{
  "mcpServers": {
    "slack": {
      "type": "stdio",
      "command": "uvx",
      "args": ["--from", "git+https://github.com/karbassi/slack-mcp.git", "slack-mcp"],
      "env": {
        "SLACK_XOXP_TOKEN": "xoxp-..."
      }
    }
  }
}

</details>

<details> <summary><strong>Windsurf</strong></summary>

Add to ~/.codeium/windsurf/mcp_config.json:

{
  "mcpServers": {
    "slack": {
      "type": "stdio",
      "command": "uvx",
      "args": ["--from", "git+https://github.com/karbassi/slack-mcp.git", "slack-mcp"],
      "env": {
        "SLACK_XOXP_TOKEN": "xoxp-..."
      }
    }
  }
}

</details>

<details> <summary><strong>VS Code / GitHub Copilot</strong></summary>

Add to your VS Code settings.json:

{
  "mcp": {
    "servers": {
      "slack": {
        "command": "uvx",
        "args": ["--from", "git+https://github.com/karbassi/slack-mcp.git", "slack-mcp"],
        "env": {
          "SLACK_XOXP_TOKEN": "xoxp-..."
        }
      }
    }
  }
}

</details>

<details> <summary><strong>Local clone</strong></summary>

{
  "mcpServers": {
    "slack": {
      "type": "stdio",
      "command": "uv",
      "args": ["run", "--directory", "/path/to/slack-mcp", "slack-mcp"]
    }
  }
}

</details>

What Can It Do?

"Catch me up on #engineering from today" "Reply to Sarah's thread saying we'll ship it Monday" "Search for anything about the Q3 roadmap" "Create a channel called #project-atlas and invite the design team"

Domain Tools Highlights
Conversations 28 History, threads, replies, create, archive, invite, mark read
Undocumented 28 Drafts, saved items, emoji management, granular search, sidebar, threads
Files 16 Upload, share, edit, list, remote files
Chat 14 Send, reply, schedule, update, delete, ephemeral
Users 12 Profile, presence, lookup, list
Lists 12 Create, edit items, manage access
Legacy 11 Slash commands, file editing, bot listing
Team 9 Info, preferences, access logs, billing
Apps 8 Manifests, connections, authorizations
Usergroups 7 Create, update, manage members
Workflows 7 Featured workflows, step completion
Canvases 6 Create, edit, sections, access control
Calls 6 Start, end, manage participants
+ 23 more DND, reminders, bookmarks, reactions, pins, stars, views, search, auth, bots, emoji, ...

Plus resolve_names (bulk ID→name resolution) and cache_clear (bust the response cache on demand) utility tools.

Beyond the Official API

39 undocumented and legacy endpoints — the same internal APIs that Slack's own apps use. Requires session tokens (xoxc+xoxd).

<details> <summary><strong>Session endpoints</strong> — workspace state the official API doesn't expose</summary>

Endpoint What it provides
client.boot Full workspace bootstrap — channels, users, prefs, feature flags
client.counts Unread counts per channel/DM/thread plus mention counts
client.userBoot User-specific bootstrap data scoped to the authenticated user
threads.getView Thread inbox — the list of threads with read/unread state
subscriptions.thread.mark Mark individual threads as read or unread
drafts.list List all unsent message drafts
drafts.create Create a message draft with Block Kit text
drafts.update Edit an existing draft
drafts.delete Delete a draft
saved.list List saved-for-later items
saved.add Save a message for later with optional due date
saved.delete Remove a saved-for-later item
emoji.add Add a custom emoji from a URL
emoji.remove Remove a custom emoji
emoji.adminList Emoji with rich metadata — uploader, date, usage stats
search.modules.messages Granular message search
search.modules.files File-specific search
search.modules.channels Server-side channel search by name or topic
search.modules.people Fuzzy people search by name, title, department
search.modules.dms Search within DMs only
conversations.view Channel view with read state and personal config
conversations.listPrefs Per-channel notification and mute preferences
users.channelSections.list Sidebar organization — custom sections, favorites
users.priority.list Contacts ranked by interaction frequency
experiments.getByUser A/B test experiment assignments
api.features Workspace feature flags
aiApps.list AI applications configured in the workspace

</details>

<details> <summary><strong>Legacy endpoints</strong> — functionality missing from the official API</summary>

Endpoint What it provides
chat.command Execute slash commands programmatically
commands.list List all slash commands including custom ones
files.edit Edit a file's title, content, or filetype in-place
files.share Share a file to a channel
bots.list List all bot users in the workspace
team.prefs.get Team-level preferences — retention, permissions, domains
users.prefs.get All user preferences — notifications, sidebar, theme
users.prefs.set Set any individual user preference
users.admin.invite Invite users by email (Enterprise Grid)
users.admin.setInactive Deactivate a user account (Enterprise Grid)
channels.delete Dead method — included for completeness

[!WARNING] Undocumented endpoints can break without notice. They use session tokens (xoxc+xoxd) which expire and must be re-grabbed from browser cookies.

</details>

Authentication

Variable Required Description
SLACK_XOXP_TOKEN Yes User OAuth token from your Slack app
SLACK_XOXC_TOKEN No Browser session token for undocumented endpoints
SLACK_XOXD_TOKEN No Browser session cookie (paired with xoxc)

[!TIP] The xoxp token covers all Slack Web API tools. Utility tools like resolve_names and cache_clear work without additional auth. For undocumented endpoints (unread counts, workspace boot, file editing), you also need xoxc+xoxd — grab them from your browser cookies while logged into slack.com.

Caching

Responses are cached automatically to reduce API calls:

  • Stable data (users, teams, bots, emoji) — 1 hour TTL
  • Dynamic data (channel lists, members, bookmarks) — 5 minute TTL
  • Old threads (conversations_replies with ts > 1 hour old) — 1 hour TTL
  • Bounded history (conversations_history with old date range) — 1 hour TTL
  • Resolved names (user/bot → 1 hour, channel → 5 minutes)

Cache is stored at the platform-native location (~/Library/Caches/slack-mcp on macOS, ~/.cache/slack-mcp on Linux). Set XDG_CACHE_HOME to override.

Use the cache_clear tool to bust the cache when you need fresh data.

Name Resolution

All tool responses automatically resolve user, channel, DM, and bot IDs to display names via a resolved_names field — no extra tool calls needed. Resolved names are disk-cached to avoid redundant API lookups.

Response Compaction

15 high-volume tools automatically strip bloat from Slack API responses — blocks (duplicates text), attachments (link unfurls), thumbnails (22 per file), and metadata noise. Measured reductions:

Endpoint Before After Reduction
conversations.history 465 KB 113 KB 76%
files.list 127 KB 26 KB 80%
conversations.list 59 KB 17 KB 71%
reactions.list 353 KB 167 KB 53%

Compaction is on by default. Pass detailed=True to any compactable tool to get the full Slack API response.

Development

git clone https://github.com/karbassi/slack-mcp.git
cd slack-mcp
uv sync
mise run check                       # test + lint + security scan
mise run test:integration            # requires tokens in .env

[!NOTE] ~68 integration tests are skipped because they require a bot token (xoxb), Slack Connect, interactive triggers (e.g. views.open), or would be destructive (e.g. auth.revoke). Adding bot token support is a future goal.

License

MIT

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选