Slack MCP server

Enables AI interaction with Slack workspaces through nine tools for channel management, messaging, user profiles, and reactions using both Bot and User OAuth tokens
Back to servers
Provider
Ubie
Release date
Apr 11, 2025
Language
TypeScript
Stats
37 stars

The MCP (Model Context Protocol) server for Slack enables AI assistants to interact with Slack workspaces through a standardized interface. This server bridges AI systems with Slack's API, providing tools for message posting, channel management, user information retrieval, and more.

Features

This server supports various Slack operations through the following tools:

  • slack_list_channels - List public channels in the workspace with pagination
  • slack_post_message - Post a new message to a Slack channel
  • slack_reply_to_thread - Reply to a specific message thread in Slack
  • slack_add_reaction - Add a reaction emoji to a message
  • slack_get_channel_history - Get recent messages from a channel
  • slack_get_thread_replies - Get all replies in a message thread
  • slack_get_users - Retrieve basic profile information of all users in the workspace
  • slack_get_user_profile - Get a user's profile information
  • slack_get_user_profiles - Get multiple users' profile information in bulk
  • slack_search_messages - Search for messages in the workspace

Installation

Install the package using npm:

npm install @ubie-oss/slack-mcp-server

Note that the package is hosted in GitHub Registry, so you'll need a Personal Access Token (PAT).

Configuration

Set up the required environment variables:

  • SLACK_BOT_TOKEN: Your Slack Bot User OAuth Token
  • SLACK_USER_TOKEN: Your Slack User OAuth Token (needed for certain features like message search)

You can set these directly or create a .env file:

SLACK_BOT_TOKEN=xoxb-your-bot-token
SLACK_USER_TOKEN=xoxp-your-user-token

Usage

Starting the Server

The server supports two transport methods:

Stdio Transport (Default)

For local integration, run:

npx @ubie-oss/slack-mcp-server

Streamable HTTP Transport

For web applications and remote clients, specify a port:

npx @ubie-oss/slack-mcp-server -port 3000

Alternatively, you can run the installed module with node:

# Stdio transport
node node_modules/.bin/slack-mcp-server

# HTTP transport  
node node_modules/.bin/slack-mcp-server -port 3000

Command Line Options

  • -port <number>: Start with Streamable HTTP transport on the specified port
  • -h, --help: Display help information

Client Configuration

For Stdio Transport (Claude Desktop, etc.)

{
  "slack": {
    "command": "npx",
    "args": [
      "-y",
      "@ubie-oss/slack-mcp-server"
    ],
    "env": {
      "NPM_CONFIG_//npm.pkg.github.com/:_authToken": "<your-github-pat>",
      "SLACK_BOT_TOKEN": "<your-bot-token>",
      "SLACK_USER_TOKEN": "<your-user-token>"
    }
  }
}

For Streamable HTTP Transport (Web applications)

First, start the server:

SLACK_BOT_TOKEN=<your-bot-token> SLACK_USER_TOKEN=<your-user-token> npx @ubie-oss/slack-mcp-server -port 3000

Then connect your client to: http://localhost:3000/mcp

Implementation Details

The server processes requests through a standardized flow:

  1. Validates the incoming request using Zod schemas
  2. Calls the appropriate Slack Web API method
  3. Parses the response to include only necessary fields
  4. Returns the formatted response as JSON

For example, when using slack_list_channels, the server validates the request parameters, calls slackClient.conversations.list, and returns a response containing only the relevant channel information.

How to add this MCP server to Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > MCP and click "Add new global MCP server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "cursor-rules-mcp": {
            "command": "npx",
            "args": [
                "-y",
                "cursor-rules-mcp"
            ]
        }
    }
}

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later