MCP ExplorerExplorer

Official Slack Mcp

@KaranThink41on 12 days ago
1 MIT
FreeCommunity
AI Systems
A server for automating Slack interactions via the Model Context Protocol.

Overview

What is Official Slack Mcp

Official-Slack-MCP is a Model Context Protocol (MCP) server designed for interacting with the Slack API, providing tools for automating tasks within Slack workspaces.

Use cases

Use cases include automating message posting in channels, managing user interactions, retrieving user profiles, and facilitating discussions through thread replies.

How to use

To use Official-Slack-MCP, clone the repository, install dependencies, create a .env file with your Slack credentials, build the project, and run the server using Node.js.

Key features

Key features include posting text messages to Slack channels, replying to threads, adding reactions, listing channels and users, and fetching channel history and thread replies.

Where to use

Official-Slack-MCP can be used in various fields such as team collaboration, project management, customer support, and any environment that utilizes Slack for communication.

Content

Slack MCP Server

A Model Context Protocol (MCP) server implementation for interacting with the Slack API. This server provides tools for Slack workspace automation.

Features

  • Post text messages to Slack channels
  • Reply to threads
  • Add reactions
  • List channels and users
  • Fetch channel history and thread replies

Installation

Local Development

  1. Clone the repository and install dependencies:
npm install
  1. Create a .env file with your Slack credentials:
SLACK_BOT_TOKEN=your_bot_token
SLACK_TEAM_ID=your_team_id
  1. Build the project:
npm run build
  1. Run the server:
node build/index.js

Available Tools

User Tools

get_users_on_slack

  • Description: Get a list of all users in the workspace with their basic profile information.
  • Input:
    {
      "limit": 100,
      "cursor": "optional_cursor"
    }

get_user_profile_on_slack

  • Description: Get detailed profile information for a specific user.
  • Input:
    {
      "user_id": "your_user_id"
    }

Message Tools

send_message_on_slack

  • Description: Post a new message to a Slack channel.
  • Input:
    {
      "channel_id": "your_channel_id",
      "text": "Hello, world!"
    }

Thread Tools

reply_to_thread_on_slack

  • Description: Reply to a specific message thread in Slack.
  • Input:
    {
      "channel_id": "your_channel_id",
      "thread_ts": "your_thread_ts",
      "text": "This is a reply"
    }

get_thread_replies_on_slack

  • Description: Get all replies in a message thread.
  • Input:
    {
      "channel_id": "your_channel_id",
      "thread_ts": "your_thread_ts"
    }

Channel Tools

channels_list_on_slack

  • Description: List public channels in the workspace with pagination.
  • Input:
    {
      "limit": 100,
      "cursor": "optional_cursor"
    }

get_channel_history_on_slack

  • Description: Get recent messages from a channel.
  • Input:
    {
      "channel_id": "your_channel_id",
      "limit": 10
    }

Reaction Tools

slack_add_reaction

  • Description: Add a reaction emoji to a message.
  • Input:
    {
      "channel_id": "your_channel_id",
      "timestamp": "your_message_ts",
      "reaction": "your_reaction"
    }

Usage Example

To call a tool, send a JSON request like this:

{
  "method": "tools/call",
  "params": {
    "name": "send_message_on_slack",
    "arguments": {
      "channel_id": "your_channel_id",
      "text": "Hello from the Slack MCP server!"
    }
  }
}

Environment Variables

Create a .env file with:

SLACK_BOT_TOKEN=your_bot_token
SLACK_TEAM_ID=your_team_id

Running the Server

npm install
npm run build
npx @modelcontextprotocol/slack-server

Or, for direct node execution:

node build/index.js

License

MIT License. See LICENSE for details.

Tools

No tools

Comments