Skip to main content
Glama

Slack MCP サーバー

Slackワークスペース用のモデルコンテキストプロトコル(MCP)サーバー。この統合は、StdioとSSEの両方のトランスポートとプロキシ設定をサポートし、ワークスペース管理者による権限やボットの作成・承認は必要ありません😏。

機能デモ

ezgif-316311ee04f444

ツール

  1. conversations_history

  • チャネルIDでチャネルからメッセージを取得する

  • 必要な入力:

    • channel_id (文字列): チャネルの ID (形式は Cxxxxxxxxxx)。

    • cursor (文字列): ページ区切りのカーソル。レスポンスの最後の行と列の値を、前回のリクエストから返された next_cursor フィールドとして使用します。

    • limit (数値、デフォルト: 28): 取得するメッセージの制限。

  • 戻り値: タイムスタンプ、ユーザーID、テキストコンテンツを含むメッセージのリスト

  1. channels_list

  • チャンネルのリストを取得する

  • 必要な入力:

    • channel_types (配列): 可能なチャネルタイプ。許可される値: 'mpim'、'im'、'public_channel'、'private_channel'。

    • sort (文字列): 並べ替えの種類。使用できる値: 'popularity' - 各チャンネルのメンバー/参加者数で並べ替えます。

  • 戻り値: チャンネルのリスト

Related MCP server: Slack MCP Server

セットアップガイド

1. 認証の設定

ブラウザで Slack を開いてログインします。

SLACK_MCP_XOXC_TOKEN検索

  • ブラウザの開発者コンソールを開きます。

  • Firefoxでは、メニューバーのTools -> Browser Tools -> Web Developer tools

  • Chromeでは、URLバーの右側にある「3つの点」ボタンをクリックし、 More Tools -> Developer Toolsを選択します。

  • コンソールタブに切り替えます。

  • 「貼り付けを許可する」と入力して、Enter キーを押します。

  • 次のスニペットを貼り付けて、ENTER キーを押して実行します: JSON.parse(localStorage.localConfig_v2).teams[document.location.pathname.match(/^\/client\/([A-Z0-9]+)/)[1]].token

トークンの値は実行されたコマンドの直後に印刷されます ( xoxc-で始まります)。とりあえずどこかに保存してください。

SLACK_MCP_XOXD_TOKEN検索

  • 「アプリケーション」タブに切り替えて、左側のナビゲーション ペインで「Cookie」を選択します。

  • dという名前のクッキーを見つけてください。そうです、文字dだけです。

  • この Cookie の値をダブルクリックします。

  • Ctrl+C または Cmd+C を押して、その値をクリップボードにコピーします。

  • 後で使用するために保存します。

2. インストール

次のいずれかのインストール方法を選択します。

3. 設定と使用方法

コマンドライン引数と環境変数を使用して MCP サーバーを構成できます。

npxの使用

npm がインストールされている場合は、これが Claude Desktop でslack-mcp-serverを使い始める最も早い方法です。

claude_desktop_config.jsonを開き、mcp サーバーをmcpServersのリストに追加します。

{
  "mcpServers": {
    "slack": {
      "command": "npx",
      "args": [
        "-y",
        "slack-mcp-server@latest",
        "--transport",
        "stdio"
      ],
      "env": {
        "SLACK_MCP_XOXC_TOKEN": "xoxc-...",
        "SLACK_MCP_XOXD_TOKEN": "xoxd-..."
      }
    }
  }
}
{
  "mcpServers": {
    "slack": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "-e",
        "SLACK_MCP_XOXC_TOKEN=$SLACK_MCP_XOXC_TOKEN",
        "-e",
        "SLACK_MCP_XOXD_TOKEN=$SLACK_MCP_XOXD_TOKEN",
        "ghcr.io/korotovsky/slack-mcp-server",
        "mcp-server",
        "--transport",
        "stdio"
      ],
      "env": {
        "SLACK_MCP_XOXC_TOKEN": "xoxc-...",
        "SLACK_MCP_XOXD_TOKEN": "xoxd-..."
      }
    }
  }
}

詳細については、 Docker を参照してください。

sseトランスポートで npx を使用する:

sseモードで実行したい場合は、Claude Desktop のmcp-remoteラッパーを使用し、 ngrokやdocker-composeなどを使用して MCP サーバーをどこかにデプロイ/公開する必要があります。

{
  "mcpServers": {
    "slack": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-remote",
        "https://x.y.z.q:3001/sse",
        "--header",
        "Authorization: Bearer ${SLACK_MCP_SSE_API_KEY}"
      ],
      "env": {
        "SLACK_MCP_SSE_API_KEY": "my-$$e-$ecret"
      }
    }
  }
}
{
  "mcpServers": {
    "slack": {
      "command": "C:\\Progra~1\\nodejs\\npx.cmd",
      "args": [
        "-y",
        "mcp-remote",
        "https://x.y.z.q:3001/sse",
        "--header",
        "Authorization: Bearer ${SLACK_MCP_SSE_API_KEY}"
      ],
      "env": {
        "SLACK_MCP_SSE_API_KEY": "my-$$e-$ecret"
      }
    }
  }
}

