Skip to main content
Glama
Slack MCP Server

Slack MCP Server

by piekstra

Slack MCP Server

A Model Context Protocol (MCP) server that provides tools for interacting with Slack workspaces through the Slack Web API.

Features

Channel Management

  • list_channels - List all channels in the workspace

  • get_channel_info - Get detailed information about a specific channel

  • create_channel - Create a new channel

  • archive_channel - Archive a channel

  • unarchive_channel - Unarchive a channel

  • set_channel_topic - Set channel topic

  • set_channel_purpose - Set channel purpose

User Management

  • list_users - List all users in the workspace

  • get_user_info - Get detailed information about a specific user

  • invite_to_channel - Invite users to a channel

Messaging

  • send_message - Send a message to a channel (supports Block Kit)

  • update_message - Update an existing message (supports Block Kit)

  • delete_message - Delete a message

  • get_channel_history - Get message history for a channel

  • search_messages - Search for messages across the workspace

Rich Message Formatting (Block Kit)

  • send_formatted_message - Send formatted messages with headers, sections, fields

  • send_notification_message - Send status notifications with emoji indicators

  • send_list_message - Send formatted lists with titles and descriptions

File Management

  • upload_file - Upload a file to one or more channels

Reactions

  • add_reaction - Add a reaction to a message

  • remove_reaction - Remove a reaction from a message

Workspace

  • get_team_info - Get information about the Slack workspace/team

Related MCP server: Slack MCP Server

Installation

For use with Claude Desktop or Claude CLI, install globally:

pip install slack-mcp-server

From source

git clone <repository-url>
cd slack-mcp-server
pip install -e .

Configuration

The Slack MCP Server uses macOS Keychain for secure credential storage. This is much safer than storing tokens in files.

Quick Setup

# Run the interactive setup
slack-mcp-setup
# or
python -m slack_mcp.setup

The setup wizard will:

  1. Guide you through obtaining a Slack API token

  2. Securely store credentials in your macOS Keychain

  3. Validate your configuration

Manual Keychain Setup

from slack_mcp.credentials import CredentialManager

manager = CredentialManager()
manager.store_credential("api_token", "xoxb-your-slack-bot-token")
manager.store_credential("workspace_id", "T1234567890")  # Optional

Environment Variables (Fallback)

If you prefer environment variables or are not on macOS, create a .env file:

# Required
SLACK_API_TOKEN=xoxb-your-slack-bot-token

# Optional
SLACK_WORKSPACE_ID=your-workspace-id

⚠️ Security Warning: Environment variables and .env files are less secure than keychain storage.

Getting a Slack API Token

  1. Go to api.slack.com/apps

  2. Create a new app or select an existing one

  3. Navigate to "OAuth & Permissions"

  4. Add the required OAuth scopes (see below)

  5. Install the app to your workspace

  6. Copy the "Bot User OAuth Token" (starts with xoxb-)

Required OAuth Scopes

The following OAuth scopes are required for full functionality:

Core Scopes:

  • channels:read - View basic channel information

  • channels:manage - Create and manage public channels

  • groups:read - View private channel information

  • groups:write - Create and manage private channels

  • chat:write - Send messages

  • files:write - Upload files

  • im:read - View direct message channels

  • mpim:read - View group direct message channels

  • reactions:read - View reactions

  • reactions:write - Add and remove reactions

  • team:read - View team information

  • users:read - View user information

⚠️ Search Limitation: The search_messages tool uses Slack's search API which requires user tokens with the search:read scope. Since this server is designed for bot tokens (xoxb-), search functionality will not work. Consider removing this feature or switching to user token authentication if search is needed.

After installing globally, add the server using Claude CLI. First, find your slack-mcp-server installation path:

# Find your slack-mcp-server executable path
which slack-mcp-server

Then add it with Claude CLI:

claude mcp add slack /path/to/slack-mcp-server

For example:

claude mcp add slack /usr/local/bin/slack-mcp-server

This automatically configures the server in your Claude Desktop configuration.

Usage with Claude Desktop (Manual Configuration)

Alternatively, you can manually add this to your claude_desktop_config.json:

