Build MCP Slack Server: Read and Post Messages with AI 2026

Connect Claude or Cursor to your Slack workspace via MCP. Read channels, post messages, and search threads with AI using Bot Token and npx setup. Tested on Node 22.

Problem: Your AI Can't See What's Happening in Slack

MCP Slack server is the bridge that lets AI assistants like Claude read channels, post messages, and search threads — without copy-pasting context manually into every prompt.

If you've tried wiring an AI agent to Slack using the raw Web API, you know the pain: token scopes, rate limits, pagination, and writing glue code just to read a channel history. The MCP approach flips this — your AI client calls structured tools, and the server handles all Slack communication.

You'll learn:

  • How to create a Slack app and configure the right Bot Token scopes
  • How to run @modelcontextprotocol/server-slack via npx in Claude Desktop or Cursor
  • How to enable message posting (disabled by default) and test the full read/write loop

Time: 20 min | Difficulty: Intermediate


Why This Setup Works Better Than the Raw Slack API

Direct Slack API integrations require you to handle OAuth flows, refresh tokens, paginate history calls, and format Slack's block kit responses yourself. The MCP server wraps all of that into discrete tools that your AI client calls natively — no custom glue code.

What the MCP server exposes:

  • slack_list_channels — lists public channels (up to 200 per query)
  • slack_get_channel_history — fetches recent messages from a channel
  • slack_post_message — sends a message to any channel the bot has joined
  • slack_reply_to_thread — replies inside an existing thread
  • slack_get_thread_replies — reads a full thread conversation
  • slack_get_users — lists workspace members with profile info
  • slack_get_user_profile — fetches a specific user's profile

Message posting is disabled by default for safety. You enable it explicitly via SLACK_MCP_ADD_MESSAGE_TOOL or by listing it in SLACK_MCP_ENABLED_TOOLS.

Symptoms you're in the right place:

  • Claude or Cursor can't see your Slack channels without you pasting messages in
  • You want AI to summarize channel history, find decisions, or post standup updates
  • You're building an agentic workflow that needs Slack as an input and output surface

Solution

Step 1: Create a Slack App

Go to api.slack.com/apps and click Create New App → From scratch.

Name it something descriptive (MCP Bot, AI Agent) and select the workspace you want to connect.

Navigate to OAuth & Permissions in the left sidebar. Under Bot Token Scopes, add the following:

channels:history      # read public channel messages
channels:read         # list public channels
groups:history        # read private channel messages
groups:read           # list private channels
im:history            # read DMs
im:read               # list DMs
chat:write            # post messages (required for posting)
users:read            # list workspace users
team:read             # read team/workspace info

Scroll to the top of the OAuth & Permissions page and click Install to Workspace. Approve the permissions. After installation, copy the Bot User OAuth Token — it starts with xoxb-. Keep this.

Also note your Team ID from the workspace URL: https://app.slack.com/client/T01234567/. The T01234567 part is your SLACK_TEAM_ID.


Step 2: Add the Bot to Channels

The bot can only read channels it has been added to. In Slack, open each channel you want the AI to access and run:

/invite @YourBotName

For public channels, you can also add the bot programmatically later — but for the initial test, add it to at least one channel manually.


Step 3: Configure Claude Desktop

Open Claude Desktop and go to Settings → Developer → Edit Config. The config file is at:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json

Add the Slack MCP server block:

{
  "mcpServers": {
    "slack": {
      "command": "npx",
      "args": [
        "-y",
        "@modelcontextprotocol/server-slack"
      ],
      "env": {
        "SLACK_BOT_TOKEN": "xoxb-your-bot-token-here",
        "SLACK_TEAM_ID": "T01234567",
        "SLACK_CHANNEL_IDS": "C01234567,C76543210"
      }
    }
  }
}

SLACK_CHANNEL_IDS is optional — omit it to allow access to all channels the bot has joined. Include it to restrict access to specific channels.

Expected output: Claude Desktop restarts cleanly. No error on launch means the config parsed correctly.

