# LinkedIn MCP for Gemini: connect LinkedIn and X to Gemini, Gemini CLI and Antigravity

To connect LinkedIn and X to Gemini, add Flaghand's MCP server, `https://app.flaghand.com/mcp`, and sign in: in the Gemini app under
**Settings › Connected Apps**, in Antigravity CLI's `mcp_config.json`, or in Gemini CLI with Flaghand's extension.
Gemini can then draft LinkedIn and X posts and send them to you for approval. You approve each exact post with your
passkey, and Flaghand posts it.

Checked on October 28, 2026, against Google's Gemini and Antigravity docs and Flaghand's setup docs, linked under
[Sources](#sources). Since June 18, 2026, Gemini CLI serves only Gemini Code Assist Standard and Enterprise licences and
paid API keys; free and Google AI Pro and Ultra users have moved to Antigravity CLI.

## Your Flaghand account and sign-in

Every route below ends at Flaghand's sign-in page: sign in with your passkey, Google or email and click **Allow** (pick
the workspace first if you have more than one). No account yet? In the Gemini app, add the connector first,
then use the sign-up link on Flaghand's sign-in page, **Start your free trial**, to create one with a passkey, Google
or email, without a card. Return and click **Allow**. For a CLI, you can also [start here](/schedule), or ask your agent to follow
[Flaghand's setup guide](https://app.flaghand.com/docs/setup.md).

In Flaghand, connect your LinkedIn profile and X account under **Settings › Account**. Each network shows its own
sign-in; Flaghand never asks for your LinkedIn password or browser cookies. Gemini holds a token with four scopes,
`read`, `drafts`, `media` and `request-approval`, and none of them can approve, schedule or post.

## In the Gemini app

1. On a computer, open [gemini.google.com](https://gemini.google.com), then **Settings › Connected Apps**.
2. Under **Custom apps**, enter `https://app.flaghand.com/mcp`, click **Next** and sign in to Flaghand. Flaghand supports automatic
   client registration, so skip **Show more**: there are no credentials to enter.
3. In a prompt, type **@**, pick Flaghand and try:

   > Draft a LinkedIn post about what I learned at this week's conference, and send it to me for approval.

Google offers custom apps to people 18 or over in the US, signed in with a personal Google Account, in English, with
**Keep Activity** on. Add the app on the web; it then works in the Gemini mobile app too.

## In Antigravity CLI

Add Flaghand to `~/.gemini/config/mcp_config.json` (every project) or `.agents/mcp_config.json` (one project).
Antigravity uses `serverUrl`, not Gemini CLI's `httpUrl`:

```json
{
  "mcpServers": {
    "flaghand": { "serverUrl": "https://app.flaghand.com/mcp" }
  }
}
```

Run `agy`, open `/mcp`, and authenticate Flaghand. Sign in on Flaghand's page in your browser, then paste the
authorization code back if Antigravity asks for it.

## In Gemini CLI

With a Code Assist Standard or Enterprise licence, or a paid API key, install Flaghand's extension:

```sh
gemini extensions install https://github.com/flaghand/flaghand
```

Restart Gemini CLI, run `/mcp auth flaghand` and sign in. Without the extension, add this to `~/.gemini/settings.json`:

```json
{
  "mcpServers": {
    "flaghand": { "httpUrl": "https://app.flaghand.com/mcp", "oauth": { "enabled": true } }
  }
}
```

## Approve the post

Gemini writes the post, Flaghand checks it against LinkedIn's rules, and Gemini gives you an approval link. Open it on
your phone or computer, look at the post as LinkedIn will show it, and approve with Face ID, Touch ID or a security
key. Nothing posts until you do.

## What Gemini can and can't do through Flaghand

| | LinkedIn | X (Twitter) |
|---|---|---|
| Draft | Posts on your personal profile, up to 3,000 characters, with up to 20 photos, one video, one PDF document or a link card | Posts and threads of 2 to 25 posts, with up to 4 photos or one video on each |
| Check | Length, media, company-page tags and the posting time | X's own character count, media, replies and the posting time |
| Approve, schedule or post | No. Only you, with your passkey | No. Only you, with your passkey |
| After posting | The post's link. LinkedIn doesn't let Flaghand read the post back | Flaghand reads the post back and compares it with what you approved |

Flaghand posts to LinkedIn only through LinkedIn's official API and only to your personal profile. It doesn't read
profiles, your feed, messages or jobs.

## Questions

**Is there an X (Twitter) MCP for Gemini?** The same server drafts X posts and threads. One approval can cover a whole
plan, such as an X thread and a LinkedIn post together.

**Can Gemini post without my approval?** No. Approving takes your passkey, and no Flaghand token can approve, schedule
or post. The server checks your signed approval again right before it posts.

**Which one should I use?** The Gemini app if you write posts in chat; Antigravity CLI or Gemini CLI if you want posts
drafted from a project's files or git history.

**How do I take Gemini's access away?** In Flaghand, open **Settings › Agents** and click **Revoke**. It stops working
at once.

## Other apps

The same server works in [Claude](/docs/guides/connect-linkedin-and-x-to-claude),
[ChatGPT](/docs/guides/connect-linkedin-and-x-to-chatgpt), [Claude Code](/docs/guides/connect-linkedin-and-x-to-claude-code),
[Codex](/docs/guides/connect-linkedin-and-x-to-codex) and [Cursor](/docs/guides/connect-linkedin-and-x-to-cursor).
[The LinkedIn MCP server](/linkedin-mcp-server) explains what Flaghand does on LinkedIn;
[the X MCP server](/x-mcp-server) and [the X API and MCP servers, compared](/docs/guides/x-api-and-mcp-servers-for-ai-agents) covers X, and
[Flaghand compared](/compare) sets it beside other schedulers and posting APIs.

## Sources

All read on October 28, 2026.

- Google: [custom apps in Gemini Apps](https://support.google.com/gemini/answer/17209137?hl=en),
  [Gemini CLI moves to Antigravity CLI](https://developers.googleblog.com/an-important-update-transitioning-gemini-cli-to-antigravity-cli),
  [Antigravity MCP](https://antigravity.google/docs/mcp/), [migrating from Gemini CLI](https://antigravity.google/docs/cli/gcli-migration/),
  [Gemini CLI MCP servers](https://geminicli.com/docs/tools/mcp-server/), [Gemini CLI extensions](https://geminicli.com/docs/extensions/)
- Flaghand: [set up and connect](https://app.flaghand.com/docs/setup), [agents: Gemini](https://app.flaghand.com/docs/agents#gemini-cli),
  [Flaghand's Gemini extension](https://github.com/flaghand/flaghand)

Gemini and Antigravity are trademarks of Google. LinkedIn and X are trademarks of their owners. Flaghand isn't
affiliated with or endorsed by them.

[All guides](/docs/guides.md)
