Gemini CLI + Mastodon

Post to Mastodon from Gemini CLI

Connect Gemini CLI to PostDelegate once, then ask it for Mastodon posts from Google’s Gemini CLI in your terminal. Ask for a draft and it waits on your calendar until you schedule it.

Gemini CLI drafts it. You approve it. PostDelegate posts it.Mastodon: Posts and threads on mastodon.social, with images or a video.

How to post to Mastodon from Gemini CLI

  1. Add PostDelegate to Gemini CLI. Add the server to ~/.gemini/settings.json as below. Sign in with PostDelegate when Gemini CLI prompts you.

    ~/.gemini/settings.json

    {
      "mcpServers": {
        "postdelegate": {
          "url": "https://app.postdelegate.com/mcp-oauth-dynamic"
        }
      }
    }
  2. Connect Mastodon in PostDelegate. On the calendar page choose Add Channel, then Mastodon. Sign in to your mastodon.social account and approve the permissions PostDelegate asks for: reading your profile, publishing posts and uploading media.
  3. Ask Gemini CLI for a draft. Describe the post in plain words. Gemini CLI checks your Mastodon channel's rules, creates the post and sends back a preview link.

Teach Gemini CLI the posting rules

Save PostDelegate’s AGENTS.md in your repository and point to it from your GEMINI.md, so Gemini CLI follows the posting rules there. Agent files has the steps.

What to ask Gemini CLI

Mention any Mastodon setting in plain words and Gemini CLI fills it in. Gemini CLI can also read text files in your project, such as a changelog or a draft in Markdown.

  • Draft a Mastodon post about our open-source release, under 500 characters, with two relevant hashtags.
  • Which Mastodon posts do I have scheduled next week? Move nothing, just list them.
  • Summarise the README’s “Why” section as a Mastodon thread and save it as a draft.

What Gemini CLI can do on your Mastodon channel

  • Check the rules first. Before writing, it reads your Mastodon channel's length limit (500 characters) and required settings.
  • Draft, schedule or post. It creates a draft, a scheduled post or an immediate post, and runs the same checks as the app.
  • Use your media. It attaches files from your media library or adds one from a public link.
  • Review and fix. It lists what is scheduled, changes the Mastodon settings of a post that has not gone out, and deletes posts you no longer want.

A Mastodon post is up to 500 characters with up to four images or one video. PostDelegate keeps the text and media together with the planned post, publishes it as a public post at the time you pick, and turns extra entries into a thread of replies.

Before you start

  • PostDelegate connects accounts on mastodon.social. Accounts on other Mastodon servers cannot be connected yet.
  • Posts are published as public posts, limited to 500 characters with up to four images or one video.

The Mastodon channel guide has every field, and MCP tools lists exactly what an assistant can and cannot do.

Questions

Will Gemini CLI publish to Mastodon without asking me?
Not unless you ask it to. Ask for a draft and the post waits on your calendar until you schedule it, and your workspace's approvals apply as usual. Tools that change data are marked as such, so Gemini CLI can ask you before it schedules or deletes anything.
Do I need an API key to connect Gemini CLI?
No. Gemini CLI signs in with your PostDelegate account through your browser. An API key is only for clients that cannot sign in, as described in MCP clients.
Does it cost extra to use Gemini CLI with PostDelegate?
No. The MCP server is on every plan, and Gemini CLI runs on your own Gemini CLI account, so PostDelegate never charges for AI. Every plan starts with a 7-day free trial with no card.
Can Gemini CLI attach images or video to a Mastodon post?
It can use files already in your media library, or add one from a public link. It cannot fetch files from your computer, so upload those in the app first. See MCP tools.
Can I connect an account on another Mastodon server?
Not yet. PostDelegate connects accounts on mastodon.social. Accounts on other Mastodon servers cannot be connected today.
Can I schedule a Mastodon thread?
Yes. Add more entries to the post with Add post in a thread, and they are published as replies to the first post.

Mastodon from other assistants

Other networks from Gemini CLI

Prefer to plan Mastodon posts yourself? See the Mastodon scheduler.

Try it for 7 days

Your next great post starts here.

Give your ideas a home. Plan your content, find your rhythm, and bring your social channels together.

Start your 7-day free trial

No credit card required

Add a card before the trial ends to keep your plan.