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 MCP Platform — Multi-Account Studio & Server
Enterprise-grade Model Context Protocol (MCP) server and REST API for controlling multiple Instagram Business and Creator accounts from AI agents (Claude, Cursor, ChatGPT). Powered by Vercel Serverless and Firebase Realtime Database.
Highlights
Multi-Account Support: Connect and command unlimited Instagram Business/Creator accounts from a single MCP endpoint. Tools accept an optional
accountparameter (usernameorig_user_id), automatically falling back to your designated active default account.Modern Admin Panel (
/admin): Sleek dark-mode dashboard to connect accounts, verify Meta tokens, inspect real-time token expiration, and switch default accounts.Firebase Realtime Database: Stores connected accounts, tokens, and per-account rate limit quotas safely.
Streamable HTTP MCP (
/mcp): Stateless serverless endpoint with OAuth 2.1 authentication and RFC 8414 / RFC 9728 discovery for Claude Code, Cursor, and custom connectors.19 Agentic Tools: Feed posts, reels, stories, carousels, analytics/insights, follower demographics, optimal posting times, and AI image generation.
Automated Token Maintenance: Vercel Cron runs every 30 days to auto-renew 60-day Meta tokens before they reach expiration.
Safety First: All publishing actions default to
dry_run=trueto preview actions safely; rate limits are capped at 95 posts per rolling 24-hour window per account.
Related MCP server: Instagram MCP Server
Layout
Instagram_agent_mcp/
├── vercel/ # Serverless platform root (deployable to Vercel)
│ ├── api/
│ │ ├── admin/ # Admin API (/api/admin/accounts)
│ │ ├── cron/ # Auto token refresh cron (/api/cron/refresh)
│ │ ├── oauth/ # OAuth 2.1 endpoints (authorize, token, register)
│ │ ├── rest/ # REST mirrors for Custom GPT actions
│ │ ├── mcp.ts # Streamable HTTP MCP server handler (/mcp)
│ │ └── openapi.ts # OpenAPI 3.1 specification (/api/openapi.json)
│ ├── lib/
│ │ ├── firebase.ts # Firebase Realtime Database AccountStore
│ │ ├── tools.ts # 19 MCP tool schemas and business logic
│ │ ├── ig.ts # Instagram Graph API lifecycle & budget engine
│ │ ├── images.ts # Free AI image generation (Pollinations / HF)
│ │ └── oauth.ts # OAuth 2.1 server & JWT token handling
│ ├── public/
│ │ └── admin.html # Interactive Admin Dashboard (/admin)
│ ├── tests/ # Vitest test suite (51 tests)
│ ├── package.json
│ └── vercel.json # Rewrites, cron, and serverless timeout settings
├── docs/ # Specifications and implementation plans
└── README.md19 Available MCP Tools
Category | Tools | Description |
Account Management |
| View connected accounts, change active default, verify credentials |
Publishing |
| Photos, reels, stories, multi-slide carousels (default |
Analytics & Insights |
| Reach, views, engagement, demographics, optimal posting slots |
Engagement |
| Read and reply to comments on published media |
AI Generation |
| Free image generation + direct-to-Instagram workflow |
Quick Setup & Deployment
1. Deploy to Vercel
Import this repository in your Vercel Dashboard.
Set the Root Directory to
vercel.Add KV and Blob in the Vercel Storage tab (free tiers).
2. Environment Variables
Set the following in Settings → Environment Variables:
Variable | Required | Description |
| Yes | Password for Admin Panel ( |
| Yes | 32+ character random secret ( |
| Yes | 32+ character secret for automated token refresh |
| No | Defaults to |
| No | Optional Database Secret for Firebase Realtime Database rules |
| No | Default visual style appended to AI image generation prompts |
| No | Optional Hugging Face token for FLUX.1-schnell image generation |
3. Connect Accounts via Admin Panel
Open
https://<your-project>.vercel.app/adminin your browser.Enter your
ADMIN_PASSWORDto unlock the dashboard.Click + Connect Account and paste your Meta Long-Lived Token (from Meta Developer Portal).
The platform automatically verifies the account against Meta's Graph API, extracts the username and ID, and stores it in Firebase Realtime Database.
MCP Client Configuration
Connect from Claude, Cursor, or ChatGPT:
Claude / Cursor (Streamable HTTP)
{
"mcpServers": {
"instagram": {
"url": "https://<your-project>.vercel.app/mcp"
}
}
}Example Multi-Account Prompts
# Target specific accounts
Use ig_post to publish an image with image_url="https://..." and account="brand_official", dry_run=false.
# Use default active account
Use ig_account_insights to view performance for the last 28 days.
# List all accounts
Use ig_list_accounts to show connected Instagram accounts and token status.
# Switch active default
Use ig_set_active_account to set "my_creator_page" as default.Disclaimer
Uses official Meta Instagram Graph API v26.0 endpoints. Respects Meta rate limits and Terms of Service.
This server cannot be deployed
Maintenance
Related MCP Connectors
Instagram for AI agents: publish, read comments and DMs, insights, and engage from your account.
Publish and schedule Instagram posts, Reels and carousels from your AI assistant.
Create, review, publish and schedule Instagram images, carousels and Reels with AI assistants.
- ZoosialOAuthcom.zoosial
Social media API for AI agents: publish, DMs, comments, Meta ads and leads.
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceEnables AI agents to publish images and Reels to an Instagram Business account through the Meta Graph API, with tools for uploading media, creating and publishing containers, managing comments, and retrieving insights.MIT
- FlicenseNot gradedqualityAmaintenanceEnables AI applications to interact with Instagram Business accounts through Meta's Graph API, including profile retrieval, media publishing, insights, comments, conversations, and direct messaging.-
- FlicenseNot gradedqualityAmaintenanceEnables AI applications to interact with Instagram Business accounts through Instagram's Graph API, supporting profile and media retrieval, insights, publishing, and direct message operations.-
- FlicenseNot gradedqualityAmaintenanceEnables AI applications to interact with Instagram Business accounts through Instagram's Graph API, including retrieving profile, media, and insights data, publishing content, and managing direct message conversations.-