Instagram MCP Server
Allows controlling an Instagram Business or Creator account โ post photos, reels, carousels, read DMs, manage comments, and get account insights via the Instagram Graph API.
๐ธ Instagram MCP Server
Control your Instagram from Claude โ post, analyze, reply to DMs, manage comments. All by chatting.
๐ฌ Demo GIF coming soon โ Claude posting a reel, reading insights, replying to comments live on screen.
What You Can Do
Ask Claude in plain English. It handles the API.
"Show my last 10 posts and which got the most reach"
"Post this image with caption: Monday motivation ๐ช #AI #Health"
"Read my DMs from today and draft replies for the questions"
"Hide all spam comments on my latest reel"
"What are my account insights for this week?"
"Which of my reels got the best watch time?"Use Cases
๐ Content Creator
Morning briefing: "Show yesterday's post performance โ reach, saves, shares"
Strategy: "Compare my last 5 reels by reach and tell me what worked"
Scheduling prep: "Draft 3 caption options for this fitness post"
๐ฅ Doctor / Professional
Engagement: "Reply to all comments on my last post professionally"
Growth tracking: "How many followers did I gain this week?"
Content audit: "List all posts from this month with their engagement rates"
๐๏ธ Small Business
Customer service: "Show DMs from the last 24 hours and reply to order questions"
Publishing: "Post this product photo with this caption and these hashtags"
Analytics: "Which post type (reel/carousel/photo) gets me the most reach?"
Tools (14 total)
Category | Tool | What it does |
Account |
| Followers, bio, post count |
| Update bio text and/or website URL | |
| Last N posts with engagement stats | |
| Reach, profile views, follower growth | |
Insights |
| Per-post reach, saves, views, interactions |
Publishing |
| Post a photo with caption + hashtags |
| Post a Reel (video) | |
| Post 2โ10 images as carousel | |
Comments |
| Read all comments on a post |
| Reply to a comment | |
| Hide spam/unwanted comments | |
| Permanently delete a comment | |
DMs |
| List active DM threads |
| Read messages in a thread | |
| Reply to a DM |
Quick Start
Option A โ Claude Web + Mobile (Recommended)
1. Deploy your server (free, 2 min):
Fill in META_ACCESS_TOKEN and IG_USER_ID when prompted. (How to get these โ)
2. Connect to Claude web:
claude.ai โ Settings โ Integrations โ Add Integration
Paste:
https://your-app-name.onrender.com/mcp
3. Done. Open a new chat and try: "Show my recent Instagram posts"
Option B โ Claude Desktop (Local)
git clone https://github.com/drashrafsaiyed-cyber/instagram-mcp
cd instagram-mcp
uv sync
cp .env.example .env
# Fill .env with your token and user ID
uv run server.pyAdd to claude_desktop_config.json:
{
"mcpServers": {
"instagram": {
"command": "uv",
"args": ["--directory", "/path/to/instagram-mcp", "run", "server.py"]
}
}
}Getting Your Token
This server uses the Instagram Login API (graph.instagram.com) โ the modern Meta approach for Instagram Business/Creator accounts.
Step 1 โ Create or open your Meta app
Go to developers.facebook.com โ My Apps
Create a new app or open an existing one
Add use case: "Manage messaging & content on Instagram"
Step 2 โ Generate your access token
Use cases โ Customize โ API Setup with Instagram Login
Step 2: Generate access tokens โ click Generate next to your account
Copy the token โ this is your
META_ACCESS_TOKENYour numeric IG User ID is shown below your username on the same page
Step 3 โ Refresh before expiry (60 days)
curl "https://graph.instagram.com/refresh_access_token?grant_type=ig_refresh_token&access_token=YOUR_TOKEN"Or just run this in your project folder:
uv run python -c "
import httpx, re
from pathlib import Path
env = Path('.env').read_text()
token = re.search(r'META_ACCESS_TOKEN=(.+)', env).group(1).strip()
r = httpx.get('https://graph.instagram.com/refresh_access_token', params={'grant_type':'ig_refresh_token','access_token':token})
new = r.json()['access_token']
Path('.env').write_text(env.replace(token, new))
print('Refreshed. Expires in:', r.json()['expires_in']//86400, 'days')
"Requirements
Instagram Business or Creator account
Meta Developer app with "Manage messaging & content on Instagram" use case
Python 3.11+
Publishing note: Images and videos must be at a public HTTPS URL โ Instagram fetches from your URL. Use Cloudinary (free), S3, or a public GitHub raw URL. Local file paths won't work.
Architecture
Claude (Web/Desktop)
โ MCP protocol
โผ
instagram-mcp server (FastMCP 3.x, streamable-http or stdio)
โ HTTPS REST
โผ
graph.instagram.com (Instagram Login API v21.0)
โ
โผ
Your Instagram accountWhy graph.instagram.com and not graph.facebook.com?
This server uses the newer Instagram Login API which issues IGAA... tokens and routes through graph.instagram.com. The older Facebook Graph API approach required a linked Facebook Page and EAA... tokens. The new flow is simpler โ just your Instagram account, no Facebook Page needed.
Troubleshooting
Error | Fix |
| Token expired or wrong type. Regenerate via the steps above. |
| Invalid metric name. Metrics differ between account vs media endpoints. |
| Token expired. Run the refresh command. |
Container processing failed | Video too long (>90s), wrong codec, or URL returns 404 after first fetch. |
Empty DM list | No active 24h messaging window. Someone needs to DM you first. |
Claude doesn't see tools | Restart Claude Desktop fully (tray icon โ Quit). Check logs at |
Contributing
PRs welcome. If you add a new tool or fix a metric name mismatch, please:
Test against a real Instagram account
Update the tool table in this README
Note which API permission the new tool requires
License
MIT โ free to use, fork, and deploy commercially.
Built with FastMCP ยท Powered by Instagram Graph API
Latest Blog Posts
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/drashrafsaiyed-cyber/instagram-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server