npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@jict/slack-mcp-server

v0.5.0

Published

MCP server for Slack message retrieval and search

Readme

Slack MCP Server

AI エージェント向けのSlack連携MCPサーバーです。Claude DesktopやClaude CodeなどのMCPクライアントから使用します。

🚀 MCP クライアント設定

Claude Desktop / Claude Code

設定ファイルに以下を追加:

{
  "mcpServers": {
    "slack": {
      "command": "npx",
      "args": ["@jict/slack-mcp-server@latest"],
      "env": {
        "SLACK_USER_TOKEN": "xoxp-your-user-token"
      }
    }
  }
}

Slack User Token の取得

OAuth認証システム でトークンを取得してください。

必要な Slack 権限

User Token には以下のスコープが必要です:

  • channels:read + channels:history - パブリックチャンネル
  • groups:read + groups:history - プライベートチャンネル
  • im:read + im:history - DM
  • mpim:read + mpim:history - グループDM
  • search:read - メッセージ検索
  • users:read - ユーザー情報(表示名取得)
  • files:read - ファイル・スニペットの内容取得
  • usergroups:read - ユーザーグループの一覧・メンバー取得

⚙️ 開発コマンド

ビルド

pnpm -F @jict/slack-mcp-server build

開発モード(ファイル監視)

pnpm -F @jict/slack-mcp-server dev

本番実行

pnpm -F @jict/slack-mcp-server start

🧪 ローカル動作確認

各ツールを個別に動作確認できます:

セットアップ

# 1. .envファイルを作成
cp .env.example .env

# 2. .envファイルを編集してSLACK_USER_TOKENを設定
# SLACK_USER_TOKEN=xoxp-your-actual-token-here

使用方法

インタラクティブモード

対話的にツールをテストできます:

pnpm -F @jict/slack-mcp-server dev:tool

# Tool name: slack_get_message
# Slack message permalink: https://workspace.slack.com/archives/...
# [結果が表示されます]

コマンドラインモード

パラメータを直接指定して実行:

# メッセージ取得
pnpm -F @jict/slack-mcp-server dev:tool slack_get_message --link "https://workspace.slack.com/archives/..."

# スレッド取得
pnpm -F @jict/slack-mcp-server dev:tool slack_get_thread --channel C12345 --thread_ts 1234567890.123456

# メッセージ検索
pnpm -F @jict/slack-mcp-server dev:tool slack_search_messages --query "test" --from user123 --count 10

# メンション取得
pnpm -F @jict/slack-mcp-server dev:tool slack_get_mentions --mention_types personal channel

ヘルプ表示

pnpm -F @jict/slack-mcp-server dev:tool --help

🛠️ 利用可能なツール

slack_get_message

Slack メッセージのパーマリンクから個別メッセージを取得(リアクション情報付き)

{
  link: 'https://workspace.slack.com/archives/C1234567890/p1234567890123456'
}

slack_get_thread

スレッド全体のメッセージを取得(各メッセージにリアクション情報付き)

{
  channel: "C1234567890",
  thread_ts: "1234567890.123456",
  limit?: 1000  // デフォルト: 1000
}

slack_search_messages

メッセージを柔軟な条件で検索(各メッセージにリアクション情報付き)

{
  query?: "検索キーワード",       // オプション:検索クエリ
  channel?: "C1234567890",       // オプション:特定チャンネル内検索
  from?: "U1234567890",          // オプション:特定ユーザーの投稿を検索(ユーザーIDまたはユーザー名)
  after?: "2025-08-13",          // オプション:指定日以降のメッセージ(YYYY-MM-DD形式)
  before?: "2025-08-15",         // オプション:指定日以前のメッセージ(YYYY-MM-DD形式)
  on?: "2025-08-14",             // オプション:指定日のメッセージ(YYYY-MM-DD形式)
  count?: 20                     // 取得件数(デフォルト: 20、最大: 100)
}

注意: queryfromonafterbefore のいずれか1つ以上が必須です。

使用例

// ユーザー単位での検索(その人の発言を新しい順にリスト)
{
  from: "U03472W2HD5"
}

// 今日の特定ユーザーの投稿
{
  from: "U03472W2HD5",
  on: "2025-08-14"
}

// 特定チャンネルでの日付範囲検索
{
  channel: "C1234567890",
  after: "2025-08-13",
  before: "2025-08-15"
}

// キーワードと日付の組み合わせ
{
  query: "リリース",
  on: "2025-08-14"
}

slack_get_mentions

自分宛てのメンションを取得(各メッセージにリアクション情報付き)

{
  mention_types?: ["personal", "channel", "here", "usergroup"]  // 取得するメンションタイプ(デフォルト: 全タイプ)
}

メンションタイプ:

  • personal: 個人メンション(@username)
  • channel: @channel メンション
  • here: @here メンション
  • usergroup: ユーザーグループメンション(@team-name など)

usergroup の検索方式: トークン所有者が所属するユーザーグループを usergroups.list で取得し、その @handle で検索します。生タグ <!subteam^…> は Slack の検索インデックスに載っていないため使いません。所属グループは検索対象に usergroup を含めない場合もメンション種別の判定に使います。

結果が欠けたときに理由が分かるよう、次の場合は warnings に理由が入ります。

  • usergroups:read が無いなどでユーザーグループを取得できなかった(usergroup の検索はスキップされます)
  • トークン所有者がどのユーザーグループにも所属していない
  • 個々の検索クエリが失敗した(レート制限など)

使用例

// 全てのメンションを取得(デフォルト)
{
}

// 個人メンションのみ取得
{
  mention_types: ['personal']
}

// @channelと@hereメンションを取得
{
  mention_types: ['channel', 'here']
}

// ユーザーグループメンションを含む複数タイプ
{
  mention_types: ['personal', 'usergroup']
}

slack_list_usergroups

ワークスペースのユーザーグループ一覧を取得(パラメータなし)

{
  usergroups: [
    {
      id: 'S052J2P59K6', // subteam ID
      handle: 'joinsure_platform', // @ を含まない handle
      name: 'joinsure platform', // 表示名
      description: '...',
      is_external: false,
      is_member: true, // トークン所有者が所属しているか
      member_count: 8,
      members: ['U4MRJ1T0R'], // メンバーのユーザーID
    },
  ]
}

無効化(削除)済みのユーザーグループは含みません。usergroups:read スコープが必要で、このスコープ追加前に発行したトークンでは missing_scope エラーになります。その場合はOAuth認証システムでトークンを再発行してください。

グループメンションの名前解決

全ツールの本文で、ユーザーグループメンションは @handle へ展開されます。search.messages の戻りではグループメンションが <@S…> 形式(ユーザーメンションと同じ形)になりますが、S 始まりの ID はグループとして解決します。

usergroups:read が無いトークンや、解決できなかった ID は生タグのまま残ります。

🌐 パブリック公開

このパッケージは npm でパブリック公開されています:

  • NPM パッケージ: https://www.npmjs.com/package/@jict/slack-mcp-server
  • アクセス: public (誰でも利用可能)
  • 認証: 不要

📄 ライセンス

MIT License

🔗 関連リンク