MCP (streamable HTTP) via MCPServerAdapter · Instagram

Run a CrewAI crew that prepares Instagram posts for approval

CrewAI lets you split Instagram work the way a small team would: a researcher finds the angle, a writer drafts the caption, a publisher uploads images and creates the post. With SocialHandoff as the publisher's MCP server, the crew never holds Instagram credentials and never publishes on its own. Instagram requires media on every post, so the publisher calls attach_media for each image, and the approval inbox becomes the editor at the end.

Prompt

Crew goal: announce our new recipe collection on Instagram. Researcher: pick the 3 recipes most searched this month from the analytics export. Writer: a caption under 800 characters with 6 hashtags. Publisher: upload the 3 recipe photos with alt text and create one carousel draft.

How to do it

  1. Connect Instagram and mint a key In https://app.socialhandoff.com, open Connections, connect an Instagram professional account (Business or Creator). Then create an agent key named CrewAI scoped to Instagram with draft and schedule permission.
  2. Load the tools Connect with MCPServerAdapter using transport streamable-http, pointing at https://app.socialhandoff.com/mcp and sending the key as a bearer header. The agent gets attach_media, draft_post, schedule_post, and preview_posts.
  3. Attach media The agent calls attach_media through the MCP adapter with a public url (or base64 data up to 8 MB) and alt text for the JPEG image, Reel, or carousel (up to 10 items). From plain code, POST https://app.socialhandoff.com/v1/media/import does the same. Pass the ids to draft_post in mediaIds.
  4. Run the agent Kick off the crew with the goal. The publisher agent is the only one given the MCP tools, including attach_media.

Example draft

Our autumn recipe collection is here, starting with the three you searched for most:

1. One-pan harissa chicken
2. Pumpkin and sage risotto
3. Apple crumble bars you can make the night before

All 20 recipes are free on the site. Link in bio.

#autumnrecipes #easydinners #homecooking #onepan #baking #recipes

[Carousel: 3 JPEG recipe photos, alt text on each]

Gotchas

  • Instagram refuses text-only posts. A draft can be saved as text first, but approving or scheduling it is refused with a clear error until an image or video is attached.
  • Close the MCPServerAdapter when the crew finishes, or use it as a context manager, so the HTTP session does not linger between runs.
  • Images must be JPEG (up to 8 MB). A PNG screenshot is not accepted, so convert it before upload.
Instagram
  • Account type: Professional accounts only (Business or Creator). Personal accounts cannot publish through the API.
  • Media: Every post needs an image or video. Text-only posts are not possible on Instagram.
  • Image files: JPEG only, up to 8 MB. Convert PNG or WebP before posting.
  • Reels: Video posts publish as Reels, from MP4 or MOV files.
Schedule Instagram posts and Reels your agents draft

Frequently asked questions

Can I post a carousel to Instagram this way?
Yes. Attach 2 to 10 images or videos and the post publishes as a carousel. Single images take alt text; set it when you upload with the alt field.
Which crew member should hold the key?
Give the tools to one publisher agent. Researchers and writers pass it text; only the publisher calls draft_post, which keeps the audit log readable.
What happens if I hit Instagram's daily limit?
The daily publishing quota is checked before each post. If it is full, the post is deferred by an hour instead of failing.

Let your agents post. Keep the final say.

Connect your first agent in minutes. Every draft waits in your inbox until you approve it.

14 days free. No card required.

The hosted version is opening soon

Leave your email and we will send one message when hosted accounts open, with your 14-day trial ready. Want it today? Self-host it free from the repo.

Start free trial