Instagram MCP Server

Instagram MCP Server

Enables managing multiple Instagram business accounts via a single token using Facebook Graph API and Partners model.

Category
访问服务器

README

Instagram MCP Server (agency, Partners model)

Connect Claude to all your clients' Instagram accounts at once.

The agency runs a central Business Manager. Each client BM shares its Page + Instagram account into the central BM via Partners. One System User token in the central BM then sees every client → a single token covers everyone. Local stdio MCP server in Python.

The server also supports multiple tokens (one per BM) as a fallback — see "Multiple tokens" below — but the Partners model needs just one.

How it works

Uses the Facebook Graph API. The central token walks the Pages it can access (/me/accounts → each Page's linked instagram_business_account, including partner-shared ones) and builds a registry of every account (username + ig id). Per-account tools take an account argument; list_accounts shows them all.

Tools (35)

Core

Tool What it does
list_accounts Every IG account across all client BMs (username, id, followers, BM label)
get_account_info Profile + counts for one account
get_account_insights Reach, views, interactions, accounts engaged
get_audience_demographics Follower breakdown by country / city / age / gender
list_recent_media Recent posts (caption, type, likes, comments, permalink)
get_media_insights Per-post reach, likes, comments, saves, shares, views
get_media_comments Comments on a post
publish_photo / publish_reel / publish_carousel Post to one account
reply_to_comment Reply to a comment

Agency reports (combine many calls)

Tool What it does
bulk_insights Insights for EVERY managed account at once
compare_accounts Side-by-side followers / reach / interactions / engagement rate
top_posts Best posts in a window (by engagement / likes / comments)
engagement_rate Avg engagement rate over a window
best_time_to_post Best hours from online-followers data
weekly_report One-shot client report: profile + insights + ER + top posts

Deeper insights

Tool What it does
get_follower_growth Daily follower-count series
get_reel_insights Reel reach/views + avg & total watch time
get_story_insights Story reach, replies, navigation (query while live)
get_profile_activity Taps on profile links

Competitor / market

Tool What it does
business_discovery Public profile data of any business/creator by username
business_discovery_media A competitor's recent public posts
search_hashtag Resolve a hashtag to its id
get_hashtag_media Top / recent media for a hashtag

Moderation + publishing+

Tool What it does
publish_story Post a Story (photo or video)
hide_comment / delete_comment Moderate comments
toggle_comments Enable/disable comments on a post
get_tagged_media Posts where the account was @tagged
get_active_stories Currently-live stories
get_publishing_limit Remaining posts in the 24h quota

Direct messages (needs instagram_manage_messages scope)

Tool What it does
list_dm_conversations Recent DM threads (id, participants, last update)
get_dm_messages Read messages in a thread
send_dm Send a DM (subject to Meta's 24h messaging window)

Per-account tools accept account (username or id). Media-level tools also accept account so the server knows which BM's token to use — required when more than one BM is configured. Competitor/hashtag tools use one of your accounts to make the query.

Requirements (Meta's, not optional)

  • Each managed Instagram account must be Business or Creator and linked to its Facebook Page.
  • A central Business Manager that owns your Meta app.
  • Each client BM shares its Page into the central BM via Partners (steps below).
  • To manage accounts you don't own, the app needs Advanced Access (App Review) for instagram_manage_insights / instagram_content_publish.
  • Some metrics (demographics, etc.) need ≥100 followers.

Setup

1. Get your central BM's Business ID

https://business.facebook.com/settings → Business info → copy the Business Manager ID (a long number). You'll give this to each client BM.

2. In EACH client BM: share the Page as a partner

Open the client's BM (https://business.facebook.com/settings → switch business):

  1. Users → Partners → Add → "Give a partner access to your assets".
  2. Paste your central BM's Business ID (step 1).
  3. Select that client's Page → grant full control (Manage). The linked IG account rides along.

Repeat for every client BM. (You add partners; the client BM is where assets are shared from.)

3. In the central BM: one System User + one token

Back in your central BM (https://business.facebook.com/settings):

  1. Users → System Users → Add → role Admin.
  2. Add Assets → Apps → your Meta app → full control.
  3. Add Assets → Pages → you should now see the partner-shared client Pages → assign them (full control).
  4. Generate New Token → your app → scopes: instagram_basic, instagram_manage_insights, instagram_content_publish, pages_show_list, pages_read_engagement, business_management.
  5. Expiration off → never expires. Copy the token.

4. Install + store the token

macOS / Linux:

cd ~/insta-mcp                       # wherever you put the folder
python3 -m pip install -r requirements.txt
python3 quickstart.py

Windows (PowerShell):

cd C:\Users\eduardo\Desktop\insta-mcp
python -m pip install -r requirements.txt
python quickstart.py

(Use python3 on macOS. If pip complains about a managed environment, make a venv first: python3 -m venv .venv && source .venv/bin/activate.) In the wizard, paste the single central token (label it e.g. "Central"). Or set IG_ACCESS_TOKEN=<token> in .env, or put one entry in tokens.json.

5. Verify

python auth_helper.py me         # checks the token, prints its owner
python auth_helper.py accounts   # lists every shared IG account it can see
python smoke_test.py             # runs all read tools against the first account
python smoke_test.py domino      # or target one account by username/id

accounts should list every client whose Page you shared in step 2. Missing one → that client BM didn't share its Page (or you didn't assign it in step 3.3).

6. Wire into Claude

quickstart.py prints this for you with the correct paths. macOS example:

{
  "mcpServers": {
    "instagram": {
      "command": "python3",
      "args": ["/Users/you/insta-mcp/server.py"]
    }
  }
}

Windows uses "command": "python" and a C:\\...\\server.py path. Tokens load from tokens.json automatically.

Claude Code (mac):

claude mcp add instagram -- python3 /Users/you/insta-mcp/server.py

Restart, then: "List my Instagram accounts, then last week's insights for @domino."

Tip: if you used a venv, point command at the venv's python (e.g. /Users/you/insta-mcp/.venv/bin/python) so the deps are found.


Multiple tokens (fallback)

If you ever can't use Partners for some client, you can run a separate token for that BM. Put several entries in tokens.json:

[
  { "label": "Central", "token": "EAA..." },
  { "label": "Standalone Client", "token": "EAA..." }
]

The server discovers all of them, tags each account by business label, and auto-routes every call to the right token. A broken token shows as an error row in list_accounts (tagged with its BM); the rest keep working. With more than one token, media-level tools (get_media_insights etc.) need an account to pick the token.

Notes

  • list_accounts is cached per process; pass refresh=true after sharing a new client.
  • Optional IG_DEFAULT_ACCOUNT (in .env) lets tools omit account.
  • Publishing media URLs must be public HTTPS (Meta fetches them server-side).

Troubleshooting

  • account not found → run list_accounts(refresh=true); confirm the client shared its Page (step 2) and you assigned it to the System User (step 3.3).
  • partner-shared Page not visible in step 3.3 → the client BM hasn't approved/shared it yet, or shared to the wrong Business ID.
  • demographics empty → that account has <100 followers.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选