TLSとインターネットへの公開

SSE に HTTPS を設定する必要がある理由はいくつかあります。

  • mcp-remote https スキームのみを処理できます。

  • 一般的に、インターネットに公開されるすべてのサービスに TLS を使用することをお勧めします。

ngrokを使うこともできます:

ngrok http 3001

次に、 mcp-remote引数にエンドポイントhttps://903d-xxx-xxxx-xxxx-10b4.ngrok-free.appを使用します。

Dockerの使用

すべての環境変数の詳細については、 「環境変数」を参照してください。

export SLACK_MCP_XOXC_TOKEN=xoxc-...
export SLACK_MCP_XOXD_TOKEN=xoxd-...

docker pull ghcr.io/korotovsky/slack-mcp-server:latest
docker run -i --rm \
  -e SLACK_MCP_XOXC_TOKEN \
  -e SLACK_MCP_XOXD_TOKEN \
  slack-mcp-server --transport stdio

または、docker-compose の方法:

wget -O docker-compose.yml https://github.com/korotovsky/slack-mcp-server/releases/latest/download/docker-compose.yml
wget -O .env https://github.com/korotovsky/slack-mcp-server/releases/latest/download/default.env.dist
nano .env # Edit .env file with your tokens from step 1 of the setup guide
docker-compose up -d

コンソール引数

口論

必須 ?

説明

--transportまたは-t

はい

MCP サーバーのトランスポートを選択します。可能な値は、 stdio 、 sseです。

環境変数

変数

必須 ?

デフォルト

説明

SLACK_MCP_XOXC_TOKEN

はい

nil

認証データ トークン フィールド、POST データ フィールド セットからのtoken ( xoxc-... )

SLACK_MCP_XOXD_TOKEN

はい

nil

クッキーdからの認証データ トークン ( xoxd-... )

SLACK_MCP_SERVER_PORT

いいえ

3001

MCP サーバーが listen するポート

SLACK_MCP_SERVER_HOST

いいえ

127.0.0.1

MCP サーバーが listen するホスト

SLACK_MCP_SSE_API_KEY

いいえ

nil

transportがsseの場合の認可ベアラートークン

SLACK_MCP_PROXY

いいえ

nil

MCP サーバーが使用するプロキシ URL

SLACK_MCP_SERVER_CA

いいえ

nil

信頼ストアの CA 証明書へのパス

SLACK_MCP_SERVER_CA_INSECURE

いいえ

false

安全でないリクエストはすべて信頼する(非推奨)

デバッグツール

# Run the inspector with stdio transport
npx @modelcontextprotocol/inspector go run mcp/mcp-server.go --transport stdio

# View logs
tail -n 20 -f ~/Library/Logs/Claude/mcp*.log

安全

  • APIトークンを共有しないでください

  • .env ファイルを安全かつプライベートに保つ

ライセンス

MITライセンス( LICENSEファイル参照)です。これはSlackの公式製品ではありません。

Available Tools

2 tools
channels_listC

Get list of channels

Inputs: channel_types (required), sort.

conversations_historyB

Get messages from the channel by channel_id, the last row/column in the response is used as 'cursor' parameter for pagination if not empty

Inputs: channel_id (required), cursor, limit.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    B3/5.0

    Scored across 2 tools

    Disambiguation5/5

    The two tools have clearly distinct purposes: channels_list retrieves a list of channels, while conversations_history fetches messages from a specific channel. There is no overlap in functionality, making it easy for an agent to select the correct tool based on the task.

    Naming Consistency4/5

    Both tools follow a consistent snake_case naming convention, but the patterns differ slightly: channels_list uses a noun_verb format, while conversations_history uses a noun_noun format. This minor deviation prevents a perfect score, but the naming is still readable and mostly consistent.

    Tool Count2/5

    With only 2 tools, this server feels too thin for a Slack integration, as it lacks essential operations like sending messages, managing users, or updating channel settings. The scope is severely limited, making it difficult for agents to perform comprehensive Slack-related tasks.

    Completeness2/5

    The tool surface is significantly incomplete for a Slack domain. While it covers listing channels and retrieving message history, it misses critical operations such as posting messages, creating channels, or handling reactions, which are core to Slack workflows and will likely cause agent failures.

    Maintenance

    ActivityInactive
    ResponsivenessMostly unanswered

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      MCP server for posting messages to Slack channels via webhooks or bot API. Supports configurable usernames, emojis, and both webhook and bot token authentication modes.
      11 npm
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      A Model Context Protocol (MCP) server for Slack workspace integration. This server allows AI assistants to interact directly with your Slack workspace, providing tools to manage channels, send messages, list users, and upload files.
      1
      MIT
    • A
      license
      Not graded
      quality
      C
      maintenance
      A production-ready MCP server for the Slack API that enables searching, listing channels, reading history, inspecting users, fetching threads, and sending messages through controlled Slack tools.
      MIT