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 并创建一个应用(类型:Business)

  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