
chat-tool-ui-preview
io.github.gridhrav0.1.1Updated Oct 7, 2026
Preview a chat post before an agent sends it: text, mentions, destination, warnings. Never sends.
Overview
Lets an assistant render a Slack-style preview of a message before it is sent, with formatting and warnings, without sending anything.
- What it does
- This local tool renders a chat post as a preview page in the browser so a person can check it before it goes out. It accepts standard Markdown, Slack mrkdwn, or Block Kit JSON, and displays formatting such as bold, quotes, code, links, mentions, emoji, lists and tables, plus context like destination channel, thread reply, and whether it is posted as a user or bot. It flags warnings such as unresolved mentions, unknown emoji, over-length text, and invalid or unsupported blocks. As an MCP server it exposes a single tool, preview_message, which returns the preview path, whether the browser opened, the warning list, and a reminder to get user confirmation before sending.
- When to use it
- Use it when an assistant drafts Slack messages and you want a human to see the rendered result and warnings before anything is posted. It fits Claude Code workflows, where it can also run as a PreToolUse hook that intercepts Slack send tools, and other MCP clients where the agent calls the preview tool itself.
- Requirements
- Runs as a local process on the user's machine; desktop only, no web executable. Distributed as a single static binary with no runtime dependencies, or as an .mcpb bundle for Claude Desktop (macOS and Windows). Install via the release archive, the Go toolchain (1.24+), or the MCP bundle. A browser is needed to open the preview. No accounts, API keys, environment variables, or headers are declared.
Installation
In SourceWeft
- Open chat-tool-ui-preview in the dashboard and add it to a workspace.
- Enable the server for the chats that should use its tools.
Desktop only via STDIO. STDIO servers start a local process, so they need the SourceWeft desktop host.
Other MCP clients
Follow the launch instructions in the repository.
README
chat-tool-ui-preview
AIエージェント(Claude Codeなど)がSlackに投稿する前に、その投稿を人が画面で確認するための小さなローカルツール。Go製の単体バイナリ chat-preview。
表示はSlackの画面を写したものではなく、本ツール独自のチャット風レイアウトです。書式(太字・引用・メンション・ブロックの並び)と文脈(宛先・スレッド返信かどうか・ボットとしてか)の意味が正しく伝わることを目的にしています。Slackのロゴ・配色・フォント・画面構成は使いません。本ツールはSlack Technologies, LLCが制作・提携・支援するものではありません。
何ができるか
- 入力形式3つ: 標準Markdown(Claude CodeのSlack連携の
message)、Slack記法(mrkdwn)、Block Kit JSON - 書式の描画: 太字/斜体/打消/コード/コードブロック/引用/リンク/メンション/日付/絵文字/箇条書き/表、Block Kitの section・header・divider・context・image・actions・rich_text
- 文脈の表示: 宛先、スレッド返信とチャンネルにも表示、送信主体(ユーザー/ボット)
- 自動検査の警告: 表示名が分からないメンション、未知の絵文字、長さ超過、不正・未対応のブロック
- Claude CodeのPreToolUseフックとして動き、Slack送信ツールの呼び出しに自動で割り込む。プレビューをブラウザで開いたうえで、判断はClaude Codeの通常の許可ダイアログに委ねる
やらないこと: Slackへの送信そのもの、Slack APIへの問い合わせ(トークンを持たない)、常駐、投稿内容の保存。画像やリンク先は読み込まない(投稿前に相手サーバーへアクセスが飛ぶのを避ける)。
インストール
chat-previewは実行時の依存を持たない単一の静的バイナリです。PATHの通った場所に置いてください。シェルも、Claude Codeのフックも、MCPクライアントも、同じchat-previewコマンドを呼びます。
スクリプトは、最新のGitHub ReleaseからOSとCPUに合うアーカイブを選び、そのSHA-256がリリースのchecksums.txtと一致しない限り何もインストールせず、chat-previewを~/.local/binに置きます。sudoは求めません。置き場所はCHAT_PREVIEW_INSTALL_DIR、バージョンはCHAT_PREVIEW_VERSIONで指定できます。更新はもう一度実行するだけです。
アーカイブが「このリポジトリのリリース用ワークフローが、タグの付いたソースからビルドしたもの」であることを確かめるには:
Goのツールチェーン(1.24以上)があるなら:
コンテナイメージとnpxランチャーは用意しません。ブラウザを開く必要があるので、ホストで動かすのが前提です。
Claude Desktopに入れる(MCP Bundle)
各リリースには、OSとCPUごとのchat-preview_<版>_<os>_<arch>.mcpbも付いています。MCP Bundle(.mcpb)は、manifest.jsonとバイナリを1つのzipにした配布形式で、Claude Desktop(macOS/Windows)がそのまま取り込めます。Releasesから自分のOSとCPUに合う.mcpbを落とし、ダブルクリック(またはClaude Desktopの設定 → エクステンション → 詳細設定 → エクステンションをインストール)で入ります。中身は上のアーカイブと同じバイナリで、checksums.txtとgh attestation verifyで同じように確かめられます。
macOSのClaude Desktopには、取り込んだバイナリの実行権限を落とす不具合(modelcontextprotocol/mcpb issue #294、2026-10-06時点で未修理)があるため、macOS用のバンドルは/bin/sh経由で起動して実行権限を付け直してからchat-preview mcpを実行します。Windows用は.exeを直接起動します。
同じバンドルを公式MCPレジストリにio.github.gridhra/chat-tool-ui-previewとして登録しています。レジストリから入れられるクライアントでは、その名前で探せます。
使い方
入力JSONの形:
formatは必須で、推定しません(標準MarkdownとSlack記法は *bold* の意味が違うため)。namesはID→表示名の対応表で、無いIDは「未解決」として警告に出ます。
Claude Codeとの連携(フック)
~/.claude/settings.json(または対象プロジェクトの.claude/settings.json)に:
動き: エージェントがSlack送信ツールを呼ぶ → フックがプレビューHTMLを一時ファイル(本人のみ読める権限)に書いてブラウザで開く → Claude Codeの許可ダイアログに「プレビューを開いた。確認が必要な点: …」と出る → 人が許可/拒否を選ぶ。文面を直したいときは拒否して理由に書くと、エージェントが書き直して再びプレビューが開く。一時ファイルは1時間で自動的に消える。
MCPサーバーとして使う
chat-preview mcp はstdioのMCPサーバーで、ツールは preview_message の1本です。入力はCLIの入力JSONと同じ項目(format text blocks channel_id thread_ts names など)で、出力はプレビューのパス、ブラウザを開けたか、警告一覧、次にすべきこと(「ユーザーに確認し、はいと言うまで送らない」)です。送信もSlackへの問い合わせも行いません。
Claude Codeに登録する例(ユーザースコープ):
フックとMCPの使い分け: フックはエージェントが呼び忘れる余地がなく、Claude CodeのSlack送信ツールに自動で割り込みます。MCPは、他のクライアントや、送信ツールを経由しない場面(Web APIを直接叩くスクリプトを書いている最中など)でエージェントが任意に呼ぶためのものです。両方登録して構いません。
開発
設計と判断の記録は docs/DESIGN.md、進捗と予定は docs/ROADMAP.md。
ライセンス
MIT。絵文字の短縮名→Unicodeの対応は kyokomi/emoji(MIT)、Markdownの構文解析は goldmark(MIT)を使っています。絵文字の描画はOSのフォントに任せ、画像は同梱しません。
Source: README.md at commit d24cd87
Tools
0Version history
1- v0.1.1LatestOct 7, 2026
