slack-patron-mcp
Provides tools to list channels, retrieve channel messages with time range and pagination, and get thread replies from a Slack workspace via the slack-patron API.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@slack-patron-mcpget the last 10 messages in #random"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
slack-patron-mcp
slack-patron (https://github.com/tsg-ut/slack-patron) のSlackメッセージ履歴APIをClaudeから利用するためのリモートMCPサーバー。
概要
トランスポート: Streamable HTTP (stateless)
認証: Bearer token (MCP_SERVER_AUTH_TOKEN)
上流API:
SLACK_PATRON_BASE_URL環境変数で設定
Related MCP server: Tarantella Slack MCP Server
利用可能なツール
ツール名 | 説明 |
| ワークスペースの全チャンネル一覧を取得 |
| チャンネルのメッセージ履歴を取得 (時刻範囲・ページネーション対応) |
| スレッドの返信一覧を取得 |
get_channel_messages パラメータ
パラメータ | 型 | 必須 | 説明 |
| string | ✓ | チャンネルID (C01234567) またはチャンネル名 (general, #general) |
| number | - | 取得件数 (1-200, デフォルト50) |
| string | - | 開始タイムスタンプ (例: 1700000000.000000) |
| string | - | 終了タイムスタンプ |
| string | - | ページネーションカーソル (前回レスポンスから取得) |
get_thread_replies パラメータ
パラメータ | 型 | 必須 | 説明 |
| string | ✓ | チャンネルID |
| string | ✓ | 親メッセージのタイムスタンプ |
| number | - | 取得件数 (1-200, デフォルト50) |
| string | - | ページネーションカーソル |
セットアップ
必要な環境変数
変数名 | 説明 |
| Claudeがこのサーバーに接続する際のBearerトークン |
| slack-patronの上流APIへのBearerトークン |
| slack-patron上流APIのベースURL (末尾スラッシュなし) |
| サーバーポート (デフォルト: 29112) |
ローカル開発
# 依存関係インストール
npm install
# 環境変数設定
cp .env.example .env
# .env を編集して実際の値を設定
# 開発サーバー起動 (ホットリロード付き)
npm run dev
# ビルド
npm run build
# テスト
npm testNginx設定
# 設定ファイルをコピー (nginx/ ディレクトリは .gitignore 対象のため各自作成)
sudo cp nginx/your-vhost-config /etc/nginx/sites-available/
# シンボリックリンク作成
sudo ln -s /etc/nginx/sites-available/your-vhost-config \
/etc/nginx/sites-enabled/your-vhost-config
# 設定確認と再読み込み
sudo nginx -t && sudo systemctl reload nginxClaude カスタムコネクタ登録方法
Claude.ai または Claude Code で以下のように設定する:
MCP サーバーの設定を開く
「カスタムコネクタを追加」を選択
以下を入力:
URL:
https://your-server.example.com/mcp認証タイプ: Bearer Token
トークン:
.envのMCP_SERVER_AUTH_TOKENの値
Claude Code の場合 (~/.claude/settings.json):
{
"mcpServers": {
"slack-patron": {
"type": "http",
"url": "https://your-server.example.com/mcp",
"headers": {
"Authorization": "Bearer YOUR_MCP_SERVER_AUTH_TOKEN"
}
}
}
}動作確認 curl コマンド
MCP の Streamable HTTP トランスポートでは Accept: application/json, text/event-stream ヘッダーが必須です (Claude クライアントは自動付与するが、curl では明示指定が必要)。
export TOKEN="your-mcp-server-auth-token"
export BASE="https://your-server.example.com"
# MCP リクエスト共通ヘッダー
MCP_HEADERS=('-H' 'Content-Type: application/json' '-H' 'Accept: application/json, text/event-stream')
# ヘルスチェック (認証不要)
curl "${BASE}/health"
# 認証失敗の確認
curl -X POST "${BASE}/mcp" \
"${MCP_HEADERS[@]}" \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}'
# → 401 Unauthorized
# ツール一覧
curl -X POST "${BASE}/mcp" \
-H "Authorization: Bearer ${TOKEN}" \
"${MCP_HEADERS[@]}" \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}'
# チャンネル一覧取得
curl -X POST "${BASE}/mcp" \
-H "Authorization: Bearer ${TOKEN}" \
"${MCP_HEADERS[@]}" \
-d '{"jsonrpc":"2.0","id":2,"method":"tools/call","params":{"name":"list_channels","arguments":{}}}'
# メッセージ取得 (チャンネル名指定)
curl -X POST "${BASE}/mcp" \
-H "Authorization: Bearer ${TOKEN}" \
"${MCP_HEADERS[@]}" \
-d '{"jsonrpc":"2.0","id":3,"method":"tools/call","params":{"name":"get_channel_messages","arguments":{"channel":"general","limit":10}}}'
# スレッド返信取得
curl -X POST "${BASE}/mcp" \
-H "Authorization: Bearer ${TOKEN}" \
"${MCP_HEADERS[@]}" \
-d '{"jsonrpc":"2.0","id":4,"method":"tools/call","params":{"name":"get_thread_replies","arguments":{"channel":"C01234567","thread_ts":"1700000000.123456"}}}'セキュリティ
全シークレットは環境変数経由で管理 (コードにハードコードしない)
MCP認証はBearerトークン + タイミング安全比較 (
crypto.timingSafeEqual)ログにトークンやメッセージ内容を出力しない
上流APIエラー時はHTTPステータスコードのみ通知 (スタックトレース非公開)
slack-patronへのリクエストは常に
limitを指定し大量取得を防止書き込み系操作は一切実装しない (読み取り専用)
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/hakatashi/slack-patron-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server