claude-slack-bridge

claude-slack-bridge

Enables Claude Code to pause and ask questions via Slack, and allows running Claude from Slack with project-aware context, supporting a full-process feature development workflow.

Category
访问服务器

README

Claude ↔ Slack Bridge

A two-way bridge between Claude Code and Slack:

  • Claude → Slack: Claude pauses mid-task, asks a question via Slack, waits for your reply, and resumes.
  • Slack → Claude: Tag the bot in a Slack channel and Claude runs with full project context — it knows which project to work on based on the channel.
Claude Code  ──ask_on_slack──▶  Slack channel  ──your reply──▶  Claude Code resumes
Slack @bot   ──────────────────▶  claude -p (in project dir) ──▶  reply in thread

slack-claude-small

What It Does

  • ask_on_slack MCP tool — Claude pauses mid-task, posts a question to Slack, blocks until you reply in the thread, then resumes. Multiple concurrent sessions are routed correctly by thread_ts.
  • Project-aware Slack bot@claude-bot in a Slack channel spawns claude -p in the matching project directory inside the container. Supports git worktrees via a [label] prefix.
  • Full-process plugin — a turnkey feature-development workflow driven from Slack (/process start → pick a task → worktree → design → plan → run-plan → PR per step).

Quickstart — Claude → Slack

1. Create a Slack app and get tokens

Follow docs/slack-setup.md to create a Slack app, get your xoxb- and xapp- tokens, and invite the bot to a channel.

(Optional) If you plan to use the /process workflow — which opens GitHub PRs and reads review comments from inside the container — also follow docs/github-setup.md to create a fine-grained PAT and set GITHUB_TOKEN. Skip this if you don't need GitHub integration.

2. Clone, configure, and start the daemon

git clone https://github.com/your-username/claude-slack-bridge.git
cd claude-slack-bridge
cp .env.example .env   # fill in SLACK_BOT_TOKEN and SLACK_APP_TOKEN
docker compose up -d --build

The container starts automatically on system boot (restart: unless-stopped) and uses Socket Mode — no public URL or inbound firewall rules needed.

You only do this once. The daemon stays running in the background and serves all your Claude Code projects.

3. Add .mcp.json to your Claude Code project

Create .mcp.json in the root of any project where you want Claude to be able to ask you questions:

{
  "mcpServers": {
    "claude-slack-bridge": {
      "command": "docker",
      "args": [
        "exec", "-i",
        "-e", "SLACK_CHANNEL",
        "claude-slack-bridge",
        "python", "session.py"
      ],
      "env": {
        "SLACK_CHANNEL": "#your-project-channel"
      }
    }
  }
}

Important: Add .mcp.json to your .gitignore — it contains your channel name and is project-specific.

4. Add the Slack communication rule to your CLAUDE.md

To make Claude automatically use Slack for all communication once it sends its first message, add the following to your project's CLAUDE.md:

Once you use `mcp__claude-slack-bridge__ask_on_slack` for the first time in a conversation, ALL further communication with the user must go through that tool. Do not use `AskUserQuestion`, and do not ask questions or request feedback as text in the terminal. Continue communicating exclusively via Slack until the user explicitly tells you to switch back to the terminal.

Open the project in Claude Code and Claude will have access to ask_on_slack. Reply in the Slack thread (not the channel directly) and Claude resumes from where it left off.


Quickstart — Slack → Claude

Tag the bot in a Slack channel and Claude runs inside the matching project directory.

1. Set PROJECTS_DIR in .env

PROJECTS_DIR=C:\Users\you\projects

This is the parent directory that contains all your projects. It's mounted into the container at /projects/.

2. Create projects.json

Map each Slack channel to a project folder:

{
  "#my-project-channel": "/projects/my-project"
}

3. Rebuild

docker compose up -d --build

Then in Slack:

@claude-bot fix the login redirect bug

The bot replies in a thread. Continue the conversation by replying in that thread.

→ Full reference (channel formats, plugin_dir, worktrees, routing rules): docs/slack-to-claude-projects.md


The full-process plugin

A turnkey feature-development workflow driven entirely from Slack. After a one-time /process-setup in your repo, you can start a feature from Slack with:

@claude-bot /process start

The bot lists your open tasks (from Notion, Linear, Jira, …), creates a git worktree for the one you pick, walks the work through your configured steps (typically design → plan → run-plan), opens a GitHub PR after each step, and waits for your approval in Slack before moving on.

→ Full guide: docs/full-process-plugin.md


Next steps

Want to... See
Tag the bot from Slack docs/slack-to-claude-projects.md#how-it-works
Route channels to projects docs/slack-to-claude-projects.md#projectsjson--channel--project-routing
Use git worktrees from Slack docs/slack-to-claude-projects.md#worktrees
Run the turnkey feature-dev workflow from Slack docs/full-process-plugin.md
Configure access control or see all env vars docs/security.md
Understand the daemon + session internals docs/architecture.md
Use the /process GitHub PR workflow docs/github-setup.md
Wire .mcp.json in a Claude Code project docs/mcp-client-setup.md

Requirements

  • Docker (with Docker Compose)
  • A Slack workspace where you can create apps
  • Claude Code (or any MCP-compatible client)

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 模型以安全和受控的方式获取实时的网络信息。

官方
精选