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