Connect your agent · Gemini CLI

Give Gemini CLI an inbox it can use safely.

Gemini CLI can work with a separate Connect mailbox through remote MCP. Add the server from your terminal, authorize the mailbox in your browser, and keep your regular email account out of scope.

For terminal-first developers building with Gemini CLI who need a dedicated address for incoming tasks, test messages, or customer follow-up.

Set it up

Register the HTTP server from Gemini CLI

Gemini CLI adds this endpoint to user-level settings and authenticates in a browser.

  1. Create a Connect mailbox

    Set up a mailbox for your Gemini agent. Use contacts and review rules to decide who can reach it and which outgoing messages need a human decision.

  2. Add the user-level MCP server

    Run gemini mcp add --transport http --scope user stacksona-connect https://connect.stacksona.com/mcp. Gemini CLI stores this server in your user settings.

  3. Authenticate in the CLI

    Open Gemini CLI and use /mcp to select Stacksona Connect and authenticate. The OAuth browser flow returns authorization to the local CLI callback.

  4. Verify what Gemini can do

    Use gemini mcp list to check server status, then ask Gemini to call connect_check_connection and report scopes only. Review tools before letting it access message content.

Add a user-level HTTP MCP server

Run the command in the Gemini CLI environment that will authenticate and use the mailbox.

gemini mcp add --transport http --scope user stacksona-connect https://connect.stacksona.com/mcp
Works for local terminal sessions

Put a boundary between Gmail and Gemini.

The mailbox created in Connect is the address Gemini uses. Gemini does not sign into your personal Gmail account; the MCP connection grants access to the independent mailbox and only the scopes you select.

Know your runtime environment

Browserless shells need a separate tested path.

Gemini CLI's browser-based OAuth works naturally in a local interactive terminal. SSH sessions, containers, or headless environments may not be able to complete the callback the same way, so validate that environment before depending on it.

Check the terminal callback before relying on headless use.

Gemini CLI’s user-scope server setting is stored separately from Gmail. OAuth returns through a local browser callback, so confirm that the terminal process can receive it before relying on a headless or remote shell.

Gemini CLI talks to Connect with the agent mailbox grant, separate from your Google personal inbox.

Compare the available integration paths
Questions people ask about Gemini CLI

Gemini CLI connection details

What command connects Gemini CLI?

Run `gemini mcp add --transport http --scope user stacksona-connect https://connect.stacksona.com/mcp`, then authenticate from `/mcp`.

Does this use my Gmail inbox?

No. Gemini connects to a separate mailbox managed by Stacksona Connect. Your personal Gmail account is not authorized by this MCP setup.

Can I use it over SSH or in a container?

Possibly, but the browser callback must return to the Gemini CLI process. Test the exact terminal environment before relying on headless authentication.

Stacksona Connect

Give Gemini CLI a distinct email address

Create the mailbox, register the HTTP server, then authenticate in the terminal where Gemini will run.

Create an agent mailbox