# Groundmail MCP server in Google Antigravity

Connect Google Antigravity's agent to the Groundmail MCP server, and it can send email, check delivery, add and verify sending domains, and manage templates, webhooks and suppressions while it builds your app. Add one entry to `mcp_config.json` and sign in with your Groundmail account; there's no API key to paste.

**Server URL:** `https://mcp.groundmail.dev/mcp` (Streamable HTTP, OAuth) · All clients and the full tool list: [MCP server](https://docs.groundmail.dev/ai/mcp)

---

## 1. Add the server

Groundmail isn't in the MCP Store, so add it as a custom server:

1. In the editor's agent side panel, click **…** and choose **MCP Servers**.
2. Click **Manage MCP Servers**, then **View raw config**.
3. Add Groundmail to `mcp_config.json`:

```json
{
  "mcpServers": {
    "groundmail": {
      "serverUrl": "https://mcp.groundmail.dev/mcp"
    }
  }
}
```

The global file is `~/.gemini/config/mcp_config.json` and applies to every project. To add Groundmail to one project only, use `.agents/mcp_config.json` in that workspace.

In the Antigravity app, the same list is under **Settings → Customizations → Installed MCP Servers** (click refresh after editing the file). In the CLI, use `/mcp`.

## 2. Sign in

Antigravity handles the OAuth sign-in for servers that support dynamic client registration, which Groundmail does, so you don't need an `oauth` block or a client ID. When the server connects, your browser opens on Groundmail: sign in, choose what the agent may do (full access, or less: **Send only**, **Read only** or a custom set of [scopes](https://docs.groundmail.dev/api-keys)) and approve.

The connection is listed under **Settings → CLIs & agents** in Groundmail, where you can revoke it.

## 3. Use it

Ask the agent, for example:

- *"List my Groundmail domains and tell me which aren't verified."*
- *"Add a password reset email to this app with the groundmail SDK, and send me a test."*
- *"Send a test email from noreply@mail.groundmail.dev to me and tell me if it was delivered."*

Your app still needs its own `GROUNDMAIL_API_KEY` at runtime to send mail: the MCP connection is for the agent, not your deployed code. See [Node.js](https://docs.groundmail.dev/frameworks/node).

---

## Use an API key instead

For a machine where nobody can sign in in a browser, pass a key in a header. Create one at [app.groundmail.dev/api-keys](https://app.groundmail.dev/api-keys); a [scoped key](https://docs.groundmail.dev/api-keys) limits what the agent can do.

```json
{
  "mcpServers": {
    "groundmail": {
      "serverUrl": "https://mcp.groundmail.dev/mcp",
      "headers": {
        "Authorization": "Bearer gm_your_key_here"
      }
    }
  }
}
```

Keep a workspace `mcp_config.json` with a key out of git.

## Run it locally (stdio)

```json
{
  "mcpServers": {
    "groundmail": {
      "command": "npx",
      "args": ["-y", "groundmail-mcp"],
      "env": {
        "GROUNDMAIL_API_KEY": "gm_your_key_here"
      }
    }
  }
}
```

---

## Troubleshooting

| Problem | Fix |
|---------|-----|
| The server doesn't appear | Check the JSON is valid and uses `mcpServers`, then refresh the server list. |
| It fails to connect | Use the full URL with `/mcp`. Antigravity needs Streamable HTTP; don't use `httpUrl` or an SSE URL. |
| `insufficient_scope` from a tool | The connection or key doesn't have that scope. Reconnect and grant it, or use a key with the scope. |
| Sends to other people are refused | Test sends go to your own account email. Sending to anyone else needs a verified domain: see [Test sends and idempotency](https://docs.groundmail.dev/ai/safe-defaults). |

Other editors: [GitHub Copilot (VS Code)](https://docs.groundmail.dev/ai/mcp-github-copilot) · [Zed](https://docs.groundmail.dev/ai/mcp-zed) · [Warp](https://docs.groundmail.dev/ai/mcp-warp) · [Cursor, Claude Code, Codex, Windsurf](https://docs.groundmail.dev/ai/mcp)