{
  "mcpServers": {
    "slack": {
      "command": "python",
      "args": ["-m", "slack_mcp"]
    }
  }
}

With Environment Variables

{
  "mcpServers": {
    "slack": {
      "command": "python",
      "args": ["-m", "slack_mcp"],
      "env": {
        "SLACK_API_TOKEN": "xoxb-your-slack-bot-token"
      }
    }
  }
}

Usage with MCP Client

from mcp import Client

# Initialize client
client = Client()

# Connect to the Slack MCP server
await client.connect("python", ["-m", "slack_mcp"])

# List available tools
tools = await client.list_tools()

# Use a tool
result = await client.call_tool("list_channels", {
    "types": "public_channel",
    "exclude_archived": True,
    "limit": 10
})

Development

Setting up the development environment

# Clone the repository
git clone <repository-url>
cd slack-mcp-server

# Create a virtual environment
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate

# Install in development mode with dev dependencies
pip install -e ".[dev]"

# Set up credentials securely
slack-mcp-setup

Running tests

pytest

Code formatting

# Format with black
black slack_mcp/

# Lint with ruff
ruff check slack_mcp/

Examples

List public channels

result = await client.call_tool("list_channels", {
    "types": "public_channel",
    "exclude_archived": True,
    "limit": 20
})

Send a message

result = await client.call_tool("send_message", {
    "channel": "C1234567890",  # Channel ID
    "text": "Hello from MCP!"
})

Search for messages

result = await client.call_tool("search_messages", {
    "query": "project deadline",
    "sort": "timestamp",
    "sort_dir": "desc",
    "count": 10
})

Upload a file

result = await client.call_tool("upload_file", {
    "channels": "C1234567890,C0987654321",  # Comma-separated channel IDs
    "content": "This is the file content",
    "filename": "report.txt",
    "title": "Weekly Report",
    "initial_comment": "Here's this week's report"
})

Send a formatted message with Block Kit

result = await client.call_tool("send_formatted_message", {
    "channel": "C1234567890",
    "title": "Project Update",
    "text": "Here's the latest update on our project progress",
    "fields": "Status: In Progress, Due Date: Next Friday, Assignee: @john",
    "context": "Last updated 2 hours ago"
})

Send a notification message

result = await client.call_tool("send_notification_message", {
    "channel": "C1234567890",
    "status": "success",
    "title": "Deployment Complete",
    "description": "The application has been successfully deployed to production",
    "details": "Build #123 deployed at 14:30 UTC"
})

Send a list message

result = await client.call_tool("send_list_message", {
    "channel": "C1234567890",
    "title": "Meeting Agenda",
    "description": "Items to discuss in today's standup",
    "items": "Sprint review\nBlocker discussion\nNext week planning\nDemo preparation"
})

Send message with custom Block Kit

result = await client.call_tool("send_message", {
    "channel": "C1234567890",
    "text": "Custom formatted message",
    "blocks": json.dumps([
        {
            "type": "section",
            "text": {
                "type": "mrkdwn",
                "text": "*Important Notice*\nThis is a custom Block Kit message"
            }
        },
        {"type": "divider"},
        {
            "type": "context",
            "elements": [
                {
                    "type": "mrkdwn",
                    "text": "Created with custom blocks"
                }
            ]
        }
    ])
})

Error Handling

The server returns JSON-formatted error messages when operations fail:

{
  "error": "Slack API error: channel_not_found"
}

Common error codes:

  • not_authed - Invalid or missing API token

  • channel_not_found - Channel doesn't exist

  • user_not_found - User doesn't exist

  • message_not_found - Message doesn't exist

  • no_permission - Bot lacks required permissions

  • rate_limited - API rate limit exceeded

Security Considerations

  • 🔐 Keychain Storage: Use macOS Keychain for secure credential storage (recommended)

  • API Token: Never commit your Slack API token to version control

  • Permissions: Only grant the minimum required OAuth scopes

  • Rate Limits: The server respects Slack's rate limits (see Slack Rate Limits)

  • Message Content: Be mindful of sensitive information in messages and files

Credential Management Commands

# Interactive setup wizard
slack-mcp-setup

