Skip to main content
Version: 0.0.1

How to Run Slack MCP Server

This guide explains how to run and configure the Slack MCP Server after installation.

Configuration

Before running the server, you need to set up your Slack API token. You have several options:

  1. Create a .env file in your project directory:

    SLACK_API_TOKEN=your_slack_api_token
  2. Specify the path to your .env file when starting the server:

    slack-mcp-server --env /path/to/.env

Using Command-line Arguments

You can provide your API token directly as a command-line argument:

slack-mcp-server --token your_slack_api_token

Running the Server

Alternative Deployment Options

This section covers running the server with Python. For containerized deployments, see 🐳 Docker Usage section below, which provides multiple server modes and production-ready configurations.

Basic Usage

Start the server with default settings using Python:

slack-mcp-server

This will start the server with HTTP streaming transport on port 8000.

Specifying Transport Type

You can choose between HTTP streaming and Server-Sent Events (SSE) transport:

For HTTP streaming (default)

slack-mcp-server --transport streamable-http

For SSE

slack-mcp-server --transport sse

Custom Port

Run the server on a specific port:

slack-mcp-server --port 8080

Full Example

slack-mcp-server --env /path/to/.env --transport sse --port 8080

🐳 Docker Usage

The Slack MCP Server provides a Docker image for easy deployment and containerized environments. The Docker container supports multiple server modes controlled by environment variables.

Quick Start with Docker

Pull and run the Docker image:

# Pull the latest image
docker pull chisanan232/slack-mcp-server:latest

# Run with minimal configuration (defaults to MCP server)
docker run -d -p 8000:8000 \
-e SLACK_BOT_TOKEN=xoxb-your-bot-token-here \
chisanan232/slack-mcp-server

Docker Server Modes

The Docker container uses the SERVICE_TYPE environment variable to determine which server to run:

SERVICE_TYPEDescriptionEntry Point
mcp (default)MCP server onlyslack-mcp-server
webhookWebhook server onlyslack-events-server
integratedCombined MCP + webhook via MCP entryslack-mcp-server --integrated
integrated-webhookCombined MCP + webhook via webhook entryslack-events-server --integrated

Environment Variables by Mode

🎯 Main Control Variable

Environment VariableDescriptionDefault
SERVICE_TYPEServer mode: mcp, webhook, integrated, integrated-webhookmcp

🤖 MCP Server Variables (SERVICE_TYPE=mcp or integrated)

Environment VariableDescriptionDefault
SLACK_BOT_TOKENSlack bot token (required) - format: xoxb-...-
MCP_TRANSPORTTransport mode: stdio, sse, streamable-httpstdio
MCP_HOSTHost for HTTP transports-
MCP_PORTPort for HTTP transports-
MCP_MOUNT_PATHMount path for HTTP transports-
MCP_LOG_LEVELLogging level: debug, info, warning, error-
MCP_ENV_FILEPath to custom .env file-
MCP_NO_ENV_FILEDisable .env file loading (set to true)-
MCP_INTEGRATEDEnable integrated mode (set to true)-
MCP_RETRYNumber of retry attempts for network operations-

🪝 Webhook Server Variables (SERVICE_TYPE=webhook or integrated-webhook)

Environment VariableDescriptionDefault
SLACK_BOT_TOKENSlack bot token (required) - format: xoxb-...-
SLACK_WEBHOOK_HOSTHost to listen on-
SLACK_WEBHOOK_PORTPort to listen on-
SLACK_WEBHOOK_LOG_LEVELLogging level: debug, info, warning, error-
SLACK_WEBHOOK_ENV_FILEPath to custom .env file-
SLACK_WEBHOOK_NO_ENV_FILEDisable .env file loading (set to true)-
SLACK_WEBHOOK_INTEGRATEDEnable integrated mode (set to true)-
SLACK_WEBHOOK_MCP_TRANSPORTMCP transport for integrated mode-
SLACK_WEBHOOK_MCP_MOUNT_PATHMCP mount path for integrated mode-
SLACK_WEBHOOK_RETRYNumber of retry attempts-

Docker Examples by Mode

🤖 MCP Server Mode

# MCP server with stdio transport (no HTTP port needed)
docker run -d \
-e SERVICE_TYPE=mcp \
-e SLACK_BOT_TOKEN=xoxb-your-token \
chisanan232/slack-mcp-server

🪝 Webhook Server Mode

# Standalone webhook server
docker run -d -p 3000:3000 \
-e SERVICE_TYPE=webhook \
-e SLACK_WEBHOOK_HOST=0.0.0.0 \
-e SLACK_WEBHOOK_PORT=3000 \
-e SLACK_BOT_TOKEN=xoxb-your-token \
chisanan232/slack-mcp-server

🔗 Integrated Server Mode

