instagram-mcp

instagram-mcp

Instagram MCP server with 23 tools for the Graph API. Manage posts, comments, DMs, stories, hashtags, reels, carousels, and analytics.

Category
访问服务器

README

@mcpware/instagram-mcp

<p align="center"> <a href="https://github.com/mcpware/instagram-mcp"> <img src="https://socialify.git.ci/mcpware/instagram-mcp/image?description=1&font=Inter&language=1&name=1&owner=1&pattern=Plus&stargazers=1&theme=Dark" alt="instagram-mcp" width="640" /> </a> </p>

<p align="center"> <a href="https://www.npmjs.com/package/@mcpware/instagram-mcp"><img src="https://img.shields.io/npm/v/@mcpware/instagram-mcp.svg" alt="npm version" /></a> <a href="https://opensource.org/licenses/MIT"><img src="https://img.shields.io/badge/License-MIT-yellow.svg" alt="License: MIT" /></a> <a href="https://nodejs.org"><img src="https://img.shields.io/badge/node-%3E%3D20-brightgreen" alt="Node.js" /></a> <a href="https://www.typescriptlang.org/"><img src="https://img.shields.io/badge/TypeScript-5.7-blue" alt="TypeScript" /></a> <a href="https://modelcontextprotocol.io"><img src="https://img.shields.io/badge/MCP-compatible-purple" alt="MCP" /></a> </p>

Instagram MCP server — 23 tools for the Instagram Graph API via Model Context Protocol.

Manage posts, comments, DMs, stories, hashtags, reels, carousels, and analytics from Claude Code, Cursor, or any MCP client.

Quick Start

npx @mcpware/instagram-mcp

Claude Code / Cursor .mcp.json

{
  "mcpServers": {
    "instagram": {
      "command": "npx",
      "args": ["-y", "@mcpware/instagram-mcp"],
      "env": {
        "INSTAGRAM_ACCESS_TOKEN": "your-meta-long-lived-token",
        "INSTAGRAM_ACCOUNT_ID": "your-ig-business-account-id"
      }
    }
  }
}

Prerequisites

  • Instagram Business or Creator account (personal accounts are not supported by the Graph API)
  • Facebook Page connected to your Instagram account
  • Meta long-lived access token (see setup guide below)
  • Instagram Business Account ID (obtained during setup)

Setup Guide — Getting Your Access Token

Meta's token setup is a multi-step process. Follow these steps carefully.

Step 1: Connect Instagram to a Facebook Page

Your IG Business/Creator account must be linked to a Facebook Page. Without this, the Graph API won't work.

  1. Open Instagram app → Settings → Account → Sharing to other apps → Facebook
  2. Select the Facebook Page to connect
  3. If you don't have a Page, create one at facebook.com/pages/creation

Step 2: Create a Meta Developer App

  1. Go to developers.facebook.com → Log in
  2. Click "Create App"
  3. App name: anything (e.g. "My IG Tool") — cannot contain "IG", "Instagram", "Facebook", etc.
  4. Use case: "Manage Instagram content and messaging" (under Content Management)
  5. Skip business portfolio for now
  6. Complete creation

Step 3: Add Permissions

  1. Go to your app → Use CasesCustomizeAPI setup with Facebook login
  2. Click "Add required content permissions" (adds instagram_basic, instagram_content_publish, pages_read_engagement, business_management, pages_show_list)
  3. Click "Add required messaging permissions" (adds instagram_manage_messages)

Step 4: Generate Access Token

  1. Go to Graph API Explorer
  2. Select your app from the "Meta App" dropdown
  3. Click "Get Token""Get User Access Token"
  4. Add permissions: instagram_basic, pages_show_list, pages_read_engagement, instagram_content_publish, instagram_manage_insights, instagram_manage_comments
  5. Click "Generate Access Token" → Authorize in the popup
  6. Copy the token

Note: The Graph API Explorer may show "No configuration available" if permissions aren't set up yet. Make sure Step 3 is done first.

Step 5: Get Your Instagram Business Account ID

In the Graph API Explorer, run:

GET /me/accounts?fields=id,name,instagram_business_account

Find your Page in the response. The instagram_business_account.id is your INSTAGRAM_ACCOUNT_ID.

Step 6: Exchange for Long-Lived Token (60 days)

The token from Step 4 expires in 1 hour. Exchange it:

curl "https://graph.facebook.com/v19.0/oauth/access_token?\
grant_type=fb_exchange_token&\
client_id=YOUR_APP_ID&\
client_secret=YOUR_APP_SECRET&\
fb_exchange_token=YOUR_SHORT_LIVED_TOKEN"

Find your App ID and App Secret in: App Dashboard → Settings → Basic.

The returned access_token is valid for 60 days.

Step 7: Configure and Run

export INSTAGRAM_ACCESS_TOKEN="your-long-lived-token"
export INSTAGRAM_ACCOUNT_ID="your-ig-business-account-id"
npx @mcpware/instagram-mcp

Troubleshooting

Problem Cause Fix
me/accounts returns empty [] IG not connected to a Facebook Page, or you're not Page admin Do Step 1
Graph API Explorer says "No configuration available" Permissions not added to app Do Step 3
"Generate Access Token" is disabled Need to select "Get User Access Token" first Click "Get Token" dropdown
App name rejected (contains "IG", "Insta", etc.) Meta blocks trademarked words Use a generic name
Token expired Short-lived tokens last 1 hour Do Step 6 for 60-day token
(#10) To use Instagram Graph API... IG account is Personal, not Business Switch to Business/Creator in IG settings

Environment Variables

Variable Required Default Description
INSTAGRAM_ACCESS_TOKEN Yes Meta long-lived access token
INSTAGRAM_ACCOUNT_ID Yes Instagram business account ID
INSTAGRAM_API_VERSION No v19.0 Graph API version

Tools (23)

Profile & Account

Tool Description
get_profile_info Get profile info (bio, followers, media count)
get_account_pages List connected Facebook pages
get_account_insights Account-level analytics (reach, profile views)
validate_access_token Check if token is valid

Media & Publishing

Tool Description
get_media_posts Get recent posts with engagement metrics
get_media_insights Detailed analytics for a specific post
publish_media Publish image or video
publish_carousel Publish carousel (2-10 images/videos)
publish_reel Publish a Reel
get_content_publishing_limit Check daily publishing quota

Comments

Tool Description
get_comments Get comments on a post
post_comment Post a comment
reply_to_comment Reply to a comment
delete_comment Delete a comment
hide_comment Hide/unhide a comment

Direct Messages

Tool Description
get_conversations List DM conversations
get_conversation_messages Read messages in a conversation
send_dm Send a direct message

Discovery & Content

Tool Description
search_hashtag Search for a hashtag ID
get_hashtag_media Get top/recent media for a hashtag
get_stories Get current active stories
get_mentions Get posts you're tagged in
business_discovery Look up another business account

Limitations

These are Instagram Graph API limitations, not this tool's:

  • Business/Creator accounts only — personal accounts are not supported
  • Long-lived tokens expire after 60 days — refresh before expiry
  • 200 API calls per hour rate limit
  • 25 posts per day publishing limit
  • DMs require Advanced Access — Meta app review required
  • Hashtag search: 30 unique hashtags per 7 days

Credits

TypeScript rewrite of jlbadano/ig-mcp (Python).

License

MIT

推荐服务器

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 模型以安全和受控的方式获取实时的网络信息。

官方
精选