# Mails.ai — Agent Email MCP server

> A real inbox for AI agents: send, receive and thread email, behind a prompt-injection firewall.

- Repository: —
- Page: https://hostedmcp.org/servers/mails/agent-email
- Transport: stdio, remote
- Stars: 0
- Latest version: 0.5.0

## Install

### Claude Code

```sh
claude mcp add --env 'MAILS_API_KEY=<YOUR_MAILS_API_KEY>' agent-email -- npx -y @mailsai/mcp-server
```

### Cursor (`~/.cursor/mcp.json`)

```json
{
  "mcpServers": {
    "agent-email": {
      "command": "npx",
      "args": [
        "-y",
        "@mailsai/mcp-server"
      ],
      "env": {
        "MAILS_API_KEY": "<YOUR_MAILS_API_KEY>"
      }
    }
  }
}
```

### VS Code (`.vscode/mcp.json`)

```json
{
  "servers": {
    "agent-email": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "@mailsai/mcp-server"
      ],
      "env": {
        "MAILS_API_KEY": "<YOUR_MAILS_API_KEY>"
      }
    }
  }
}
```

### VS Code CLI

```sh
code --add-mcp '{"name":"agent-email","type":"stdio","command":"npx","args":["-y","@mailsai/mcp-server"],"env":{"MAILS_API_KEY":"<YOUR_MAILS_API_KEY>"}}'
```

### Claude Desktop (`claude_desktop_config.json`)

```json
{
  "mcpServers": {
    "agent-email": {
      "command": "npx",
      "args": [
        "-y",
        "@mailsai/mcp-server"
      ],
      "env": {
        "MAILS_API_KEY": "<YOUR_MAILS_API_KEY>"
      }
    }
  }
}
```

### Codex

```sh
codex mcp add agent-email --env 'MAILS_API_KEY=<YOUR_MAILS_API_KEY>' -- npx -y @mailsai/mcp-server
```

### Codex config.toml (`~/.codex/config.toml`)

```toml
[mcp_servers.agent-email]
command = "npx"
args = ["-y", "@mailsai/mcp-server"]

[mcp_servers.agent-email.env]
MAILS_API_KEY = "<YOUR_MAILS_API_KEY>"
```

### Gemini CLI

```sh
gemini mcp add -s user -e 'MAILS_API_KEY=<YOUR_MAILS_API_KEY>' agent-email npx -- -y @mailsai/mcp-server
```

### Gemini settings.json (`~/.gemini/settings.json`)

```json
{
  "mcpServers": {
    "agent-email": {
      "command": "npx",
      "args": [
        "-y",
        "@mailsai/mcp-server"
      ],
      "env": {
        "MAILS_API_KEY": "<YOUR_MAILS_API_KEY>"
      }
    }
  }
}
```

## Environment variables

| Name | Required | Secret | Description |
|---|---|---|---|
| `MAILS_API_KEY` | yes | yes | Your mails.ai API key. Use an mk_test_ key to run against the sandbox or an mk_live_ key to send real mail. Free key at https://mails.ai |
| `MAILS_BASE_URL` | no | no | Override the API base URL. Defaults to the hosted mails.ai API; only needed for staging or self-hosted deployments. |
