home / mcp / slack mcp server

Slack MCP Server

Minimal Slack MCP Server, using FastMCP

Installation
Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "aryahadii-slack-mcp-server": {
      "url": "http://localhost:8000/mcp",
      "headers": {
        "RSA_PUBLIC_KEY": "<base64-encoded-PEM-public-key>",
        "RSA_PRIVATE_KEY": "<base64-encoded-PEM-private-key>",
        "SLACK_BOT_TOKEN": "<your-slack-bot-token>"
      }
    }
  }
}

This MCP (Model Context Protocol) server provides read-only access to Slack data, including channels, messages, and users, and protects every API endpoint with bearer token authentication. It enables you to query Slack workspaces from your ML applications or automation tools in a secure, easy-to-use way.

How to use

You connect to the Slack MCP Server using a client that supports MCP endpoints and bearer token authentication. Start by obtaining a valid JWT token from the server output after launch, then include it in every request header as Authorization: Bearer YOUR_TOKEN. Use the HTTP MCP endpoints to explore channels, channels details, messages, and user information.

Practical usage patterns include:

To test quickly from a terminal, authenticate with your token and call the list endpoint to verify connectivity. For example, you can fetch a list of channels and then request details for a chosen channel.

How to install

Prerequisites: you need Python and dependencies installed.

pip install -r requirements.txt

cp sample.env .env

# Edit the .env file to set your Slack Bot Token and RSA keys as base64-encoded PEM strings
# SLACK_BOT_TOKEN should be your Bot User OAuth Token from Slack
# RSA_PRIVATE_KEY and RSA_PUBLIC_KEY should be base64-encoded PEM strings

# Example (placeholders in this guide):
# SLACK_BOT_TOKEN=xoxb-your-token-here
# RSA_PRIVATE_KEY="<base64-encoded-PEM-private-key>"
# RSA_PUBLIC_KEY="<base64-encoded-PEM-public-key>"

# If you don’t have keys yet, you can generate them or let the server generate and print them once
# the first time you run the server or by running:
# python generate_client_token.py

Start the MCP server. It serves on localhost:8000 by default and requires a valid bearer token for API access.

python main.py

# Server runs at http://localhost:8000
# Bearer token is shown in the server output and must be used for requests

Security and usage notes

All API requests require a JWT bearer token. The server prints a token when it starts; you should use that token for your first authenticated calls. If you restart the server, it will reuse the same keypair stored for token validation, but you may need to obtain a fresh token from the server output.

Token usage applies to both HTTP API endpoints and the Server-Sent Events (SSE) connection. Include the Authorization header with your token for all communications.

Integration with LLM

You can integrate this MCP server with language models to provide read-only access to Slack data. The LLM can query channels, users, and messages but cannot create, modify, or delete data. When integrating, securely pass the API token to the client code that establishes the connection.

Available tools

list_channels

Lists all channels in the workspace.

get_channel_info

Gets detailed information about a specific channel.

get_messages

Retrieves messages from a channel with pagination support.

list_users

Lists all users in the workspace.

get_user_info

Gets detailed information about a specific user.