Claude Code Slack Channel
MCP server that connects Claude Code to Slack, allowing two-way communication via Slack Socket Mode without tunnels.
README
Claude Code Slack Channel
Connect Claude Code to your Slack workspace using the Model Context Protocol (MCP). This server runs a Slack App in Socket Mode that routes incoming messages from Slack directly into your local Claude Code session, and gives Claude the ability to securely reply back!
Features
- Two-Way Communication: Send messages from Slack to Claude Code, and allow Claude Code to natively reply using an MCP tool (
send_slack_message). - Zero Configuration Tunnels: Uses Slack Socket Mode, meaning no
ngrokor public IP addresses are required. Runs completely locally! - Private Channel Support: Fully supports routing messages from private Slack channels.
Setup Instructions
1. Create a Slack App
- Go to Slack API Apps and click Create New App > From scratch.
- Go to Socket Mode (left sidebar) and toggle it On.
- Generate an App-Level Token with the
connections:writescope. (Starts withxapp-). - Go to OAuth & Permissions (left sidebar), scroll to Scopes > Bot Token Scopes, and add the
channels:history,chat:write, andgroups:historyscopes. - Go to Event Subscriptions (left sidebar), toggle Enable Events to On, and subscribe to
message.channelsandmessage.groupsunder "Subscribe to bot events". - Important: Scroll to the bottom and click Save Changes.
- Go to Install App and install it into your workspace to get your Bot User OAuth Token (Starts with
xoxb-).
2. Configure Claude Code
You can add this MCP server to your global Claude Code configuration (~/.claude.json) or to a project-specific .claude.json configuration.
Run npm install in this directory to install the @slack/bolt and tsx dependencies. Then, add the following to your mcpServers block, replacing the path and tokens with your actual values:
{
"mcpServers": {
"slack-channel": {
"type": "stdio",
"command": "npx",
"args": [
"tsx",
"/path/to/this/repository/webhook.ts"
],
"env": {
"SLACK_APP_TOKEN": "xapp-...",
"SLACK_BOT_TOKEN": "xoxb-...",
"SLACK_CHANNEL_ID": "C0..." // Optional: add a channel ID here so it only listens to one specific channel!
}
}
}
}
3. Usage
- Simply restart Claude Code. The server will initialize in the background and connect to Slack.
- Invite your bot to any channel in Slack using
/invite @YourBotName. - Send a message in that channel, and it will seamlessly appear in Claude Code as context!
- You can ask Claude Code directly to "Reply to that Slack message" and it will autonomously use the
send_slack_messagetool to post back.
⚠️ Architecture Caveat: Global vs. Local Configuration
Slack's Socket Mode allows multiple WebSocket connections using the identical App Token, and load-balances (randomizes) incoming messages across all connected clients.
Because of this:
- Global Configuration (
~/.claude.json): If you have multiple Terminal windows open running Claude Code simultaneously, each window spawns its own MCP server. When you send a Slack message, Slack will randomly route it to only one of your active terminals. - Local Configuration (
./.claude.json): If you only want Slack messages to route uniquely to a specific project workspace, do not configure this server globally. Instead, configure themcpServersblock in a local.claude.jsonfile inside that specific project folder so the webhook server is only spawned when you are actively working in that directory.
Troubleshooting
If messages aren't arriving:
- Ensure you have invited the bot to the channel.
- Ensure you clicked the yellow "Reinstall to Workspace" banner in Slack after changing event scopes.
- Check the
slack-debug.logfile generated in the root of this repository.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。