MCP (streamable HTTP) · Threads

Draft and schedule Threads posts from Gemini CLI

Gemini CLI is handy for batch jobs: point it at a folder of notes and ask for posts. With SocialHandoff connected, it can draft a Threads post from a meeting note or a product update without leaving the terminal. Each draft stays under 500 characters and joins the approval inbox, so a batch of drafts is reviewed one card at a time. Text, images, video, and carousels of up to 20 items are supported, and drafts stay in the inbox until a person approves.

Prompt

Read notes/2026-09-community-call.md and write one Threads post recapping our community call for people who missed it. Three highlights, one line each, and say the recording is on our YouTube channel. Under 450 characters.

How to do it

  1. Mint a Threads agent key In https://app.socialhandoff.com, open Connections, connect your Threads account, then create an agent key scoped to Threads with draft permission only. Copy the key when it is shown; only its hash is stored.
  2. Edit settings.json In ~/.gemini/settings.json, add an mcpServers entry with httpUrl set to https://app.socialhandoff.com/mcp and a headers object carrying the Threads key as a bearer token.
  3. Check the connection Start gemini and run /mcp. The server should be listed as connected with its tools.
  4. Draft from the terminal Ask Gemini CLI to read the release notes or git log and draft a Threads post. It calls draft_post and the post appears in your approval inbox.

Example draft

Missed our September community call? Three highlights:

The plugin API is stable as of this month, so what you build now will keep working.
Offline mode is in testing, and we are looking for volunteers.
Next call moves to a time that works better for Asia and Australia.

The full recording is up on our YouTube channel.

Gotchas

  • A draft too long for one post can go out as a reply-chain thread, with each part published as a reply to the one before. Every part has its own 500-character limit, and a carousel of 2 to 20 images or videos can lead the chain.
  • Threads allows 250 posts per account in any 24 hours. The quota is checked before each publish, so a post that would go over it is stopped before it is sent rather than failing at the network.
  • Threads fetches images and video from your instance at signed, expiring URLs, so you do not need a separate public media host. The API itself must be reachable over public HTTPS; an instance that only runs on localhost cannot publish media to Threads.
  • Gemini CLI reads settings.json at startup. If /mcp shows the server as disconnected, check the httpUrl and that the bearer header uses the Threads key.
Threads
  • Character limit: 500 characters per post. Emoji count as their UTF-8 bytes, so an emoji can use up to 4 characters of the limit.
  • Links: Up to 5 links per post. Threads generates a preview for the first one.
  • Carousels: 2 to 20 images or videos in one carousel post.
  • Image files: JPEG or PNG, up to 8 MB. Threads fetches each file from a URL at publish time.
Threads scheduler for agent drafts you approve first

Frequently asked questions

Can Gemini CLI run this non-interactively?
Yes. Pass a prompt to gemini in non-interactive mode from a script. The result is still only a draft, so an unattended run cannot publish.
Can Gemini CLI attach a screenshot to a Threads post?
Yes. Upload the image and SocialHandoff serves it to Threads at a signed, expiring URL, with alt text if you add it. The instance must be reachable over public HTTPS so Threads can fetch the file.
Can I post videos to Threads?
Yes. Threads takes a single video, or mixes videos and images in a carousel of 2 to 20 items. SocialHandoff serves the file at a signed URL, so the only requirement is that your API is reachable over public HTTPS.

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