ig-write
Enables AI agents to publish Instagram content—posts, reels, stories, and carousels—as well as manage media by deleting, liking, and unliking through the official 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., "@ig-writePost this image to Instagram with caption 'hello': https://example.com/pic.jpg"
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_agent_mcp
Official-API Instagram writer for humans and AI agents. No API key — it reuses
ig-agent's stored long-lived token.
Two entry points, one logic core:
File | What |
| Zero-dependency Python CLI (stdlib only). Post / reel / story / carousel / delete / like |
| MCP stdio server wrapping |
Prereqs
Python 3.10+
An Instagram Business/Creator account connected via
ig-agent:npm install -g ig-agent ig-agent auth login # or: ig-agent auth exchange --redirect-uri ... --code ... ig-agent auth status # check granted scopesFor MCP mode:
pip install -r requirements.txt
Related MCP server: Instagram Complete MCP Server
Scopes
Action | Scope |
post / reel / story / carousel |
|
like / unlike |
|
delete |
|
ig-write me + ig-write <cmd> surface a clear re-auth hint when a scope is missing.
Like/delete/unlike fail fast without an API call when ig-agent's recorded
grant lacks the scope. Notes has no official Meta API and is intentionally
not included.
Known limitations (Instagram Login path)
instagram_manage_engagement(like) andinstagram_manage_contents(delete) were observed not granted via Instagram Login OAuth (Apr/Dec 2026 APIs) — Meta's docs place Like under the Facebook-Login app path, and Delete may need one too and/or app review. The tool tells you this instead of a rawsubcode=33.Stories: no stickers/polls/links/music via API; expire after 24 h.
Reels: original audio only;
media_typereads back asVIDEO(media_product_typesaysREEL/STORY).Media must be a public https URL — Meta cURLs it. Local files need hosting first (e.g.
catbox.moe). Story images: JPEG, 9:16 (1080×1920) best.No scheduling, no caption edit after publish, no Notes/Likes-bulk endpoints.
CLI usage
./ig-write me
./ig-write post --image-url https://example.com/pic.jpg --caption "hello"
./ig-write reel --video-url https://example.com/clip.mp4 --caption "hi"
./ig-write story --image-url https://example.com/pic.jpg
./ig-write story --video-url https://example.com/clip.mp4
./ig-write carousel-item --image-url https://example.com/a.jpg # -> container id
./ig-write carousel --children CID1,CID2 --caption "swipe"
./ig-write publish --creation-id <container_id>
./ig-write status --container-id <container_id>
./ig-write delete --media-id <media_id>
./ig-write like --media-id <id>
./ig-write unlike --comment-id <id>Media must be on a public https URL. Flow per command:
create container → poll status_code=FINISHED → media_publish.
--container-only stops after step 1 (container expires in 24 h).
Limits: ~100 API publishes / rolling 24 h.
MCP (agentic mode)
pip install -r requirements.txtClient config (stdio):
{
"mcpServers": {
"ig-write": {
"command": "python3",
"args": ["/path/to/Instagram_agent_mcp/ig-mcp-server.py"]
}
}
}Tools: ig_me, ig_post, ig_reel, ig_story, ig_carousel_item, ig_carousel, ig_publish, ig_container_status, ig_delete, ig_like, ig_unlike.
The token is read from your local ig-agent config — no extra login.
Remote (Vercel) — recommended
A remote MCP server for Claude (custom connector) and ChatGPT lives in
vercel/ — Node serverless functions on Vercel Hobby (free):
MCP over Streamable HTTP at
/mcp(stateless), hand-rolled OAuth 2.1 single-user login (ADMIN_PASSWORD) + dynamic client registrationSame 17 tools as below (publishing + analytics + image generation); every write defaults to
dry_run=true; 95/24h publish capVercel KV (token/OAuth state) + Vercel Blob (public image URLs) + Vercel Cron (30-day token refresh); images via free Pollinations/HF
Minimal
/api/rest/*+/api/openapi.jsonfor Custom GPT Actions
Deploy: import the repo with Root Directory vercel, add KV + Blob in the
dashboard, set env vars, redeploy. Full walkthrough:
vercel/README_DEPLOY_VERCEL.md.
Remote (Cloudflare) — alternative
A remote MCP server for Claude (custom connector) and ChatGPT lives in
worker/ — TypeScript on Cloudflare Workers (free plan):
MCP over Streamable HTTP at
/mcp(stateless, no Durable Objects), OAuth 2.1 single-user login (ADMIN_PASSWORD), dynamic client registrationPorts all Python publishing tools (
container → poll FINISHED → media_publish) plus analytics (ig_account_insights,ig_list_media,ig_media_insights,ig_get_comments/ig_reply_comment,ig_audience_demographics,ig_best_posting_time) and image generation (ig_generate_image,ig_generate_and_postvia Workers AI flux-1-schnell → KV)Every write tool defaults to
dry_run=true(preview; publish only whendry_run=false); 95/24h publish safety cap; KV token storage with 30-day cron refresh; minimal/api/*REST +/openapi.jsonfor Custom GPT ActionsLike/unlike/delete are intentionally not ported (scopes not grantable on the Instagram Login path)
Deploy: cd worker && ./scripts/setup.sh, set secrets, wrangler deploy.
Full walkthrough (Meta app, Claude connector, ChatGPT Actions, test prompts):
worker/README_DEPLOY.md.
Layout
Instagram_agent_mcp/
├── ig-write # CLI (stdlib only, executable)
├── ig-mcp-server.py # MCP server (needs: pip install mcp)
├── test_ig_write.py # stdlib unit tests (no network)
├── requirements.txt
├── README.md
└── LICENSETroubleshooting
Symptom | Fix |
|
|
| Re-auth with that scope; see Known limitations |
| Media URL not fetchable or wrong spec — check public URL + format |
| Large video still processing — rerun |
MCP |
|
Disclaimer
Uses Meta's official Instagram Graph API only. Media URLs must be public;
respect Meta's rate limits and ToS — this is for your own accounts, not for
serving end-user generation. Tested against graph.instagram.com v26.0.
This server cannot be deployed
Maintenance
Related MCP Connectors
Instagram for AI agents: publish, read comments and DMs, insights, and engage from your account.
Create, review, publish and schedule Instagram images, carousels and Reels with AI assistants.
Publish to Instagram from chat — official Graph API, OAuth 2.1, free for your own posts.
Instagram search and posts for AI agents, with images and videos AI-parsed to text.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables AI applications to interact with Instagram Business accounts through the Graph API, supporting profile management, media publishing, insights retrieval, and direct messaging capabilities.MIT
- FlicenseNot gradedqualityDmaintenanceEnables AI assistants to manage Instagram Business accounts by automating content publishing, scheduling posts, and analyzing performance metrics. Supports posts, stories, reels, and carousels with detailed audience insights and hashtag discovery.1-
- AlicenseAqualityCmaintenanceEnables AI assistants to manage Instagram and Threads accounts — publish content, handle comments, view insights, search hashtags, and manage DMs through the Meta Graph API.5989 npm12MIT
- FlicenseBqualityDmaintenanceEnables AI agents to control Instagram accounts programmatically, supporting profile management, media interaction, direct messaging, and follower management.132-