Slack MCP server

Integrates with Slack workspaces to enable user-level interactions like messaging, reactions, and channel management without bot permissions.
Back to servers
Setup instructions
Provider
Lars Hagen
Release date
Jan 29, 2025
Language
TypeScript
Stats
6 stars

This MCP server allows Claude to interact with Slack workspaces on your behalf, enabling operations like posting messages, listing channels, adding reactions, and retrieving conversation history.

Installation

To use this MCP server, you'll need to create a Slack app, configure appropriate permissions, and then set up the server through one of several available methods.

Creating a Slack App

  1. Visit the Slack Apps page
  2. Click "Create New App"
  3. Choose "From scratch"
  4. Name your app and select your workspace

Configuring Permissions

Navigate to "OAuth & Permissions" in your Slack app settings and add these scopes:

  • channels:history - View messages in public channels
  • channels:read - View basic channel information
  • chat:write - Send messages as yourself
  • reactions:write - Add emoji reactions to messages
  • users:read - View users and their basic information

After adding these scopes:

  • Click "Install to Workspace" and authorize the app
  • Save the "User OAuth Token" that starts with xoxp-
  • Get your Team ID (starts with a T) by following this guidance

Setup Options

Option 1: Local Installation

Install and build the server:

git clone https://github.com/lars-hagen/slack-user-mcp.git
cd slack-user-mcp
npm install
npm run build

Add to your claude_desktop_config.json:

{
  "mcpServers": {
    "slack": {
      "command": "npm",
      "args": [
        "run",
        "--prefix",
        "/path/to/slack-user-mcp",
        "start"
      ],
      "env": {
        "SLACK_TOKEN": "xoxp-your-user-token",
        "SLACK_TEAM_ID": "T01234567"
      }
    }
  }
}

Option 2: NPX Installation

Add to your claude_desktop_config.json:

{
  "mcpServers": {
    "slack": {
      "command": "npx",
      "args": [
        "-y",
        "@modelcontextprotocol/server-slack-user"
      ],
      "env": {
        "SLACK_TOKEN": "xoxp-your-user-token",
        "SLACK_TEAM_ID": "T01234567"
      }
    }
  }
}

Option 3: Docker Installation

Add to your claude_desktop_config.json:

{
  "mcpServers": {
    "slack": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "-e",
        "SLACK_TOKEN",
        "-e",
        "SLACK_TEAM_ID",
        "mcp/slack-user"
      ],
      "env": {
        "SLACK_TOKEN": "xoxp-your-user-token",
        "SLACK_TEAM_ID": "T01234567"
      }
    }
  }
}

Option 4: Smithery Installation

For automatic installation with Claude Desktop:

npx -y @smithery/cli install @lars-hagen/slack-user-mcp2 --client claude

Available Tools

Listing Channels

slack_list_channels

Lists public channels in the workspace.

  • Optional inputs:
    • limit (default: 100, max: 200): Maximum number of channels to return
    • cursor: Pagination cursor for next page

Posting Messages

slack_post_message

Posts a new message to a Slack channel.

  • Required inputs:
    • channel_id: The ID of the channel to post to
    • text: The message text to post

Replying to Threads

slack_reply_to_thread

Replies to a specific message thread.

  • Required inputs:
    • channel_id: The channel containing the thread
    • thread_ts: Timestamp of the parent message
    • text: The reply text

Adding Reactions

slack_add_reaction

Adds an emoji reaction to a message.

  • Required inputs:
    • channel_id: The channel containing the message
    • timestamp: Message timestamp to react to
    • reaction: Emoji name without colons

Getting Channel History

slack_get_channel_history

Gets recent messages from a channel.

  • Required inputs:
    • channel_id: The channel ID
  • Optional inputs:
    • limit (default: 10): Number of messages to retrieve

Getting Thread Replies

slack_get_thread_replies

Gets all replies in a message thread.

  • Required inputs:
    • channel_id: The channel containing the thread
    • thread_ts: Timestamp of the parent message

Listing Users

slack_get_users

Gets list of workspace users with basic profile information.

  • Optional inputs:
    • cursor: Pagination cursor for next page
    • limit (default: 100, max: 200): Maximum users to return

Getting User Profiles

slack_get_user_profile

Gets detailed profile information for a specific user.

  • Required inputs:
    • user_id: The user's ID

Troubleshooting

If you encounter permission errors, verify that:

  1. All required scopes are added to your Slack app
  2. The app is properly installed to your workspace
  3. The tokens and workspace ID are correctly copied to your configuration
  4. The app has been added to the channels it needs to access
  5. You're using a User OAuth Token (starts with xoxp-) not a Bot Token

How to install this MCP server

For Claude Code

To add this MCP server to Claude Code, run this command in your terminal:

claude mcp add-json "slack" '{"command":"npx","args":["-y","@modelcontextprotocol/server-slack-user"],"env":{"SLACK_TOKEN":"xoxp-your-user-token","SLACK_TEAM_ID":"T01234567"}}'

See the official Claude Code MCP documentation for more details.

For 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 > Tools & Integrations and click "New MCP Server".

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

{
    "mcpServers": {
        "slack": {
            "command": "npx",
            "args": [
                "-y",
                "@modelcontextprotocol/server-slack-user"
            ],
            "env": {
                "SLACK_TOKEN": "xoxp-your-user-token",
                "SLACK_TEAM_ID": "T01234567"
            }
        }
    }
}

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 explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.

For Claude Desktop

To add this MCP server to Claude Desktop:

1. Find your configuration file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.config/Claude/claude_desktop_config.json

2. Add this to your configuration file:

{
    "mcpServers": {
        "slack": {
            "command": "npx",
            "args": [
                "-y",
                "@modelcontextprotocol/server-slack-user"
            ],
            "env": {
                "SLACK_TOKEN": "xoxp-your-user-token",
                "SLACK_TEAM_ID": "T01234567"
            }
        }
    }
}

3. Restart Claude Desktop for the changes to take effect

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