0%
Fact Checked ✓
guides
Depth0%

ConnectClaudeCodetoSlackwithMCP:BuildanAITeamAssistant

Build a Claude-powered Slack AI bot using the Slack MCP server and Claude Code. Full setup guide — answer questions, summarize threads, create tasks, and automate team workflows.

Author
Lazy Tech Talk EditorialApr 18
Connect Claude Code to Slack with MCP: Build an AI Team Assistant

Claude Code MCP Integration — Series

4 Parts

📋 At a Glance

  • Difficulty: Intermediate
  • Time required: 45-60 minutes
  • Prerequisites:
    • Slack workspace where you have Admin or App Management permissions
    • Node.js 18+ installed
    • Claude Code installed (claude CLI, version 1.5+)
    • Basic familiarity with Slack's Bot Token system and JSON
    • Anthropic API key with Claude access
  • Works on: Windows 10/11, macOS (Intel/Apple Silicon), Linux

Why Use Claude Code as Your Slack Team Assistant?

A Claude-powered Slack assistant does something no off-the-shelf Slack bot can: it reasons. When a junior developer asks a question in #engineering, Claude can search the channel history, find the three most relevant past discussions, synthesize an answer that accounts for your team's specific patterns and decisions, and post it in a structured, helpful format — all automatically.

For distributed teams, this is transformative. Claude can monitor #incidents and generate a real-time incident summary. It can read your #product channel and produce a weekly priorities digest every Monday morning. It can sit in #deployments and explain what every automated build message means in plain English. The MCP connection makes Claude a full participant in your team's communication layer, not just a side tool.

How Do I Set Up the Slack MCP Server?

Setting up the Slack MCP involves creating a Slack App, granting it the correct OAuth scopes, installing an MCP server bridge, and configuring Claude Code to use it.

1. Create a Slack App and Get a Bot Token

What: Create a new Slack application with the permissions Claude needs to read and write to your workspace. Why: Slack's security model requires all API access to go through an authenticated App with explicitly granted OAuth scopes. The Bot Token is the credential Claude's MCP server uses for all Slack interactions. How:

  1. Navigate to api.slack.com/apps and click "Create New App".
  2. Choose "From scratch", name it (e.g., Claude Assistant), and select your workspace.
  3. In the left sidebar, go to "OAuth & Permissions".
  4. Under "Bot Token Scopes", add: channels:history, channels:read, chat:write, groups:history, im:history, im:write, search:read, users:read.
  5. Click "Install to Workspace" and authorize. Copy the Bot User OAuth Token (starts with xoxb-).
export SLACK_BOT_TOKEN="xoxb-xxxxxxxxxxxx-xxxxxxxxxxxx-xxxxxxxxxxxxxxxxxxxxxxxx"

Verify: > ✅ Test: curl -H "Authorization: Bearer $SLACK_BOT_TOKEN" https://slack.com/api/auth.test — response should include ok: true.

2. Enable Socket Mode and Get an App-Level Token

What: Enable Slack's Socket Mode to receive real-time events without requiring a public webhook URL. Why: Socket Mode uses a persistent WebSocket connection, eliminating the need for ngrok or port forwarding during development. How:

  1. In app settings, go to "Socket Mode" and toggle ON.
  2. Create an App-Level Token with the connections:write scope.
  3. Copy the token (starts with xapp-).
export SLACK_APP_TOKEN="xapp-1-xxxxxxxxxxxx-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"

Verify: > ✅ Both tokens are set. xoxb- is for bot actions. xapp- is for receiving real-time events.

3. Subscribe to Slack Events

What: Tell Slack which events to forward to your MCP server. Why: Without event subscriptions, your bot is passive and cannot react to messages or mentions. How:

  1. Go to "Event Subscriptions" and toggle ON.
  2. Under "Subscribe to bot events", add: app_mention, message.channels, message.im.
  3. Save changes and reinstall the app if prompted. Verify: > ✅ Invite your bot to a channel and @mention it — the event should be received by your MCP server once running.

4. Install the Slack MCP Server

What: Install and configure the Slack MCP server bridge. Why: Translates Claude's tool calls into authenticated Slack API requests. How:

npm install -g @modelcontextprotocol/server-slack

Add to your Claude MCP config (~/.claude/mcp_servers.json):

{
  "mcpServers": {
    "slack": {
      "command": "slack-mcp-server",
      "env": {
        "SLACK_BOT_TOKEN": "xoxb-xxxxxxxxxxxx",
        "SLACK_TEAM_ID": "T0XXXXXXXXXX"
      }
    }
  }
}

Verify: > ✅ Run: claude mcp list — you should see slack listed with tools like post_message, get_channel_history, and search_messages.

