home / mcp / slack mcp server

Slack MCP Server

Provides Slack workspace access via MCP with channels, DMs, history, search, and safe posting via multiple transports.

Installation
Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "korotovsky-slack-mcp-server": {
      "command": "npx",
      "args": [
        "@modelcontextprotocol/inspector",
        "go",
        "run",
        "mcp/mcp-server.go",
        "--transport",
        "stdio"
      ],
      "env": {
        "SLACK_MCP_HOST": "127.0.0.1",
        "SLACK_MCP_PORT": "13080",
        "SLACK_MCP_PROXY": "<PROXY_URL>",
        "SLACK_MCP_API_KEY": "<API_KEY>",
        "SLACK_MCP_GOVSLACK": "<true|false>",
        "SLACK_MCP_LOG_LEVEL": "info",
        "SLACK_MCP_SERVER_CA": "<CA_PATH>",
        "SLACK_MCP_CUSTOM_TLS": "<CUSTOM_TLS_CONFIG>",
        "SLACK_MCP_USER_AGENT": "<CUSTOM_USER_AGENT>",
        "SLACK_MCP_XOXB_TOKEN": "<YOUR_XOXB_TOKEN>",
        "SLACK_MCP_XOXC_TOKEN": "<YOUR_XOXC_TOKEN>",
        "SLACK_MCP_XOXD_TOKEN": "<YOUR_XOXD_TOKEN>",
        "SLACK_MCP_XOXP_TOKEN": "<YOUR_XOXP_TOKEN>",
        "SLACK_MCP_USERS_CACHE": "<path>",
        "SLACK_MCP_CHANNELS_CACHE": "<path>",
        "SLACK_MCP_ADD_MESSAGE_MARK": "<true|false>",
        "SLACK_MCP_ADD_MESSAGE_TOOL": "<true|false|comma,separated,ids>",
        "SLACK_MCP_SERVER_CA_TOOLKIT": "<TOOLKIT_CA>",
        "SLACK_MCP_SERVER_CA_INSECURE": "false",
        "SLACK_MCP_ADD_MESSAGE_UNFURLING": "<true|false|domains>"
      }
    }
  }
}

This Model Context Protocol Slack MCP Server lets you interact with Slack workspaces via multiple transports (stdio, SSE, HTTP) and supports DMs, channels, threads, smart history, message search, and safe posting controls. It’s designed to work with both OAuth and stealth modes, enabling flexible integration with enterprise Slack setups and various proxy environments.

How to use

You run the MCP server locally or in your environment and connect to it from an MCP client using stdio, SSE, or HTTP transports. The server can fetch messages from channels and threads, search messages across conversations, and post messages or emoji reactions when enabled. You can enable or restrict posting tools with environment variables and leverage caches to speed up access to channel and user data.

How to install

Prerequisites: you need Node.js installed to use npm/npx for local tooling, though the MCP server itself can be operated via stdio transport with a runtime command shown in examples.

# Quick start example for a stdio-based run (see the Run inspector example below for details)
npx @modelcontextprotocol/inspector go run mcp/mcp-server.go --transport stdio

Configuration and usage notes

The server supports both stealth mode and OAuth mode. Stealth mode allows you to run without additional permissions or bot installations, while OAuth mode uses tokens for access. You can enable posting tools selectively via environment variables, and you can restrict posting to specific channels if needed.

Key transport options include stdio, SSE, and HTTP transports. If you operate behind a proxy, configure the outgoing requests accordingly. Cached user and channel data speed up startup and message retrieval.

Advanced usage: debugging and runtime commands

To run the inspector with stdio transport, use the following command.

npx @modelcontextprotocol/inspector go run mcp/mcp-server.go --transport stdio

Environment variables (quick reference)

Configure authentication, proxies, TLS, and feature toggles using the environment variables listed here. Some variables are required for authentication; others control behavior or security.

Troubleshooting and logs

View logs and debugging information to diagnose issues. Logs are typically written to your system's standard logging locations. If you need guidance, examine the log files and adjust configuration variables accordingly.

Security

Protect your tokens and secure all credentials. Keep sensitive configuration files private and restrict access to your MCP server.

Available tools

conversations_history

Fetch messages from a channel or DM with optional activity messages, supporting pagination via a cursor and limits by date range or count.

conversations_replies

Retrieve a thread's messages by channel and thread timestamp, with optional activity messages and pagination.

conversations_add_message

Post a message to a channel or DM; posting is disabled by default and can be enabled via SLACK_MCP_ADD_MESSAGE_TOOL with optional channel whitelisting.

conversations_search_messages

Search messages across channels and DMs with multiple filters; not available with bot tokens. Returns a list of matching messages.

channels_list

List channels by types (public/private/im/mpim) with optional sorting and pagination.

reactions_add

Add emoji reactions to a message; posting via reactions tools is controlled by the add message tool and channel whitelisting.

reactions_remove

Remove emoji reactions from a message; permission mirrors reactions_add settings.

users_search

Search for users by name, email, or display name and return user details plus available DM channel IDs.