THTH

THTH は、自分の SNS アカウントで調べる・投稿する・予約する・振り返るためのコマンドラインツールです。Threads、Bluesky、Mastodon、X に対応しています。

コマンドラインなので、Claude Code などの AI アシスタントがそのまま操作できます。同梱の MCP サーバーとスキルは、その操作を楽にするための補助です。THTH は何を書くかを決めず、頼まれたときだけ動きます。

pip install thth

できること

X は投稿・削除・自分の最近の投稿の読み取りに対応し、利用は運営者設定の範囲内です。返信とインサイトの取得、検索には対応していません。Bluesky は削除に対応していません。再投稿といいねは、まだどの SNS でもできません。

招待された方へ

招待された利用者は、招待リンクを開いて Threads(Mastodon の招待ならそのサーバー)を認可します。続けて pip install thth、thth login を実行し、ブラウザでこのデバイスを許可します。利用者が VM や Meta アプリを用意する必要はありません。

以後は、調べる(thth topics --search・thth mentions・thth profile・thth location search・thth where・thth thread・thth who)、出す(thth send・thth schedule・thth retract)、振り返る(thth posts・thth replies・thth collect・thth measured)のコマンドで自分のアカウントを動かします。ガードの数値はオーナーが決め、AI アシスタントが変えられるのは厳しくする向きだけです。アクティビティで、オーナーが確認・停止・キーの発行を行えます。

導入: 招待されたら

AI アシスタントから使う

claude mcp add thth -- thth-mcp

MCP の道具はコマンドの写しで、同じ thth コマンドを呼ぶだけです。スキルは、投稿する前に何を見るか、返信をどう扱うかをアシスタントに教えます。キーはアシスタントに渡しません。

自分のリポジトリから投稿する

アカウントの台帳を自分の機械に置き、下書きを承認してからタイマーで出す運用もできます。下書きは Markdown ファイルに保存し、本文のほか投稿先のアカウントや予約時刻、トピックを指定できます。

まず、投稿する内容を確認します。

thth approve docs/sns/queue/2026-09-14-oolong.md

本文と投稿先などが表示されます。この段階では、まだ承認されません。

内容がよければ、表示された確認コードと承認者の名前を付けて、もう一度実行します。

thth approve docs/sns/queue/2026-09-14-oolong.md --confirm <確認コード> --by gotoq

承認した下書きは、タイマーを設定しておけば自動で投稿されます。承認後に本文や投稿先、予約時刻などを変更した場合は、あらためて承認が必要です。投稿 ID と、取得した返信やインサイトも同じリポジトリに残ります。

運営者の使い方

運営者(gotoq)がサーバー側で thth auth <account> --by gotoq を開始し、利用者が URL を開いて承認します。Threads・対応 Mastodon・X の共通入口です。Bluesky は App Password の stdin 入力です。

Mastodon の auth は expires_in または refresh_token を返す非標準実装に未対応です。手動 token set も期限・更新情報を受け取らず期限なしとして保存するため、その回避策にはなりません。

English

THTH is a command-line tool for researching, posting to, scheduling on and reviewing your own social media accounts. It supports Threads, Bluesky, Mastodon and X. Because it is a CLI, an AI assistant can drive it directly; the bundled MCP server and skills only make that easier.

An invited person opens an invitation link, authorizes Threads (or their Mastodon server, for a Mastodon invitation), installs thth, and runs thth login to allow their device in the browser. They then research (topics --search, mentions, profile, location search, where, thread, who), post (send, schedule, retract) and review (posts, replies, collect, measured) for their own account. The owner sets safety limits; an AI assistant can only tighten them. The owner uses Activity to review, stop, and issue keys. The operator (gotoq) runs the server.

For an operator-managed queue, review and approve a draft, then let the timer publish it. Drafts, published post IDs, replies, and view counts are stored in that repository. X can publish, delete, and read the account's recent posts within the operator's configured scope; it does not collect replies or metrics. Reposts and likes are not supported yet.

GitHub / PyPI / MCP Registry / llms.txt