Instagram MCP Server
The Instagram MCP Server provides 11 tools to read analytics, manage comments, and publish content via the Instagram Graph API, with built‑in reliability features like per‑account rate limiting, exponential backoff retries, input sanitization, and prompt injection protection.
Read & Analytics (SENSE)
Account Insights: Get impressions, reach, follower growth, and profile views over day, week, or 28‑day periods.
Post Insights: Retrieve engagement metrics (impressions, reach, saves, shares) for a specific post.
Story Insights: View reach, replies, follows, profile visits, and interactions for active stories (within their 24‑hour window).
Audience Demographics: Analyze follower, engaged, or reached audiences by age, city, country, or gender (requires 100+ followers).
Hashtag Search: Search public posts by hashtag (limited to 30 unique hashtags per 7‑day rolling window).
Publishing & Engagement (ACT)
Publish Photos: Post a single JPEG or PNG from a public URL, with optional caption and first comment.
Publish Carousels: Create a multi‑image (2–10 items) carousel post from public URLs, with optional caption and first comment.
Publish Reels: Upload an MP4 video with optional caption, custom cover image, feed sharing toggle, and first comment; asynchronous processing is handled automatically.
Manage Comments: Fetch comments (up to 50 at a time, paginated), reply to a comment, or delete a comment on your own posts.
Authentication can be set via environment variables or passed per call for flexibility.
Provides tools to read Instagram account and post insights, manage comments, and publish photos, carousels, and reels using the Instagram Graph API.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Instagram MCP Server Show me my Instagram account insights for the last 28 days"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
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 |
| Account insights: reach, follower growth, profile views over a period |
| Engagement metrics for a specific post: reach, likes, shares, saves |
| Comments on a post with username, timestamp, and replies |
| Insights for an active story: reach, replies, interactions |
| Follower demographics: city, country, age/gender breakdown |
| Search public posts by hashtag (30 unique hashtags per 7-day window) |
ACT (write):
Tool | Description |
| Publish a photo post from a public URL |
| Publish a carousel (2-10 images) from public URLs |
| Publish a reel (short video) from a public URL |
| Reply to a comment on a post |
| 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
Related MCP server: Instagram MCP Server
Quick Start
Prerequisites
Node.js 22.14+
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
Published package: @luminarylane/instagram-mcp-server on npm
Run without a global install:
INSTAGRAM_ACCESS_TOKEN=your-token INSTAGRAM_BUSINESS_ACCOUNT_ID=your-account-id npx --yes @luminarylane/instagram-mcp-serverTo run from source:
git clone https://github.com/luminarylane/instagram-mcp-server.git
cd instagram-mcp-server
npm install
npm run buildConfiguration
Claude Desktop (claude_desktop_config.json):
{
"mcpServers": {
"instagram": {
"command": "npx",
"args": ["--yes", "@luminarylane/instagram-mcp-server"],
"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 |
| Yes* | Long-lived Facebook Page Access Token |
| 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_accountThe 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
Available Tools
11 toolsig_delete_commentB
Delete a comment on one of your Instagram posts.
Inputs: commentId (required), accountId, accessToken.
ig_get_account_insightsB
Get Instagram account insights: impressions, reach, follower growth, and profile views over a period.
Inputs: since, until, period, accountId, +1 more.
ig_get_audience_demographicsB
Get follower demographics: city, country, and age/gender breakdown. Requires 100+ followers.
Inputs: metric, accountId, breakdown, accessToken.
ig_get_commentsB
Get comments on an Instagram post. Returns comment text, username, and timestamp.
Inputs: mediaId (required), after, limit, accountId, +1 more.
ig_get_hashtag_searchA
Search public Instagram posts by hashtag. Two-step: search hashtag ID → get recent media. Limited to 30 unique hashtags per 7-day rolling window.
Inputs: hashtag (required), limit, accountId, accessToken.
ig_get_post_insightsA
Get engagement metrics for a specific Instagram post: impressions, reach, engagement, saves, shares.
Inputs: mediaId (required), accountId, accessToken.
ig_get_stories_insightsA
Get insights for an active Instagram story: reach, replies, follows, profile_visits, total_interactions. Stories expire after 24 hours — storyId must reference a currently active story (fetch from /{ig-account-id}/stories).
Inputs: storyId (required), accountId, accessToken.
ig_publish_carouselA
Publish a carousel (multi-image) post to Instagram. Requires 2-10 items. Each item URL must be publicly accessible. Flow: create child containers → create parent container → publish.
Inputs: items (required), caption, accountId, accessToken, +1 more.
ig_publish_photoA
Publish a photo post to Instagram. The image_url must be publicly accessible. Flow: create media container → publish.
Inputs: imageUrl (required), caption, accountId, accessToken, +1 more.
ig_publish_reelA
Publish a reel (short video) to Instagram. The video_url must be publicly accessible. Video processing is async — this tool polls until ready, then publishes.
Inputs: videoUrl (required), caption, coverUrl, accountId, +3 more.
ig_reply_commentB
Reply to a comment on an Instagram post.
Inputs: message (required), commentId (required), accountId, accessToken.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 11 tools
Each tool targets a distinct action on Instagram (publish different media types, manage comments, retrieve insights, search hashtags). No two tools overlap in purpose, so an agent can clearly distinguish them.
All tools follow the 'ig_<verb>_<noun>' pattern using snake_case. Verbs like get, publish, delete, reply are consistently applied, and nouns clearly indicate the target (e.g., comment, account_insights). No mixing of conventions.
11 tools is appropriate for an Instagram integration covering publishing, comments, insights, audience demographics, and hashtag search. The scope is focused without being too narrow or overly broad.
The tool set covers publishing and insights well but lacks basic post management operations (read, update, delete posts). Also missing story publishing and like/unlike functions. Some common workflows require external tools to fill gaps.
Maintenance
Related MCP Connectors
Instagram MCP for DM and comment automation, AI Agent and content publishing via Meta's official API
Create, schedule and publish Instagram and Facebook posts from Claude or ChatGPT.
Run your social media from Claude, ChatGPT or any MCP client. Feedlio's MCP server lets your assistant list workspaces and connected accounts, add media, and create, edit, reschedule and cancel posts across 15 platforms, including Facebook, Instagram, LinkedIn, YouTube, TikTok, Pinterest, Threads, Bluesky, Mastodon, Dev.to and Google Business Profile. Sign in with OAuth on Feedlio's own page. MCP is included on every Feedlio plan, the Free plan too. Support: support@feedlio.io. Also in Claude's Connectors Directory: https://claude.ai/directory/connectors/feedlio
Publish to Instagram from chat — official Graph API, OAuth 2.1, free for your own posts.
Related MCP Servers
- FlicenseBqualityDmaintenanceProvides Instagram analytics, media downloads, and search capabilities through an MCP interface for use with Claude and other MCP clients.4344-
- AlicenseNot gradedqualityDmaintenanceExposes Instagram actions (posts, media, comments, DMs, insights, Messenger profile) to Claude and ChatGPT via MCP.1MIT
- AlicenseNot gradedqualityDmaintenanceA production-ready Remote MCP Server that gives Claude direct, tool-based access to your Instagram Business account through the Meta Graph API — profile data, posts, comments, publishing, insights, analytics, hashtags, messaging, and real-time webhooks.7 npmMIT
- AlicenseNot gradedqualityDmaintenanceConnects Claude to the official Meta Instagram Graph API (read-only) for retrieving Instagram profile, media, insights, and comments as MCP tools over Streamable HTTP.1MIT