# Add an email MCP server to Gemini CLI

> Add the Trotta Mail MCP server to Gemini CLI with one command, then sign in or pass an API key. The tools Gemini CLI gets and the mail it never sees.

Source: https://trotta.email/integrations/gemini-cli

Give Gemini CLI an inbox of its own with one command: gemini mcp add --transport http trotta https://api.trotta.email/mcp. Then run /mcp auth trotta inside Gemini CLI and sign in with Trotta Mail, or pass an API key. Every message Gemini CLI reads was screened before delivery.

Updated November 20, 2026

## What Gemini CLI can do with the inbox

Once the server is added, Gemini CLI can receive, read and send mail as tools, with no local server to install. The [MCP docs](https://trotta.email/docs/mcp) list every tool.

| Tool | What it does |
| --- | --- |
| `list_inboxes` | Lists the inboxes the key can reach. |
| `wait_for_message` | Waits for the next delivered message, with filters such as `has_code`. |
| `read_message` | Reads one message in the safe view. |
| `read_attachment_text` | Reads the text inside a PDF, Word, Excel, PowerPoint or OpenDocument file, instructions taken out. |
| `send_message` | Sends a new message. Screened before it leaves. |
| `reply_to_message` | Replies in the thread. |
| `scan_content` | Runs any content through the guard and returns the verdict. |

## Set up Trotta Mail in Gemini CLI

Gemini CLI connects to `https://api.trotta.email/mcp` over HTTP. Use the URL exactly as written, with no slash at the end. You sign in with your Trotta Mail account, or you pass an API key in a header.

### Sign in with Trotta Mail

1. Add the server.
2. In Gemini CLI, run `/mcp auth trotta` and sign in with Trotta Mail.
3. Pick the inboxes Gemini CLI may use, and whether it may read, send or both. Then allow.

Step 1: add the server:

```bash
gemini mcp add --transport http trotta https://api.trotta.email/mcp
```

### Use an API key

1. Put your key in the `TROTTA_MAIL_API_KEY` environment variable. Your shell fills it in when the command runs.
2. Add the server with your key.

Add the server with your key:

```bash
gemini mcp add --transport http --header "Authorization: Bearer $TROTTA_MAIL_API_KEY" trotta https://api.trotta.email/mcp
```

For a key, create an agent inbox and a key in the console, or see the [quickstart](https://trotta.email/docs). These steps follow the [Gemini CLI docs](https://github.com/google-gemini/gemini-cli/blob/main/docs/tools/mcp-server.md), checked on 2026-11-20.

## What Gemini CLI sees and what it never sees

Gemini CLI sees the safe view of a message. Text hidden from a human is removed, an instruction aimed at a model is replaced by a note, and links that are not clean are defanged. Text read from an attachment has instructions taken out too: see [hidden instructions in attachments](https://trotta.email/threats/hidden-instructions-in-attachments).

Gemini CLI never sees held mail. It can learn that a message is held and why, and a human decides whether to release it. In a human's own mailbox, login codes, password resets and sign-in links are sealed. In an inbox of its own, the codes Gemini CLI asked for are its to read.

A human's everyday mailbox was built for a human reader, and a real-looking message can reach it with an instruction a terminal agent might follow. A Trotta Mail inbox screens each message before it is accepted. No filter catches everything, so uncertain mail waits for a human.

## Three things to try

- List my Trotta Mail inboxes and tell me what is new in each.
- Wait for the next email to riley@trotta.email that has a code, then print the code.
- Read the spreadsheet attached to the latest message from Northwind and total the amounts.

## Troubleshooting

- **The server answers 401.** The request carried no token, or one that is not good. Run `/mcp auth trotta` again, or check that the header reads `Authorization: Bearer` followed by your key.
- **`wait_for_message` returns nothing.** It times out after up to 60 seconds, so call it again. It never returns held mail: check `list_held`.
- **Writing to a new address answers `403 recipient_not_allowed`.** An agent that signed itself up can reply to senders whose mail arrived authenticated, and cannot write to new outside addresses until a human claims it. A human opens its `claim_url`.

## Questions

### Does Trotta Mail for Gemini CLI work on the Free plan?

Yes. The Free plan is $0 with 2 inboxes and 1,000 emails a month. MCP and every check are on every plan.

### Does Gemini CLI need anything installed to use Trotta Mail?

No. Trotta Mail is a remote MCP server at https://api.trotta.email/mcp, so there is no local server to install. One gemini mcp add command adds it.

### Should Gemini CLI sign in or use an API key?

Sign in when a human is at the terminal: there is no key to paste, and you pick the inboxes. Use an API key when Gemini CLI runs unattended.

### Is Trotta Mail a Google product?

No. Trotta Mail is an independent product that works with Gemini CLI as a remote MCP server. It is not made or endorsed by Google.

## Sources

- [Gemini CLI docs: MCP servers](https://github.com/google-gemini/gemini-cli/blob/main/docs/tools/mcp-server.md)
- [Trotta Mail guide for agents (llms.txt)](https://api.trotta.email/llms.txt)

## Related

- [Connect ChatGPT and Claude](https://trotta.email/docs/connect) Docs
- [MCP](https://trotta.email/docs/mcp) Docs
- [An email MCP server for any MCP client](https://trotta.email/integrations/mcp) Integrations
- [MCP email server](https://trotta.email/learn/mcp-email-server) Guides
- [Give Claude Code an email inbox over MCP](https://trotta.email/integrations/claude-code) Integrations
- [Hidden instructions in attachments](https://trotta.email/threats/hidden-instructions-in-attachments) Threat library

Give your agent an inbox of its own. One call, or one minute in the console.

[Get an inbox](https://trotta.email/signup) [Read the docs](https://trotta.email/docs)
