Instagram Story MCP
Enables sharing media to Instagram Stories, including account selection, previewing posts, publishing to close friends or all followers, adding content to existing highlights, and checking operation status.
Supports using TikTok post URLs as media sources for preparing and sharing content to Instagram Stories.
Supports using YouTube post URLs as media sources for preparing and sharing content to Instagram Stories.
Click on "Deploy 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., "@Instagram Story MCP preview this TikTok for my close friends story: https://tiktok.com/@user/video/123"
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.
Instagram Story MCP
YouTube・TikTok・Instagram投稿をInstagramストーリーズへ共有するための、ローカルstdio MCPです。アカウント確認、プレビュー、親しい友達への公開、既存ハイライトへの追加、処理結果の照会を提供します。
URLの取得・動画変換・MCPをこのパッケージにまとめています。Instagramへの通信、認証、公開の検証と投稿台帳には、別に配置した Instagram HTTP Relay を使います。普段の操作でブラウザーは起動しません。
必要な環境
Python 3.11以降
Node.js 24、pnpm 11.5.0
ffmpegとffprobeがPATHから実行できることHTTPモードで設定・ビルド済みのRelay
Python用のMCP SDK、yt-dlp、curl-cffi、Pillowはインストール時に導入します。MCP SDKは検証済みの1.26.0へ固定しています。
Related MCP server: insta-mcp
導入
git clone https://github.com/shirafukayayoi/instagram-story-mcp.git
cd instagram-story-mcp
python -m venv .venv
.venv\Scripts\python.exe -m pip install .Linuxでは .venv/Scripts/python.exe を .venv/bin/python に読み替えてください。開発時は pip install -e . を使えます。
Relayは feat/account-switching ブランチの e2c4b9c 以降を利用してください。この版には文面なし動画のモバイル形式での公開と、投稿時の本人コメントの照合が含まれます。
git clone --branch feat/account-switching https://github.com/shirafukayayoi/instagram_api_safe_relay.git
cd instagram_api_safe_relay
pnpm install --frozen-lockfile
pnpm buildRelayの settings.json、.env、専用のセッションをローカルで設定します。HTTPモードの導入手順を参照してください。
全プロファイルの
browser.typeをhttpにする。stories.enabledを有効にし、Relayのwork/story-smokeを素材許可ディレクトリへ含める。Instagram投稿のカード共有を使う場合は
stories.feedPostSharingEnabledも有効にする。HTTPモードではDMとメンション受付を無効にする。
Relayの
.envへINSTAGRAM_RELAY_API_TOKENを保存する。
初回ログイン・追加認証は手動で行います。既存のセッションや台帳を削除しません。認証ファイルはこのMCPリポジトリへコピーせず、Relay側のGit管理外に保持します。
Codexへの登録
MCPリポジトリのルートから、配置先を実環境の絶対パスに置き換えて実行します。
$mcpPython = (Resolve-Path '.venv\Scripts\python.exe').Path
codex mcp add instagram --env 'INSTAGRAM_RELAY_REPOSITORY=C:\path\instagram_api_safe_relay' --env PYTHONUTF8=1 -- $mcpPython -m instagram_story_mcp~/.codex/config.toml の登録にタイムアウトを指定します。BearerやCookieはここへ書きません。
[mcp_servers.instagram]
command = 'C:\path\instagram-story-mcp\.venv\Scripts\python.exe'
args = ["-m", "instagram_story_mcp"]
startup_timeout_sec = 30
tool_timeout_sec = 600
env = { INSTAGRAM_RELAY_REPOSITORY = 'C:\path\instagram_api_safe_relay', PYTHONUTF8 = "1" }MCPクライアントを再接続し、instagram_status で ready: true、選択中のアカウントを確認します。停止中のRelayは必要時に起動し、稼働中ならそのまま利用します。配置先の環境変数が未設定でもツール一覧は取得でき、実際の操作は設定を求めて停止します。
ツール
ツール | 処理 |
| 接続・必要なツール・選択中アカウントの診断 |
| 登録済みアカウントと状態の一覧 |
| 実ログイン先を照合して今後の投稿先を選択 |
| URLの素材を準備し、投稿先・公開範囲をプレビュー |
| プレビュー済みの同じ操作を公開 |
| 投稿とハイライト処理の状態を照会 |
| 既存ハイライトを一覧取得 |
| 初回指定済みの動画のハイライト登録を再開 |
投稿の流れ
接続と選択中のアカウントを確認する。
instagram_preview_urlへURLと公開範囲を渡す。親しい友達はclose_friends、通常公開はall。コメント、動画の切り出し、ハイライトは初回から指定する。プレビューの投稿先、公開範囲、素材を確認する。プレビューではInstagramへアップロード・公開しない。
ユーザーの明示的な投稿依頼がある場合に、返された
operationId、preview.account.id、preview.audienceをinstagram_publish_operationへ渡す。投稿は
result.state: publishedとメディアID、アカウント、公開範囲を確認する。ハイライトは別にhighlightResult.state: completedを確認する。
楽曲紹介のコメントは、確認できた「曲名 / アーティスト名」を基本にします。投稿者名からアーティストを推定しません。会話動画などへのコメントは任意です。文面は投稿時の本人コメントとして送り、画像・動画へ文字を焼き込みません。
動画はH.264/AACまたは音声なしのMP4、1〜60秒、100MiB以下が対象です。横動画は縦のキャンバスへ変換し、原本を保存します。勝手な音声差し替えや自動分割は行いません。60秒を超える動画は、ユーザーが指定した範囲を切り出します。
再開と結果不明
操作IDを省略した初回プレビューではUUIDを作ります。再開時は同じIDと引数を指定します。プレビューの有効期限は10分で、期限切れは同じ操作IDで更新します。
公開要求は確認済みプレビューのIDで1回だけ送り、送信前に台帳へ記録します。受理済み・公開済み・結果不明の操作で公開ツールを再び呼んだ場合は状態照会だけを行います。接続が切れても、新しいIDで自動再投稿しません。
ハイライトの unknown も再追加しません。対象の動画がハイライトに存在しても、登録前後の既存一覧の維持を確認できなければ、厳密な完了状態は unknown のまま保持します。投稿とハイライトの成否を分けて報告してください。
子プロセスの標準入力・出力・エラーをMCPの通信パイプから分離しています。Windowsで子Pythonが起動時に停止する問題の回帰テストを含みます。子プロセスの生出力や、署名付き素材URLをMCPへ返しません。
テスト
インストール後、ネットワークや実アカウントを使わないテストを実行できます。
.venv\Scripts\python.exe tests/test_server.py
.venv\Scripts\python.exe -m pip wheel --no-deps . --wheel-dir dist設定済みRelayの接続確認だけを行う場合:
$env:INSTAGRAM_RELAY_REPOSITORY = 'C:\path\instagram_api_safe_relay'
.venv\Scripts\python.exe tests/test_server.py --live--live でも投稿やハイライト追加は行いません。CIはLinuxのPython 3.11/3.14とWindowsのPython 3.14で、境界テスト、stdio接続、wheelビルドを実行します。
ライセンスと元の実装
MIT License。元の実装と変更点は NOTICE.md を参照してください。
Available Tools
8 toolsinstagram_accountsARead-onlyIdempotent
登録済みのアカウント・状態・選択中の投稿先を取得する。
Inputs: no named parameters. Returns: object
instagram_highlightsCRead-onlyIdempotent
既存ハイライトの一覧と実アカウントを照合して返す。
Inputs: profile. Returns: object
instagram_operation_statusBRead-onlyIdempotent
保存した操作と既存ジョブの最新状態を取得する。公開やハイライト登録は開始しない。
Inputs: operation_id (required). Returns: object
instagram_preview_urlAIdempotent
URL素材を準備し投稿先・公開範囲をプレビューする。Instagramへアップロード・公開しない。
コメント・切り出し・指定ハイライトは初回から指定する。再開は同じ操作IDと同じ引数を使う。
Inputs: url (required), comment, profile, audience, +5 more. Returns: object
instagram_publish_operationAIdempotent
ユーザーの明示的な投稿依頼に基づき、プレビュー済みの同じ操作を公開する。
プレビューのaccount.idとaudienceを指定する。成功済み・結果不明・処理中は再投稿しない。
Inputs: operation_id (required), expected_audience (required), expected_account_id (required). Returns: object
instagram_resume_highlightCIdempotent
初回から登録先を指定した公開済み動画を同じハイライトへ登録・再開する。再投稿しない。
Inputs: operation_id (required). Returns: object
instagram_select_accountBIdempotent
@ユーザー名またはプロファイル名で今後の投稿先を選択する。投稿はしない。
Inputs: target (required). Returns: object
instagram_statusARead-onlyIdempotent
HTTP Relayを必要時だけ起動し、依存ツール・接続・選択中の投稿先を診断する。
Inputs: no named parameters. Returns: object
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 8 tools
The preview/publish/status workflow is clearly separated, and select_account vs. accounts vs. highlights vs. resume_highlight are mostly distinct. The main overlap is among instagram_status, instagram_accounts, and instagram_operation_status, all of which report some kind of status or selected destination, though their descriptions clarify different scopes.
All tools use a consistent instagram_ prefix and snake_case formatting, with a mostly coherent split between noun-style read tools and verb_noun action tools. The naming is not a strict single verb_noun pattern throughout, but it is predictable and readable.
Eight tools is well-scoped for an Instagram story publishing workflow: account selection, preview, publish, status tracking, diagnostics, and highlight handling each have a clear role. There is no excessive tool sprawl.
The core lifecycle is covered: diagnose, list/select account, preview URL material, publish previewed operations, check operation status, and list/resume highlights. Minor gaps remain around cancellation, editing a previewed operation, or creating/managing new highlights beyond resuming an existing one.
Maintenance
Related MCP Connectors
Hosted Instagram MCP server for Claude, ChatGPT and Cursor, with each action switched per account.
Post Reels to Instagram, TikTok and YouTube Shorts, track stats and auto-DM Instagram commenters.
MCP server for QPost — lets AI agents publish video and image posts to YouTube, TikTok, Instagram.
Validate, schedule and publish posts to TikTok, Instagram, Facebook, YouTube, Threads, Bluesky, X.
Related MCP Servers
- AlicenseNot gradedqualityBmaintenanceEnables retrieval and analysis of content from YouTube, TikTok, Instagram, and Threads, including metadata, captions, comments, feeds, search results, transcripts, and on-screen text from videos or slides. Supports local stdio and remote HTTP/SSE deployment with optional API keys, Whisper transcription, and Tesseract OCR.MIT
- AlicenseNot gradedqualityCmaintenanceEnables a single professional Instagram account to be managed through Claude, including reading and replying to comments and direct messages, and viewing account and media statistics. It runs as a remote streamable HTTP server with OAuth-protected access and automatic renewal of the Instagram token.MIT
- AlicenseNot gradedqualityBmaintenanceEnables Claude Desktop and Cursor to orchestrate a zero-API Facebook and Instagram studio, covering persistent-browser login, saved-Reel scraping and yt-dlp downloads, FFmpeg music mixing, Reel/post publishing, and humanized AI comment replies. All AI captioning and reply generation runs locally through Ollama, with no Meta Graph API or paid SaaS required.MIT
- FlicenseNot gradedqualityAmaintenanceEnables sending Instagram Direct Messages, managing chats, downloading media from messages, and retrieving user, story, follower, and post information through an authenticated account.-