Skip to main content

MCP server for Slack notifications with bidirectional communication

Project description

Slack Notifier MCP

Python 3.10+ MCP License: MIT uv

MCP server for bidirectional Slack communication with Claude Code. Get notified when tasks complete, and respond to Claude's questions directly from Slack.

Quick Start

# Add to Claude Code (one command)
claude mcp add slack-notifier -s user \
  -e SLACK_BOT_TOKEN=xoxb-your-token \
  -e SLACK_DEFAULT_CHANNEL=YOUR-CHANNEL-ID \
  -- uvx slack-notifier-mcp@latest

Features

  • Send Messages - Send messages with optional urgency levels and thread support
  • Ask & Wait - Ask questions and wait for replies via Slack threads
  • Bidirectional - Reply to Claude from Slack, get responses back in your terminal
  • Urgency Levels - Normal, important, and critical notifications with appropriate formatting

Slack App Setup

Before using this server, you need to create a Slack app:

  1. Go to api.slack.com/apps and click Create New App
  2. Choose From scratch, name it (e.g., "Claude Code"), and select your workspace
  3. Go to OAuth & Permissions in the sidebar
  4. Under Scopes > Bot Token Scopes, add:
    • chat:write - Send messages
    • channels:history - Read public channel messages
    • groups:history - Read private channel messages
    • im:history - Read DM messages
    • users:read - Get user display names
  5. Click Install to Workspace at the top
  6. Copy the Bot User OAuth Token (starts with xoxb-)

To get your default channel ID:

  • Open Slack, right-click the channel, and select View channel details
  • At the bottom, copy the Channel ID (starts with C)

Installation

Claude Code (Recommended)

claude mcp add slack-notifier -s user \
  -e SLACK_BOT_TOKEN=xoxb-your-token \
  -e SLACK_DEFAULT_CHANNEL=YOUR-CHANNEL-ID \
  -- uvx slack-notifier-mcp@latest

VS Code

code --add-mcp '{"name":"slack-notifier","command":"uvx","args":["slack-notifier-mcp@latest"],"env":{"SLACK_BOT_TOKEN":"xoxb-your-token","SLACK_DEFAULT_CHANNEL":"YOUR-CHANNEL-ID"}}'

Other MCP Clients

Claude Desktop

Add to your Claude Desktop config:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.config/Claude/claude_desktop_config.json
{
  "mcpServers": {
    "slack-notifier": {
      "command": "uvx",
      "args": ["slack-notifier-mcp@latest"],
      "env": {
        "SLACK_BOT_TOKEN": "xoxb-your-token",
        "SLACK_DEFAULT_CHANNEL": "YOUR-CHANNEL-ID"
      }
    }
  }
}
Cursor
  1. Go to Settings → MCP → Add new MCP Server
  2. Select command type
  3. Enter command: uvx slack-notifier-mcp@latest
  4. Add environment variables for SLACK_BOT_TOKEN and SLACK_DEFAULT_CHANNEL

Or add to ~/.cursor/mcp.json:

{
  "mcpServers": {
    "slack-notifier": {
      "command": "uvx",
      "args": ["slack-notifier-mcp@latest"],
      "env": {
        "SLACK_BOT_TOKEN": "xoxb-your-token",
        "SLACK_DEFAULT_CHANNEL": "YOUR-CHANNEL-ID"
      }
    }
  }
}
Windsurf / Other MCP Clients

Any MCP-compatible client can use slack-notifier:

{
  "mcpServers": {
    "slack-notifier": {
      "command": "uvx",
      "args": ["slack-notifier-mcp@latest"],
      "env": {
        "SLACK_BOT_TOKEN": "xoxb-your-token",
        "SLACK_DEFAULT_CHANNEL": "YOUR-CHANNEL-ID"
      }
    }
  }
}

Local Development

git clone https://github.com/strand-ai/slack-notifier-mcp.git
cd slack-notifier-mcp
uv sync
uv run slack-notifier-mcp

