Instagram MCP Server

Instagram MCP Server

user can control instagram account with claude web

Category
访问服务器

README

📸 Instagram MCP Server

Control your Instagram from Claude — post, analyze, reply to DMs, manage comments. All by chatting.

License: MIT Python 3.11+ MCP Deploy to Render


<!-- Add your demo GIF here: record Claude Desktop controlling Instagram and drop the .gif below -->

🎬 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 get_account_info Followers, bio, post count
update_profile Update bio text and/or website URL
list_recent_media Last N posts with engagement stats
get_account_insights Reach, profile views, follower growth
Insights get_media_insights Per-post reach, saves, views, interactions
Publishing publish_photo Post a photo with caption + hashtags
publish_reel Post a Reel (video)
publish_carousel Post 2–10 images as carousel
Comments get_comments Read all comments on a post
reply_to_comment Reply to a comment
hide_comment Hide spam/unwanted comments
delete_comment Permanently delete a comment
DMs list_conversations List active DM threads
get_messages Read messages in a thread
send_dm Reply to a DM

Quick Start

Option A — Claude Web + Mobile (Recommended)

1. Deploy your server (free, 2 min):

Deploy to Render

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.py

Add 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

  1. Go to developers.facebook.com → My Apps
  2. Create a new app or open an existing one
  3. Add use case: "Manage messaging & content on Instagram"

Step 2 — Generate your access token

  1. Use cases → Customize → API Setup with Instagram Login
  2. Step 2: Generate access tokens → click Generate next to your account
  3. Copy the token → this is your META_ACCESS_TOKEN
  4. Your 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 account

Why 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
Cannot parse access token Token expired or wrong type. Regenerate via the steps above.
code 100 on insights Invalid metric name. Metrics differ between account vs media endpoints.
code 190 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 %APPDATA%\Claude\logs\.

Contributing

PRs welcome. If you add a new tool or fix a metric name mismatch, please:

  1. Test against a real Instagram account
  2. Update the tool table in this README
  3. 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

推荐服务器

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

官方
精选