Logo
Logo

2026年6月16日 Articles

ChatGPTでInstagramを完全自動化

Instagramの完全自動化:ChatGPTとMCPによる自動投稿

このガイドでは、デスクトップアプリCodex(ChatGPTの開発元によるアプリ)、MCPサーバー(Model Context Protocol)、そしてアンチディテクトブラウザUndetectableを使って、Instagramへの完全自動投稿を設定する方法を解説します。ニューラルネットワークが必要なプロフィールを自分で開き、SNSにアクセスし、画像をアップロードし、テキストを書き、「公開」ボタンをクリックします。

ステップバイステップガイド:自動化をゼロから設定する

この自動化スキームは、Undetectableブラウザの無料版でも利用できます!重要なのは、OpenAIのサブスクリプションを持っていることです。

ステップ1. ベースとコンテンツを準備する

まず、必要なスタックをそろえます:

1.アンチディテクトブラウザUndetectableをダウンロードします(自動化は無料版でも利用できます)。

2.パソコンにNode.js環境をインストールします(これはスクリプトを正しく動作させるために必要です)。

重要なポイント: AIは優秀な実行役ですが、ファイルは事前に準備しておく必要があります。投稿用の完成画像とテキストを書いたドキュメントを入れるフォルダをパソコン上に作成してください。プロンプトでは、これらのファイルへの正確なパスを指定する必要があります。

ファイルパスを確認する方法

  • Windowsの場合: Shiftキーを押しながらファイルを右クリックします。表示されたメニューで「パスのコピー」(Copy as path)を選択します。 注意:パスをプロンプトに貼り付けるときは、両端の引用符を削除することをおすすめします。
  • macOSの場合: ファイルを右クリックし、その後Option(Alt)キーを押します。「コピー」の項目が「[ファイル名]のパス名をコピー」(Copy [File] as Pathname)に変わります。それをクリックしてください。

ステップ2. Codexを起動する

公式サイトからデスクトップアプリCodexをダウンロードしてログインします(有効なOpenAIサブスクリプションが必要です)。

ステップ3. MCPサーバーを接続する

次に、ニューラルネットワークがブラウザを操作できるように、ブラウザと接続します。そのために、Codexで新しいチャットを開き、AIにMCPサーバーを接続するよう依頼します。

次のプロンプトをニューラルネットワークに送信し、コードスニペットを添付するだけです:

「このMCPサーバーを接続してください:」

{
"mcpServers": {
"undetectable-local-api-ts": {
"command": "npx",
"args": ["-y", "undetectable-local-api-mcp-ts"],
"env": {
"UNDETECTABLE_BASE_URL": "http://127.0.0.1:25325",
"UNDETECTABLE_TIMEOUT": "60"
}
}
}
}

AIは内容を理解し、自分で設定を行います。追加が正常に完了したと報告されたら、Codexを再起動し、Undetectableブラウザを開いてください。これにより変更が反映され、自動化が正しく動作します。

MCPサーバーを他のモデルに接続する方法の詳細は、GitHubまたはNPMをご覧ください。

Instagram投稿の自動化

技術的な部分の準備ができたら、いよいよ最も面白い部分、AI用のアルゴリズム(プロンプト)の作成に入ります。ニューラルネットワークのロジックがどのように機能するのかを示すため、このプロセスを2つの段階に分けました。

段階1:テスト実行

最初のテストでは、Codexで新しいチャットを作成し、事前に設定したアンチディテクト内のプロフィールを開き、Instagramにアクセスして投稿を作成するよう依頼しました。私たちは、「プラスのボタンを探して」「Nextをクリックして」といったように、実際の人間にタスクを説明するような形でアルゴリズムを書きました。

最初のプロンプトは次のようなものでした:

Undetectable browser 1.Start the profile named "INSTA" using the start_profile tool

2.Wait 3 seconds for the browser to fully load

3.Navigate to https://www.instagram.com

4.Wait 3 seconds for the page to load

5.Look for the "+" (Create) icon and click it

6.A menu will appear — click "Post" from the menu options

7.Wait for the upload dialog to appear

8.Click the button "Select from computer"

9.A system file picker window will open

10.In the file picker, type or paste the full path:

(ファイルへのパス)

Then press Enter to confirm

11.Wait for the image to upload and appear in preview

12.Click the "Next" button (top right of the dialog) — this moves to crop/filter step

13.Click "Next" again — this moves to the caption step

14.Click on the caption text field

15.Type exactly the following text: (投稿テキスト)

16.Click the "Share" button (top right)

17.Wait for the confirmation that the post was published

18.Take a screenshot to confirm success

Important: If the Instagram UI has been updated and buttons or menu items have different names or positions, adapt accordingly and proceed with the closest matching option to complete the task.

結果: 成功しました!投稿は公開されました。しかし、処理にはかなり時間がかかりました。AIは余計な動作を行い、必要なボタンを視覚的に探そうとし、人間の操作手順をクリックごとに模倣していました。私たちには、もっと速い方法が必要でした。

段階2:AIが自分自身を最適化する

タスクは成功したものの実行が遅かったため、私たちはニューラルネットワークに自分の動作を分析し、自分自身のために新しい最適化プロンプトを書くよう依頼しました。目的はシンプルです。テスト実行で発生したすべてのミスを考慮し、自動化をできるだけ高速で安定したものにすることです。

その後、作成されたプロンプトを新しいCodexチャットで使用しました。その結果、自動化はスムーズに、滞りなく完了しました。

こちらが、今すぐ使える最終版の最適化プロンプトです(自分のファイルパスと必要なテキストに置き換えるのを忘れないでください):

Start the Undetectable profile named Social UDT

Wait 3 seconds after profile start.

Connect to the profile’s returned websocket_link.

Open Instagram directly at:

https://www.instagram.com/create/select/

Wait 3 seconds for the create upload page.

If the Select from computer button is visible, click it and set this file in the chooser:

(画像ファイルへのパス)

If a file input is already present, set the same file directly on input[type="file"].

Wait up to 45 seconds for Instagram to finish upload/navigation.

Do not wait for Next buttons. The observed successful flow goes directly to:

https://www.instagram.com/create/details/

On the details page, fill the visible textarea:

textarea[aria-label="Write a caption…"]

with exactly:

(投稿テキスト)

Find the enabled button whose exact visible text is Share.

Trigger the Share button directly with a full pointer/mouse/click event sequence on that button.

Wait up to 90 seconds for Instagram to leave /create/details/ and return to Instagram home or another non-create page.

Open:

https://www.instagram.com/undetectablebrowser/

Wait 5 seconds.

Take a screenshot confirming the newest grid item appears at the top-left of the profile grid.

まとめ

MCP、Codex、Undetectableの組み合わせは、SMMとアフィリエイトマーケティングのルールを完全に変えます。単にクリックを自動化するだけではありません。プロフィール管理のロジックそのものをAIに委ねることができます。

ぜひ今日、自分の最初の自動投稿を設定してみてください!

Undetectable Team
Undetectable Team 検出防止の専門家

最も信頼できるアンチディテクトブラウザを無料でお試しください!

  • 稼働率99%
  • ローカルプロフィール保存
  • ルーチン自動化
登録