5. Test Claude's Slack Access Interactively

What: Validate the full integration chain with interactive Claude Code commands. How:

claude

Test listing channels:

List all public Slack channels in my workspace with activity in the last 7 days.

Test message posting:

Post to #general: "👋 Claude AI assistant is now connected via MCP. Say hi to test!"

Test summarization:

Fetch the last 50 messages from #engineering and give me a 3-bullet summary of the main topics.

Verify: > ✅ All three commands execute successfully, message appears in Slack, and summary reflects actual channel content.

What Can I Build With Claude + Slack MCP?

The real value is automating the repetitive cognitive labor that buries every engineering team.

Recipe 1: Intelligent Thread Summarizer

Summarize the thread from @sarah about the deploy failure in #deployments yesterday. Give me:
1. What broke
2. What the team tried
3. Final resolution
4. Action items

Recipe 2: Daily Engineering Digest

Schedule Claude to post a morning digest every weekday to #engineering:

Fetch the last 24 hours of messages from #engineering, #deployments, and #incidents.
Post a structured digest with: 🚨 Open Incidents, 🚀 Recent Deployments, 💬 Topics Needing Decisions.

Recipe 3: AI On-Call for #help Channels

Monitor #help-backend. When a new question is posted:
1. Search history for similar answered questions
2. If found, reply with the past answer
3. If not found, tag the relevant team member based on topic

When Connecting Claude to Slack via MCP Is NOT the Right Choice

  1. Regulated industries with strict data retention policies:

    • Limitation: Slack messages sent to Claude's context are transmitted to Anthropic's API. May create compliance violations for HIPAA, SEC, or GDPR-regulated data.
    • Alternative: Use Anthropic's zero data-retention API option or deploy a self-hosted model.
  2. Workspaces with sensitive HR or personnel communications:

    • Limitation: Claude may inadvertently expose sensitive information from HR channels in summaries posted to broader channels.
    • Alternative: Restrict bot membership strictly to technical and project channels.
  3. Large enterprises with very high message volume:

    • Limitation: Slack's API rate limits become a bottleneck, and Claude API costs scale rapidly with message volume.
    • Alternative: Process messages in batches with a queuing system and use selective summarization on high-signal channels only.
  4. Real-time alerting requiring sub-second response:

    • Limitation: The MCP → Claude → Slack pipeline takes 3-15 seconds — unacceptable for live incident alerting.
    • Alternative: Use PagerDuty or native monitoring integrations for real-time alerts; use Claude for post-incident analysis.
  5. Deterministic, auditable compliance workflows:

    • Limitation: Claude's responses are probabilistic and not fully auditable.
    • Alternative: Use rule engines for compliance-sensitive responses; reserve Claude for advisory and summarization tasks.

#Frequently Asked Questions

Can Claude respond automatically to every message in a channel, or does it need to be @mentioned? Both modes are possible. Best practice is to respond only to app_mention events and use scheduled polling for digest tasks. Responding to every message is expensive and creates noise.

How do I prevent Claude from posting sensitive information publicly? Explicitly instruct Claude in its system prompt to never post personal information publicly, always DM users with sensitive responses, and never summarize HR or executive channel content. Combine with strict channel membership controls.

Is the Slack MCP server maintained by Slack or the community? The @modelcontextprotocol/server-slack package is part of Anthropic's official MCP server collection. It is actively maintained but not an official Slack product. Pin to a specific version in production.

#Quick Verification Checklist

  • Slack App created with all required Bot Token OAuth scopes.
  • SLACK_BOT_TOKEN (xoxb-) stored securely as environment variable.
  • Socket Mode enabled and SLACK_APP_TOKEN (xapp-) stored.
  • Event subscriptions configured: app_mention, message.channels, message.im.
  • App reinstalled to workspace after permission changes.
  • @modelcontextprotocol/server-slack installed via npm.
  • Claude Code mcp_servers.json updated with slack config including SLACK_TEAM_ID.
  • claude mcp list shows slack as an active server.
  • Interactive test: Claude lists channels, posts message, and summarizes channel history.
  • Bot invited only to appropriate non-sensitive channels.

Related Reading

Last updated: April 18, 2026

Lazy Tech Talk Newsletter

Get the next MCP integration guide in your inbox

Harit
Meet the Author

Harit

Editor-in-Chief at Lazy Tech Talk. Independent verification, technical accuracy, and zero-bias reporting.

Keep Reading

All Guides →

RESPECTS

Submit your respect if this protocol was helpful.

COMMUNICATIONS

⚠️ Guest Mode: Your communication will not be linked to a verified profile.Login to verify.

No communications recorded in this log.

Premium Ad Space

Reserved for high-quality tech partners