# Give Gemini CLI its own email address

Gemini CLI can have its own email address, such as `ada@botmail.pro`. Paste
one prompt to claim a Botmail mailbox, run
`gemini mcp add --scope user --transport http botmail https://botmail.pro/mcp`,
and sign in with `/mcp auth botmail`. Gemini can then read, send, reply to
and wait for email from its own address.

## Why Gemini CLI needs its own address

Gemini CLI works in your terminal and can run for a long time on a task. An
inbox lets it reach you and other people when you aren't watching:

- **Send results.** "Profile the slow endpoint and email me the top three
  causes" leaves the answer in your inbox.
- **Answer threads.** It can read the reply from a vendor about your API
  access and respond in the same conversation.
- **Get verification codes.** It can sign up for a service you approve and
  wait for the code. See
  [verification emails](https://botmail.pro/guides/ai-agent-verification-emails).
- **Draft first.** It writes an email as a draft and hands you a review link.

## 1. Claim a mailbox

Paste this into Gemini CLI:

```text
Read https://botmail.pro/skill.md and claim a mailbox for yourself. Send the invite to my email, then wait for me to approve it.
```

Gemini reads the instructions, solves a small proof-of-work challenge with a
shell command and claims an address; confirm the commands when it asks. It
asks for your email if it doesn't know it. Open the email from Botmail, sign
in with GitHub or Google and accept. Unapproved mailboxes are deleted after
24 hours.

## 2. Add Botmail to Gemini CLI

From your terminal:

```sh
gemini mcp add --scope user --transport http botmail https://botmail.pro/mcp
```

`--scope user` saves it to `~/.gemini/settings.json` for every project. The
default scope is `project`, which writes `.gemini/settings.json` in the
current folder.

To edit `settings.json` yourself, use `httpUrl`. In Gemini CLI, `url` means a
legacy SSE endpoint, and `httpUrl` means streamable HTTP, which is what
Botmail speaks:

```json
{
  "mcpServers": {
    "botmail": { "httpUrl": "https://botmail.pro/mcp" }
  }
}
```

### Sign in

Start `gemini`. When Botmail answers the first connection with 401, Gemini
discovers the sign-in endpoints, registers itself and opens your browser. To
start it yourself, or to sign in again later:

```text
/mcp auth botmail
```

`/mcp auth` on its own lists servers that need sign-in. Gemini stores the
tokens in `~/.gemini/mcp-oauth-tokens.json` and refreshes them.

Gemini checks the `iss` value the sign-in page returns, as RFC 9207
requires. Botmail sends it, so there's nothing to configure.

Browser sign-in needs a local browser and a callback to `localhost`, so it
doesn't work over plain SSH or in a container. Use an API key there.

### Use an API key instead

Pass the key your agent saved when it claimed the mailbox as a header:

```sh
gemini mcp add --scope user --transport http \
  --header "Authorization: Bearer $BOTMAIL_KEY" \
  botmail https://botmail.pro/mcp
```

Your shell fills in `$BOTMAIL_KEY`, so the key is saved as plain text in
`settings.json`. Use user scope, and don't put a key in a project
`.gemini/settings.json` that you commit.

### Keep tool confirmations on

By default Gemini asks you to confirm each MCP tool call. Leave it that way
for Botmail: don't add `--trust`, which skips every confirmation, including
for `send_email`.

## 3. Approve access

Botmail's page asks you to sign in with GitHub or Google, then shows:

- **Permissions:** Read mail, Send mail and Manage (mailboxes, keys, webhooks
  and settings).
- **Mailboxes:** all of them, including ones you create later, or only the
  ones you tick.

Press Allow and go back to the terminal. You can revoke access at any time.

## Prompts to try

```text
Profile the /search endpoint, find the three biggest causes of latency, and email a short report to you@example.com.
```

```text
Read the latest message from Acme support in your Botmail inbox and draft a reply asking when our API access will be enabled. Give me the review link.
```

```text
Sign up for the Acme developer portal with your Botmail address, then use wait_for_mail to catch the verification email and finish.
```

```text
Search your mail for the invoice from Hetzner last month and tell me the total.
```

Ask for drafts the first time Gemini writes to someone. Mail to new
recipients is checked for spam and phishing, and new accounts can email 25
new recipients a day.

## Optional: install Botmail as a skill

Gemini CLI loads user skills from `~/.gemini/skills/` or `~/.agents/skills/`.
Botmail's [skill.md](https://botmail.pro/skill.md) starts with skill front matter, so it
installs as-is:

```sh
mkdir -p ~/.gemini/skills/botmail
curl -s https://botmail.pro/skill.md -o ~/.gemini/skills/botmail/SKILL.md
```

When Gemini decides to use the skill, it asks for your consent first.

## Troubleshooting

- **"MCP issues detected. Run /mcp list for status."** Gemini hides MCP
  errors at startup; `/mcp list` shows them.
- **Check from your shell.** `gemini mcp list` shows each server as Connected
  or Disconnected.
- **botmail won't connect.** If you edited `settings.json` by hand, check
  that it says `httpUrl`, not `url`.
- **Token expired or wrong account.** Run `/mcp auth botmail` again.
- **Turned it off by accident.** `gemini mcp enable botmail`.

Other clients are covered in [Email MCP server](https://botmail.pro/guides/email-mcp-server). New
to Botmail? Read [Email for AI agents](https://botmail.pro/ai-agent-email).

## Questions

### How do I add a remote MCP server to Gemini CLI?

Run gemini mcp add --scope user --transport http botmail https://botmail.pro/mcp, or add it under mcpServers in ~/.gemini/settings.json with httpUrl set to the server URL.

### What is the difference between url and httpUrl in Gemini CLI?

In Gemini CLI's settings.json, url is for legacy SSE endpoints and httpUrl is for streamable HTTP. Botmail uses streamable HTTP, so use httpUrl.

### How do I sign in to an OAuth MCP server in Gemini CLI?

Gemini opens the browser automatically on the first connection, or you can run /mcp auth botmail. Sign-in needs a local browser, so over SSH use an API key header instead.

---

Source: https://botmail.pro/guides/gemini-cli-email
Agent instructions: https://botmail.pro/skill.md
All guides: https://botmail.pro/llms.txt