# View stored credentials
python -c "from slack_mcp.credentials import CredentialManager; m = CredentialManager(); print(m.list_stored_credentials())"

# Delete specific credential
python -c "from slack_mcp.credentials import CredentialManager; CredentialManager().delete_credential('api_token')"

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

Copyright (C) 2026 Slack MCP Server Contributors. Licensed under the GNU Affero General Public License, version 3 only (AGPL-3.0-only); see LICENSE.

Support

For issues and questions, please create an issue in the repository.

Available Tools

26 tools
add_reactionA

Add a reaction emoji to a message.

Args: channel: Channel ID where the message exists timestamp: Timestamp of the message emoji_name: Name of the emoji (without colons)

Inputs: channel (required), timestamp (required), emoji_name (required). Returns: result

archive_channelB

Archive a Slack channel.

Args: channel: Channel ID to archive

Inputs: channel (required). Returns: result

create_channelC

Create a new Slack channel.

Args: name: Name for the new channel is_private: Whether the channel should be private

Inputs: name (required), is_private. Returns: result

delete_messageC

Delete a message from a Slack channel.

Args: channel: Channel ID where the message exists ts: Timestamp of the message to delete

Inputs: channel (required), ts (required). Returns: result

get_channel_historyB

Get message history for a Slack channel.

Args: channel: Channel ID limit: Maximum number of messages to return oldest: Only messages after this timestamp latest: Only messages before this timestamp

Inputs: channel (required), limit, oldest, latest. Returns: result

get_channel_infoC

Get detailed information about a specific Slack channel.

Args: channel_id: The ID of the channel

Inputs: channel_id (required). Returns: result

get_team_infoB

Get information about the Slack workspace/team.

Inputs: no named parameters. Returns: result

get_user_infoB

Get detailed information about a specific Slack user.

Args: user_id: The ID of the user

Inputs: user_id (required). Returns: result

invite_to_channelC

Invite users to a Slack channel.

Args: channel: Channel ID users: Comma-separated list of user IDs

Inputs: channel (required), users (required). Returns: result

list_channelsB

List all channels in the Slack workspace.

Args: types: Comma-separated channel types (public_channel, private_channel, mpim, im) exclude_archived: Whether to exclude archived channels limit: Maximum number of channels to return (1-1000)

Inputs: types, exclude_archived, limit. Returns: result

list_usersC

List all users in the Slack workspace.

Args: limit: Maximum number of users to return include_locale: Include locale information for each user

Inputs: limit, include_locale. Returns: result

remove_reactionB

Remove a reaction emoji from a message.

Args: channel: Channel ID where the message exists timestamp: Timestamp of the message emoji_name: Name of the emoji (without colons)

Inputs: channel (required), timestamp (required), emoji_name (required). Returns: result

search_messagesC

Search for messages across the Slack workspace.

Args: query: Search query sort: Sort by 'score' or 'timestamp' sort_dir: Sort direction 'asc' or 'desc' count: Number of results to return

Inputs: query (required), sort, sort_dir, count. Returns: result

send_announcementC

Send a formatted announcement message.

Args: channel: Channel ID or name title: Announcement title message: Main announcement message author: Author name (optional) timestamp: Custom timestamp (optional) thread_ts: Thread timestamp for replies (optional)

Inputs: channel (required), title (required), message (required), author, +2 more. Returns: result

send_code_snippetB

Send a formatted code snippet message.

Args: channel: Channel ID or name title: Code snippet title code: The code content language: Programming language for syntax highlighting (optional) description: Optional description thread_ts: Thread timestamp for replies (optional)

Inputs: channel (required), title (required), code (required), language, +2 more. Returns: result

send_formatted_messageC

Send a formatted message using Block Kit with common elements.

Args: channel: Channel ID or name title: Header text (optional) text: Main message text (optional) fields: Comma-separated fields for side-by-side display (optional) context: Context text at bottom (optional) thread_ts: Thread timestamp for replies (optional)

Inputs: channel (required), title, text, fields, +2 more. Returns: result

send_form_messageB

Send a form-like message with a select menu.

