Slack-MCP サーバー
Slack APIにアクセスするためのMCP(Model Context Protocol)サーバー。このサーバーにより、AIアシスタントは標準化されたインターフェースを介してSlack APIと対話できるようになります。
特徴
利用可能なツール:
slack_list_channels
- ワークスペース内のパブリックチャンネルをページ区切りで一覧表示しますslack_post_message
- Slackチャンネルに新しいメッセージを投稿するslack_reply_to_thread
- Slack の特定のメッセージスレッドに返信するslack_add_reaction
- メッセージに反応絵文字を追加するslack_get_channel_history
- チャンネルから最近のメッセージを取得するslack_get_thread_replies
- メッセージスレッド内のすべての返信を取得するslack_get_users
- ワークスペース内のすべてのユーザーの基本プロフィール情報を取得しますslack_get_user_profile
- ユーザーのプロフィール情報を取得するslack_search_messages
- ワークスペース内のメッセージを検索する
クイックスタート
インストール
注意: 現在、GitHub レジストリでホストされているため、PAT が必要です。
構成
次の環境変数を設定する必要があります。
SLACK_BOT_TOKEN
: Slack ボットユーザー OAuth トークンSLACK_USER_TOKEN
: Slack ユーザー OAuth トークン (メッセージ検索などの一部の機能に必要)
.env
ファイルを作成して、次の環境変数を設定することもできます。
使用法
MCPサーバーを起動する
直接:
または、インストールしたモジュールを node で実行します。
クライアントの MCP 構成 json を編集します。
実装パターン
このサーバーは次の実装パターンを採用しています。
- Zodスキーマを使用してリクエスト/レスポンスを定義する
- リクエストスキーマ: 入力パラメータを定義する
- レスポンススキーマ: 必要なフィールドに限定したレスポンスを定義する
- 実装フロー:
- Zodスキーマでリクエストを検証する
- Slack WebAPIを呼び出す
- Zodスキーマを使用してレスポンスを解析し、必要なフィールドに限定する
- JSONとして返す
たとえば、 slack_list_channels
実装は、 ListChannelsRequestSchema
を使用してリクエストを解析し、 slackClient.conversations.list
を呼び出し、 ListChannelsResponseSchema
を使用して解析されたレスポンスを返します。
発達
利用可能なスクリプト
npm run dev
- ホットリロードで開発モードでサーバーを起動しますnpm run build
- 本番環境用にプロジェクトをビルドするnpm run start
- 本番サーバーを起動するnpm run lint
- リンティングチェックを実行する(ESLint と Prettier)npm run fix
- リンティングの問題を自動的に修正する
貢献
- リポジトリをフォークする
- 機能ブランチを作成する
- テストとリンティングを実行する:
npm run lint
- 変更をコミットする
- ブランチにプッシュする
- プルリクエストを作成する
remote-capable server
The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.
モデルコンテキスト プロトコルを実装したサーバー。これにより、AI アシスタントが標準化されたインターフェースを介して Slack API と対話できるようになり、メッセージング、チャンネル管理、ユーザー情報の取得などのツールが提供されます。
Related MCP Servers
- -securityFlicense-qualityA versatile Model Context Protocol server that enables AI assistants to manage calendars, track tasks, handle emails, search the web, and control smart home devices.Last updated -2Python
- AsecurityAlicenseAqualityA Model Context Protocol server that allows AI assistants to interact with the VRChat API, enabling retrieval of user information, friends lists, and other VRChat data through a standardized interface.Last updated -713233TypeScriptMIT License
- -securityAlicense-qualityA Model Context Protocol server implementation that enables AI assistants to interact with Slack workspaces, allowing them to browse channels, send messages, reply to threads, add reactions, and retrieve user information.Last updated -18JavaScriptApache 2.0
- -securityFlicense-qualityA comprehensive Model Context Protocol server implementation that enables AI assistants to interact with file systems, databases, GitHub repositories, web resources, and system tools while maintaining security and control.Last updated -16TypeScript