How to do it
- Mint a Gemini CLI key In https://app.socialhandoff.com, open Connections and add an agent named Gemini CLI. Keep it draft-only and limit its networks.
- Choose the settings file Use ~/.gemini/settings.json for all projects, or .gemini/settings.json in a project folder for just that project.
- Add the mcpServers entry Paste the block below. Gemini CLI uses httpUrl for streamable HTTP servers and url for SSE, so use httpUrl here.
- Verify with /mcp Start gemini and run /mcp. The server should be connected with its tools and descriptions listed.
- Ask for drafts Ask Gemini for a post and approve it in the SocialHandoff inbox.
{
"mcpServers": {
"social": {
"httpUrl": "https://app.socialhandoff.com/mcp",
"headers": {
"Authorization": "Bearer YOUR_AGENT_KEY"
},
"timeout": 30000
}
}
} Using Gemini CLI for posts
Gemini CLI is a terminal agent with a large context window, which helps when the source for a post is big: a long changelog, a full RFC, or a transcript. Paste or reference the file with @path/to/file, then ask for drafts. Gemini calls draft_post for each network and can call preview_posts to check lengths before it reports back.
Prompts that work
- "@CHANGELOG.md Draft an X thread and a LinkedIn post about the 3 biggest changes. Use brand memory for tone. Do not schedule."
- "Plan next week on Mastodon and Bluesky: one post a day about the tutorials in @docs/guides."
- "List pending drafts for LinkedIn and summarize which ones I should approve first."
- "Get insights for the last 30 days and suggest one change to my voice rules. Do not apply it."
That last prompt uses get_insights. Best-time and engagement comparisons are labeled as heuristics, so treat them as hints.
Trust settings
Gemini CLI asks before running MCP tools unless the server is marked trust: true in settings. Leave trust off for SocialHandoff; the confirmation prompt is cheap, and it pairs well with the approval inbox. You can also limit which tools Gemini sees with includeTools or excludeTools in the server entry, for example excluding update_brand_memory (which an agent key cannot call anyway).
Keeping the key safe
Gemini CLI can read values from environment variables in settings.json. Put the key in your shell environment and reference it rather than pasting it, especially in a project-level .gemini/settings.json that could be committed. Recent versions also offer a gemini mcp add command that writes the entry for you with a transport and header flag.
Troubleshooting
- Server shows disconnected: the key is
httpUrl, noturl. Withurl, Gemini tries SSE. - Timeouts: raise
timeoutin milliseconds;plan_weekdoes more work than a single draft. - 401: check the header and that the key is active in Connections.
- Tools missing after edit: restart the CLI; settings are read at start.
Walkthroughs by network: Gemini CLI for X, Gemini CLI for LinkedIn, Gemini CLI for Bluesky, Gemini CLI for Mastodon, and Gemini CLI for Threads.