Skip to main content

Overview

The Gemini CLI is Google’s open-source command-line agent. It connects to MCP servers defined in its settings and discovers OAuth on a remote server on its own.

Prerequisites

  • A StackOne project you are a member of.
  • A connector profile in the project for each provider the client should reach, with the actions you want exposed enabled.
  • (Optional) A linked account for each provider. Accounts can also be linked during the consent flow.

Setup

1

Add the server to Gemini

Or add it to ~/.gemini/settings.json under mcpServers by hand:
2

Approve the browser prompt

Run gemini. The CLI discovers that StackOne uses OAuth and opens your browser. If it does not, authenticate from inside the session:
Sign in, pick the project and the linked accounts the connector should reach, then Authorize.
3

Verify

Run /mcp to list connected servers and their tools.
To change which accounts or actions the CLI can reach, re-run the flow with /mcp auth stackone. To revoke it, use Connected Apps in the StackOne dashboard.
A session token URL carries its own credential, so it covers the cases OAuth can’t: a shared server, a scheduled job, or anywhere nobody is present to approve a consent screen.Generate one from Connectors, open a connector, then Use in Agent. Pick a linked account, set the expiry (one year by default), and copy the URL:
One URL covers one linked account, and anyone holding it has that access until it expires, so treat it like a password. See Choosing a connection method for the comparison with OAuth.There is no consent screen to set Advanced Tool Search on, so add the tool-mode query parameter instead:
Put the token URL in httpUrl:
For API-key auth instead, see Authentication & Security.
Confirm the latest config format in the Gemini CLI MCP docs.

Optimize and secure

With your agent connected, use StackOne’s platform features to optimize performance and secure every call.

Advanced Tool Search

Reduce context and save tokens.

Deep Query

Search synced records for a fraction of the tokens.

Defender

Block prompt injections before they reach your agent.