MCP Tools

send

Send a message to Slack with optional urgency and thread support.

# Simple message
send(message="Build completed successfully")

# With urgency (adds formatting and @here for critical)
send(
    message="Server is down!",
    urgency="critical"  # or "normal", "important"
)

# Reply in a thread
send(
    message="Done with the first step, moving on...",
    thread_ts="1234567890.123456"
)

# Mention user
send(
    message="Need your attention",
    mention_user=True
)

Parameters:

  • message (required): Message text (supports Slack mrkdwn)
  • channel (optional): Channel ID or name (uses default if not set)
  • thread_ts (optional): Thread timestamp to reply in a thread
  • urgency (optional): normal, important, or critical
  • mention_user (optional): If true, @mentions the configured user

ask_user

Send a question and wait for the user's reply.

ask_user(
    question="Should I use PostgreSQL or SQLite for the database?",
    context="Setting up the backend for the new API",
    timeout_minutes=10
)
# Returns: {"success": True, "reply": "Use PostgreSQL", ...}

Parameters:

  • question (required): The question to ask
  • channel (optional): Channel ID or name
  • context (optional): Additional context about what you're working on
  • timeout_minutes (optional): How long to wait (default 5, max 30)

get_thread_replies

Check for new replies in a thread.

get_thread_replies(
    channel="YOUR-CHANNEL-ID",
    thread_ts="1234567890.123456",
    since_ts="1234567891.000000"  # Only newer messages
)

Environment Variables

Variable Required Description
SLACK_BOT_TOKEN Yes Bot token from Slack app (xoxb-...)
SLACK_DEFAULT_CHANNEL No Default channel for notifications

Example Usage

Tell Claude Code:

"Notify me on Slack when the tests finish running"

"Ask me on Slack whether to proceed with the database migration"

"Send a Slack notification if any errors occur while I'm away"

Debugging

Run the MCP inspector to test tools:

npx @anthropics/mcp-inspector uvx slack-notifier-mcp@latest

Check if your token works:

curl -H "Authorization: Bearer xoxb-your-token" \
  https://slack.com/api/auth.test

Development

# Install with dev dependencies
uv sync --extra dev

# Run tests
uv run pytest

# Format code
uv run black slack_mcp
uv run ruff check slack_mcp --fix

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

slack_notifier_mcp-0.3.0.tar.gz (11.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

slack_notifier_mcp-0.3.0-py3-none-any.whl (12.1 kB view details)

Uploaded Python 3

File details

Details for the file slack_notifier_mcp-0.3.0.tar.gz.

File metadata

  • Download URL: slack_notifier_mcp-0.3.0.tar.gz
  • Upload date:
  • Size: 11.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for slack_notifier_mcp-0.3.0.tar.gz
Algorithm Hash digest
SHA256 59cd1fba6ac38a4d06cc86f7fc7ceeab887a7e87cb413e8b8b466fa04564ad66
MD5 a1de942900e75a3e26f0bd416f5a2f9d
BLAKE2b-256 f3782d356f46793394ac291b0688ae635b4af08dff8b3c045cf55b27fc626d7d

See more details on using hashes here.

Provenance

The following attestation bundles were made for slack_notifier_mcp-0.3.0.tar.gz:

Publisher: publish.yml on Strand-AI/slack-notifier-mcp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file slack_notifier_mcp-0.3.0-py3-none-any.whl.

File metadata

File hashes

Hashes for slack_notifier_mcp-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 176ef17e1875f9702e1315ccc1b1c66e0ab0d4db7711f851347531660aa2989e
MD5 033a0322b6a6f6460731bb12cc197e14
BLAKE2b-256 9dc368a3ffda1784ae57e7646dd4fb0a55c09cec682387b305576d8dd3bc15ec

See more details on using hashes here.

Provenance

The following attestation bundles were made for slack_notifier_mcp-0.3.0-py3-none-any.whl:

Publisher: publish.yml on Strand-AI/slack-notifier-mcp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page