# Integrated server via MCP entry point
docker run -d -p 8000:8000 \
-e SERVICE_TYPE=integrated \
-e MCP_TRANSPORT=sse \
-e MCP_HOST=0.0.0.0 \
-e MCP_PORT=8000 \
-e SLACK_BOT_TOKEN=xoxb-your-token \
chisanan232/slack-mcp-server

Using Environment Files with Docker

Create a .env file for your configuration:

# Required Slack tokens
SLACK_BOT_TOKEN=xoxb-your-slack-bot-token-here
SLACK_SIGNING_SECRET=your-slack-signing-secret

# Optional Slack configuration
SLACK_BOT_ID=your-slack-bot-id
SLACK_USER_TOKEN=xoxp-your-user-token
SLACK_TEST_CHANNEL=#your-test-channel
SLACK_TEST_CHANNEL_ID=C1234567890

# Message queue backend (memory, redis, kafka)
QUEUE_BACKEND=memory
REDIS_URL=redis://localhost:6379/0
KAFKA_BOOTSTRAP=broker:9092

Mount the .env file when running the container:

docker run -d -p 8000:8000 \
-v $(pwd)/.env:/app/.env \
-e SERVICE_TYPE=mcp \
-e MCP_TRANSPORT=sse \
-e MCP_HOST=0.0.0.0 \
-e MCP_PORT=8000 \
chisanan232/slack-mcp-server

Docker Compose Example

Create a docker-compose.yml file:

version: '3.8'

services:
slack-mcp-server:
image: chisanan232/slack-mcp-server:latest
ports:
- "8000:8000"
environment:
- SERVICE_TYPE=integrated
- MCP_TRANSPORT=sse
- MCP_HOST=0.0.0.0
- MCP_PORT=8000
- SLACK_BOT_TOKEN=${SLACK_BOT_TOKEN}
env_file:
- .env
restart: unless-stopped
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8000/health"]
interval: 30s
timeout: 10s
retries: 3

# Example with Redis backend
slack-mcp-redis:
image: chisanan232/slack-mcp-server:latest
ports:
- "8001:8000"
environment:
- SERVICE_TYPE=integrated
- MCP_TRANSPORT=sse
- MCP_HOST=0.0.0.0
- MCP_PORT=8000
- SLACK_BOT_TOKEN=${SLACK_BOT_TOKEN}
- QUEUE_BACKEND=redis
- REDIS_URL=redis://redis:6379/0
depends_on:
- redis
restart: unless-stopped

redis:
image: redis:7-alpine
ports:
- "6379:6379"
restart: unless-stopped

Run with Docker Compose:

# Start services
docker-compose up -d

# View logs
docker-compose logs -f slack-mcp-server

# Stop services
docker-compose down

Production Deployment Tips

🔒 Security Best Practices

  1. Use Docker Secrets for sensitive data:

    # Create secret
    echo "xoxb-your-token" | docker secret create slack_bot_token -

    # Use in container
    docker service create \
    --name slack-mcp \
    --secret slack_bot_token \
    -e SLACK_BOT_TOKEN_FILE=/run/secrets/slack_bot_token \
    chisanan232/slack-mcp-server
  2. Use multi-stage builds for smaller images:

    FROM chisanan232/slack-mcp-server:latest
    # Add your custom configuration
  3. Run as non-root user:

    docker run --user 1000:1000 \
    -e SLACK_BOT_TOKEN=xoxb-your-token \
    chisanan232/slack-mcp-server

📊 Monitoring and Logging

  1. Health Check Configuration:

    docker run -d \
    --health-cmd="curl -f http://localhost:8000/health || exit 1" \
    --health-interval=30s \
    --health-timeout=10s \
    --health-retries=3 \
    chisanan232/slack-mcp-server
  2. Log Management:

    # Configure log driver
    docker run -d \
    --log-driver=json-file \
    --log-opt max-size=10m \
    --log-opt max-file=3 \
    chisanan232/slack-mcp-server

🚀 Scaling and Load Balancing

For high-availability deployments:

# docker-compose.yml for load balancing
version: '3.8'
services:
nginx:
image: nginx:alpine
ports:
- "80:80"
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf
depends_on:
- slack-mcp-1
- slack-mcp-2

slack-mcp-1:
image: chisanan232/slack-mcp-server:latest
environment:
- SERVICE_TYPE=integrated
- MCP_TRANSPORT=sse
- MCP_HOST=0.0.0.0
- MCP_PORT=8000

slack-mcp-2:
image: chisanan232/slack-mcp-server:latest
environment:
- SERVICE_TYPE=integrated
- MCP_TRANSPORT=sse
- MCP_HOST=0.0.0.0
- MCP_PORT=8000

Verifying Server Operation

Once the server is running, you can verify it's working by accessing:

curl http://localhost:8000/health

You should receive a JSON response confirming the server is operational.