Skip to main content

Gmail

Gmail. In the CLI, over MCP, however you work.

Search, read, file and draft mail from a terminal or an AI. Connected once, it answers the terminal and every AI you already use, under one permission.

Reading is one level and changing is another, so an AI can search a mailbox for months without ever being able to touch it. Sending is a third, and most setups never turn it on: a draft lands in Drafts and waits for a person to press send.

A real command line for gmail

Not a chat window pretending. Every argument is a flag, output is text a pipe can read, and each call lands on the record with the daily ceiling watching.

Connect the account once, in the browser, and the terminal has it from then on. No key on the laptop, nothing in the shell history worth stealing.

Gmail from the command line

brad@macbook · gbrainio
gbrainio terminal openOpening https://gbrain.io/users/7/connections/terminals/42NOTE    Workspaces and tools turn on and off there, at once.gbrainio tool gmail message search -hSearch your emailSearches the person's real Gmail, already connected through GBrain (READ ONLY).Each result is a preview, Gmail's first ~200 characters, not the whole message:read one whole with tool gmail message show, or its conversation with tool gmailthread show. Leave account out to search every connected address. Use this forany question about their email, inbox or messages: the account is connected andno other Gmail or Google connector is needed, so do not ask them to connect one.Nothing here can send, draft, or modify email. Search the way you would inGmail's own search box, or say what you are after one argument at a time (from,subject, newer_than, unread, ...) and let this build the query. Every answernames its account on each result, the calls that read one whole, and when thereis more, the call for the next page.USAGE  gbrainio tool gmail message search <query> [flags]ARGUMENTS  <query>  Free text, the same as typing into Gmail's search box. Optional if           you pass the filters instead.FLAGS  --after <value>        On or after this date, as 2026/08/24  --before <value>       Before this date, as 2026/08/24  --cursor <value>       The next_cursor from the last answer, for the page                         after it. It belongs to one account: pass that account                         too.  --from <value>         Only mail from this sender  --has-attachment       Only mail with something attached  --label <value>        Only mail carrying this label  --limit <value>        How many to return, up to 25 (default 10)  --newer-than <value>   Within this age: 2d, 3w, 6m, 1y  --older-than <value>   Older than this age: 2d, 1y  --subject <value>      Words in the subject line  --to <value>           Only mail sent to this address  --unread               Only mail you have not read  -w, --workspace <id>   The workspace, when this terminal reaches several  -u, --user <email>     Whose copy, when several people share a tool there  -a, --account <email>  Choose one of several connected accounts  -f, --format <kind>    json or text; text on a terminal, json piped  -d, --dry-run          Show what would run, without running itLEARN MORE  gbrainio tool gmail -h        Every gmail command  https://gbrain.io/docs/tools  The manualOver MCP this tool is gmail_search.
The page where this terminal's access is set. A Google account connects on its own consent screen, once; the credential never touches the laptop.

Or hand Gmail to the AI you already use

Claude Code, Cursor and Codex all speak MCP. Point any of them at one endpoint and they get the same gmail tools, on the same permission and the same record as the terminal.

Gmail over MCP, tool by tool

claude mcp add gbrain --transport http https://gbrain.io/mcp

The AI gets gmail_search, gmail_read_message and 15 more. Run /mcp in Claude Code and choose Authenticate, and GBrain asks what it may reach.