Instagram MCP Server
Connects Claude Desktop and other MCP clients to the Instagram Graph API for reading analytics, managing comments, and publishing photos, carousels, and reels.
README
Instagram MCP Server
A Model Context Protocol (MCP) server that connects Claude Desktop (and other MCP clients) to the Instagram Graph API — read analytics, manage comments, publish photos, carousels, and reels.
Features
11 Instagram Tools
SENSE (read-only):
| Tool | Description |
|---|---|
ig_get_account_insights |
Account insights: reach, follower growth, profile views over a period |
ig_get_post_insights |
Engagement metrics for a specific post: reach, likes, shares, saves |
ig_get_comments |
Comments on a post with username, timestamp, and replies |
ig_get_stories_insights |
Insights for an active story: reach, replies, interactions |
ig_get_audience_demographics |
Follower demographics: city, country, age/gender breakdown |
ig_get_hashtag_search |
Search public posts by hashtag (30 unique hashtags per 7-day window) |
ACT (write):
| Tool | Description |
|---|---|
ig_publish_photo |
Publish a photo post from a public URL |
ig_publish_carousel |
Publish a carousel (2-10 images) from public URLs |
ig_publish_reel |
Publish a reel (short video) from a public URL |
ig_reply_comment |
Reply to a comment on a post |
ig_delete_comment |
Delete a comment on one of your posts |
Built-in Reliability
- Per-tenant rate limiting — token-bucket rate limiter keyed by IG Business Account ID
- Exponential backoff retry — automatic retry with jitter for transient API errors
- Container-based publishing — create container → poll status → publish (handles async video processing)
- Input sanitization — strips zero-width characters, normalizes whitespace, truncates to API limits
- Prompt injection protection — wraps external API data in randomized markers
Quick Start
Prerequisites
- Node.js 18+
- An Instagram Business or Creator account connected to a Facebook Page
- A Facebook App with the Instagram Graph API enabled
- A long-lived Page Access Token
Getting Your Access Token
- Create a Facebook App
- Add the Instagram Graph API product
- In Graph API Explorer, generate a Page Access Token with these permissions:
instagram_basic,instagram_content_publish,instagram_manage_comments,instagram_manage_insights,pages_show_list,pages_read_engagement
- Extend the token to a long-lived token (60 days)
Installation
git clone https://github.com/luminarylane/instagram-mcp-server.git
cd instagram-mcp-server
npm install
npm run build
Configuration
Claude Desktop (claude_desktop_config.json):
{
"mcpServers": {
"instagram": {
"command": "node",
"args": ["/path/to/instagram-mcp-server/dist/index.js"],
"env": {
"INSTAGRAM_ACCESS_TOKEN": "your_long_lived_page_token",
"INSTAGRAM_BUSINESS_ACCOUNT_ID": "your_17_digit_ig_business_account_id"
}
}
}
}
Environment variables:
| Variable | Required | Description |
|---|---|---|
INSTAGRAM_ACCESS_TOKEN |
Yes* | Long-lived Facebook Page Access Token |
INSTAGRAM_BUSINESS_ACCOUNT_ID |
Yes* | 17-digit IG Business Account ID |
*Can also be passed per-call via tool arguments.
Finding Your Business Account ID
Use the Graph API Explorer:
GET /me/accounts?fields=instagram_business_account
The instagram_business_account.id field is your Business Account ID.
Usage Examples
Once configured, ask Claude to:
- "Show me my Instagram account insights for the last 28 days"
- "What are the engagement metrics for my latest post?"
- "Get the comments on this post" (paste a media ID)
- "Show my follower demographics by country"
- "Publish this photo to Instagram" (provide a public image URL + caption)
- "Create a carousel post with these images"
- "Reply to this comment with 'Thanks!'"
- "Search recent posts with #startup"
Publishing
Photo and carousel publishing is synchronous — the tool returns once the post is live. Reel publishing is asynchronous — the server polls the container status until processing completes, then publishes.
All publish tools accept an optional firstComment parameter to add a comment immediately after publishing (commonly used for hashtags).
Rate Limiting
The server enforces per-account rate limits to stay within Instagram's API quotas. If you hit a rate limit, the tool will return an error with a suggested retry time. The built-in retry logic handles transient 429 responses automatically.
Contributing
- Fork the repo
- Create a feature branch (
git checkout -b feat/my-feature) - Make changes and run tests (
npm test) - Submit a pull request
License
MIT License — see LICENSE for details.
Acknowledgments
- Anthropic for the MCP specification
- Meta Graph API for the underlying Instagram API
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。