If it fails:

  • spawn npx ENOENT → Node.js is not on your PATH. Install Node 22 from nodejs.org and restart Claude Desktop.
  • missing_scope error in Claude → The bot token is missing a required scope. Go back to api.slack.com/apps, add the scope, reinstall the app.

Step 4: Configure Cursor (Alternative to Claude Desktop)

For Cursor, add the MCP server via Settings → MCP or directly in .cursor/mcp.json at your project root:

{
  "mcpServers": {
    "slack": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-slack"],
      "env": {
        "SLACK_BOT_TOKEN": "xoxb-your-bot-token-here",
        "SLACK_TEAM_ID": "T01234567"
      }
    }
  }
}

Restart Cursor after saving. The MCP tools will appear in the Agent mode tool list.


Step 5: Enable Message Posting

By default, slack_post_message is read-only configured — the tool exists but posts are blocked. To enable posting to all channels:

{
  "mcpServers": {
    "slack": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-slack"],
      "env": {
        "SLACK_BOT_TOKEN": "xoxb-your-bot-token-here",
        "SLACK_TEAM_ID": "T01234567",
        "SLACK_MCP_ADD_MESSAGE_TOOL": "true"
      }
    }
  }
}

To enable posting to specific channels only (safer for production):

"SLACK_MCP_ADD_MESSAGE_TOOL": "C01234567,C76543210"

To allow all channels except one:

"SLACK_MCP_ADD_MESSAGE_TOOL": "!C99999999"

Verification

In Claude Desktop, start a new chat and click the Search and tools button. You should see the Slack MCP tools listed. Enable all tools if prompted.

Test reading:

Prompt: "List the channels in my Slack workspace"

You should see: A list of channels the bot has joined, with member counts.

Test posting (only if SLACK_MCP_ADD_MESSAGE_TOOL is set):

Prompt: "Post 'MCP test message — ignore' to #general"

You should see: Confirmation from Claude that the message was posted, and the message appears in Slack.

Test thread reading:

Prompt: "Read the last 10 messages from #engineering and summarize what the team is working on"

What You Learned

  • The MCP Slack server abstracts all Slack API pagination and token management — you interact through typed tools, not raw HTTP calls
  • SLACK_BOT_TOKEN (xoxb-) is a Bot User OAuth Token, not a legacy token — it expires only when revoked, not on a timer
  • Message posting is opt-in by design; always restrict SLACK_MCP_ADD_MESSAGE_TOOL to specific channel IDs in shared or production environments
  • The bot can only access channels it has been explicitly invited to — this is a Slack permission boundary, not an MCP limitation

Limitation: The @modelcontextprotocol/server-slack package does not yet support private DM reading between users, only IM channels the bot is part of. For DM access, use the korotovsky/slack-mcp-server build which supports stealth mode with session tokens.

Tested on @modelcontextprotocol/server-slack 0.2.x, Node 22, Claude Desktop 0.9.x, macOS Sequoia and Ubuntu 24.04


FAQ

Q: How do I find my Slack Team ID? A: Open Slack in your browser. The URL will look like https://app.slack.com/client/T01234567/. The segment starting with T is your Team ID.

Q: Does the MCP Slack server work without a GPU? A: Yes — the MCP server runs on Node.js and communicates with the Slack API over HTTPS. No local model or GPU is involved. The AI inference runs in Claude Desktop or Cursor, not the MCP server.

Q: What is the difference between SLACK_BOT_TOKEN and a user token? A: A bot token (xoxb-) represents the bot app identity. A user token (xoxp-) represents a specific human user. For most MCP integrations, the bot token is preferred — it scopes access to what the app explicitly requests, and doesn't carry the full permissions of a human admin account.

Q: Can I run this MCP Slack server with n8n or Flowise at the same time? A: Yes. MCP servers are independent processes. You can run the Slack MCP server alongside other MCP servers in Claude Desktop or Cursor without conflicts. Be cautious about sharing the same bot token across multiple MCP clients simultaneously — Slack rate limits apply per token.

Q: What scopes does chat:write require from an admin? A: chat:write is a standard bot scope that any workspace member can approve when installing the app. It does not require admin approval unless your workspace has admin-only app installation policies enabled.