Args: channel: Channel ID or name title: Form title description: Form description select_options: JSON string of select options [{"text": "Option 1", "value": "opt1"}] select_placeholder: Placeholder text for select menu select_action_id: Action ID for the select menu thread_ts: Thread timestamp for replies (optional)

Inputs: channel (required), title (required), description (required), select_options (required), +3 more. Returns: result

send_interactive_messageC

Send an interactive message with buttons.

Args: channel: Channel ID or name title: Message title description: Message description buttons: JSON string of button configurations [{"text": "Button Text", "action_id": "action_1", "style": "primary"}] thread_ts: Thread timestamp for replies (optional)

Inputs: channel (required), title (required), description (required), buttons (required), +1 more. Returns: result

send_list_messageB

Send a formatted list message.

Args: channel: Channel ID or name title: List title items: Newline or comma-separated list items description: Optional description text thread_ts: Thread timestamp for replies (optional)

Inputs: channel (required), items (required), description, thread_ts. Returns: result

send_messageB

Send a message to a Slack channel.

Args: channel: Channel ID or name text: Message text (fallback text for notifications) thread_ts: Thread timestamp for replies blocks: JSON string of Block Kit blocks for rich formatting

Inputs: channel (required), text (required), thread_ts, blocks. Returns: result

send_notification_messageB

Send a structured notification message with status indicator.

Args: channel: Channel ID or name status: Status type (success, warning, error, info) title: Notification title description: Main description details: Additional details (optional) thread_ts: Thread timestamp for replies (optional)

Inputs: channel (required), status (required), title (required), description (required), +2 more. Returns: result

set_channel_purposeC

Set the purpose for a Slack channel.

Args: channel: Channel ID purpose: New purpose text

Inputs: channel (required), purpose (required). Returns: result

set_channel_topicB

Set the topic for a Slack channel.

Args: channel: Channel ID topic: New topic text

Inputs: channel (required), topic (required). Returns: result

unarchive_channelC

Unarchive a Slack channel.

Args: channel: Channel ID to unarchive

Inputs: channel (required). Returns: result

update_messageC

Update an existing Slack message.

Args: channel: Channel ID where the message exists ts: Timestamp of the message to update text: New message text (fallback text for notifications) blocks: JSON string of Block Kit blocks for rich formatting

Inputs: channel (required), ts (required), text (required), blocks. Returns: result

upload_fileC

Upload a file to one or more Slack channels.

Args: channels: Comma-separated list of channel IDs content: File content as text filename: Name for the file title: Title of the file initial_comment: Initial comment for the file

Inputs: channels (required), content (required), filename (required), title, +1 more. Returns: result

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    B3.4/5.0

    Scored across 26 tools

    Disambiguation4/5

    Most tools have distinct purposes, but there is some overlap among message-sending tools (send_message, send_formatted_message, send_notification_message, etc.) that could cause confusion. However, their descriptions clarify specific use cases, preventing major misselection.

    Naming Consistency5/5

    Tool names follow a consistent snake_case verb_noun pattern throughout (e.g., add_reaction, archive_channel, create_channel). All tools adhere to this convention, making them predictable and readable.

    Tool Count3/5

    With 26 tools, the count is borderline high for a Slack server, as it includes many specialized message-sending variants. While comprehensive, it may feel heavy compared to typical MCP servers, which often have 3-15 tools for well-scoped purposes.

    Completeness5/5

    The tool set provides complete coverage for Slack interactions, including channel management (create, archive, unarchive, set purpose/topic), user and channel info retrieval, message handling (send, update, delete, search, history), reactions, file uploads, and invitations. No obvious gaps exist for core workflows.

    Maintenance

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      D
      maintenance
      Enables interaction with Slack workspaces as a user, supporting channel listing, message posting, threading, reactions, and user management via the Slack API.
      8
      11
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables comprehensive Slack workspace automation and management through the Slack API. Supports messaging, channel management, analytics, file uploads, polls, user management, and advanced features like scheduled messages and bulk operations.
      53,213 npm
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables interaction with Slack workspaces through comprehensive integration capabilities. Supports channel management, messaging, thread replies, reactions, and message history retrieval through natural language commands.
      MIT