Skip to main content
Glama
halexandra45

Instagram MCP Server

by halexandra45

Instagram MCPサーバー

AIエージェントがInstagramビジネスアカウントの分析やインサイトにアクセスできるようにするMCPサーバーです。

ツール

ツール

説明

get_account_info

フォロワー数、自己紹介、メディア数

get_recent_posts

いいね数、コメント数、タイムスタンプを含む最近の投稿

get_post_insights

個別の投稿に関する詳細な指標(リーチ、保存数、シェア数)

get_audience_info

フォロワーの属性(都市、国、年齢/性別)

get_account_reach

期間ごとのリーチ数とインプレッション数

get_top_posts

エンゲージメント順に並べ替えたパフォーマンスの高い投稿

Related MCP server: Instagram Complete MCP Server

セットアップ

cd instagram-mcp
python3 -m venv .venv
source .venv/bin/activate
pip install --upgrade pip
pip install "mcp[cli]" httpx

認証情報を記載した .env ファイルを作成します:

INSTAGRAM_ACCESS_TOKEN=your_token
INSTAGRAM_ACCOUNT_ID=17841...

Instagram認証情報の取得方法

  1. Meta for Developers にアクセスし、アプリを作成します(タイプ:ビジネス)

  2. アプリに Instagram Graph API プロダクトを追加します

  3. Graph API Explorer (developers.facebook.com/tools/explorer) にて:

    • ドロップダウンからアプリを選択します

    • Generate Access Token をクリックします

    • 権限を付与します:instagram_basic, instagram_manage_insights, pages_show_list, pages_read_engagement

  4. InstagramビジネスアカウントIDを取得します:

    • Graph API Explorerで me/accounts をクエリし、ページIDを取得します

    • 次に {page-id}?fields=instagram_business_account をクエリします

    • レスポンス内の id フィールドが INSTAGRAM_ACCOUNT_ID です

  5. Explorerから取得したトークンは短期間(1時間)のみ有効です。長期トークンを取得するには:

    • oauth/access_token?grant_type=fb_exchange_token&client_id={app-id}&client_secret={app-secret}&fb_exchange_token={short-lived-token} で交換します

    • これにより60日間有効なトークンが取得できます

注意: Instagramアカウントは、Facebookページにリンクされたビジネスアカウントまたはクリエイターアカウントである必要があります。

Claude Codeでの使用方法

claude mcp add instagram-mcp -e INSTAGRAM_ACCESS_TOKEN=your_token -e INSTAGRAM_ACCOUNT_ID=17841... -- python3 -m src.server

その後、Claudeに以下のように質問します:

  • 「今月、最もパフォーマンスの高かった投稿は何ですか?」

  • 「オーディエンスの属性を表示して」

  • 「保存数が最も多かった投稿はどれ?」

  • 「エンゲージメント率の傾向はどうなっていますか?」

コンテンツストラテジストエージェント

Instagramのデータを分析し、7つの投稿アイデア、キャプション、投稿時間を含む週次コンテンツプランを生成するスタンドアロンエージェントです。

エージェントの実行

source .venv/bin/activate
python -m agent.content_strategist

AWS認証情報の設定(Anthropic Bedrockを使用)と、MCPサーバーと同じ .env 変数が必要です。エージェントは以下の処理を行います:

  1. アカウント情報、最近の投稿、トップ投稿、オーディエンス属性を取得

  2. パフォーマンスの良い投稿のパターンを特定

  3. 具体的なキャプション、ハッシュタグ、タイミングを含む7日間のコンテンツプランを生成

  4. プランをHTMLファイルとして保存し、ブラウザで開く

Related MCP Connectors

Related MCP Servers

  • A
    license
    Not graded
    quality
    D
    maintenance
    Enables AI applications to interact with Instagram Business accounts through the Graph API, supporting profile management, media publishing, insights retrieval, and direct messaging capabilities.
    MIT
  • F
    license
    Not graded
    quality
    D
    maintenance
    Enables AI assistants to manage Instagram Business accounts by automating content publishing, scheduling posts, and analyzing performance metrics. Supports posts, stories, reels, and carousels with detailed audience insights and hashtag discovery.
    -
  • A
    license
    A
    quality
    C
    maintenance
    Enables AI assistants to manage Instagram and Threads accounts — publish content, handle comments, view insights, search hashtags, and manage DMs through the Meta Graph API.
    59
    13 npm
    12
    MIT