Post to Instagram from Gemini CLI via MCP

Attach PostWharf's MCP server to Gemini CLI once, then publish or schedule Instagram feed posts, reels and carousels by asking for them — and get a receipt saying what actually landed.

Connect it

One command, or an httpUrl entry in ~/.gemini/settings.json, and the tools load in every Gemini CLI session. One workspace key scopes every call to a single brand, so Gemini CLI can only ever reach the accounts in that workspace — not every account you run.

gemini mcp add --scope user --transport http \
  --header "Authorization: Bearer $POSTWHARF_KEY" \
  wharf https://mcp.postwharf.com/mcp

Ask for an Instagram post

Once the server is attached the ask is a prompt in the terminal, not a form — in a Gemini CLI session started in the folder that holds the notes or the release you are announcing:

"Draft three caption options for this reel and queue the best one for Tuesday at 11am."

Gemini CLI finds your connected Instagram channel, checks the text against the 2,200-character ceiling before anything is queued, and hands back the queued time. Nothing publishes because a model decided it should.

Gemini CLI asks before each tool call unless the server is marked as trusted. Leave trust off, and if the prompts get tiresome, allow the read-only tools one at a time rather than the whole server: create_post publishes the moment it runs.

What Instagram accepts

Character limit2,200
Counted onthe caption
Formatsfeed posts, reels and carousels

Requires a Business or Creator account linked to a Facebook Page. Personal accounts cannot be posted to programmatically by any tool.

What comes back

Every post carries a delivery receipt per channel: the state, the live URL once it is out, and the platform's own reason if it failed. Deliveries are re-checked after publishing, so an Instagram post removed later stops reporting as live instead of sitting in your history as a success. Ask Gemini CLI for the status and it reads that receipt back rather than guessing.

Questions

Can Gemini CLI post to Instagram automatically?

Yes. Connect the PostWharf MCP server to Gemini CLI and it can publish or schedule to a connected Instagram channel, then read the delivery receipt back. The workspace key limits it to the accounts in one workspace, and you keep the approval step.

What do I need before Instagram will work?

Requires a Business or Creator account linked to a Facebook Page. Personal accounts cannot be posted to programmatically by any tool. Once the channel is connected in PostWharf, Gemini CLI reaches it the same way it reaches every other network.

How long can a Instagram post be?

2,200 characters, counted on the caption. PostWharf checks that before the post is queued, so an over-length post is refused immediately rather than failing at Instagram after everything else in the same batch has already published.