Skip to main content
Glama

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

ig-write

Zero-dependency Python CLI (stdlib only). Post / reel / story / carousel / delete / like

ig-mcp-server.py

MCP stdio server wrapping ig-write — 11 tools for agentic mode (Claude Code, Cursor, …)

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 scopes
  • For MCP mode: pip install -r requirements.txt

Related MCP server: Instagram Complete MCP Server

Scopes

Action

Scope

post / reel / story / carousel

instagram_business_content_publish

like / unlike

instagram_manage_engagement (Apr 2026 Like API)

delete

instagram_manage_contents (Dec 2025 Delete API)

ig-write me + ig-write <cmd> surface a clear re-auth hint when a scope is missing. Notes has no official Meta API and is intentionally not included.

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=FINISHEDmedia_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.txt

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

Layout

Instagram_agent_mcp/
├── ig-write           # CLI (stdlib only, executable)
├── ig-mcp-server.py   # MCP server (needs: pip install mcp)
├── requirements.txt
├── README.md
└── LICENSE

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.

Related MCP Connectors

Related MCP Servers

  • A
    license
    Not graded
    quality
    D
    maintenance
    Enables AI applications to interact with Instagram Business accounts through the Graph API, supporting profile management, media publishing, insights retrieval, and direct messaging capabilities.
    MIT
  • F
    license
    Not graded
    quality
    D
    maintenance
    Enables 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.
    -
  • A
    license
    A
    quality
    D
    maintenance
    Enables AI assistants to manage Instagram and Threads accounts — publish content, handle comments, view insights, search hashtags, and manage DMs through the Meta Graph API.
    59
    19 npm
    12
    MIT