> ## Documentation Index
> Fetch the complete documentation index at: https://docs.emailagent.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# MCP Overview

EmailAgent exposes MCP in two modes:

* `stdio` server (local process)
* hosted streamable HTTP endpoint at `https://app.emailagent.dev/mcp`

## Install (stdio)

```bash theme={null}
npm install -g emailagent-mcp-server
EMAILAGENT_API_KEY=<api_key> emailagent-mcp
```

## Hosted endpoint

* URL: `https://app.emailagent.dev/mcp`
* Auth: `Authorization: Bearer <emailagent_api_key>`

Important: use the app domain endpoint above. Do not use the docs domain for MCP calls.

## Tool surface

| Namespace | Tools                                                                    |
| --------- | ------------------------------------------------------------------------ |
| Inboxes   | `inboxes_list`, `inboxes_create`, `inboxes_update`, `inboxes_delete`     |
| Emails    | `emails_send`, `emails_list`, `emails_mark_read`, `emails_delete`        |
| Domains   | `domains_list`, `domains_create`, `domains_verify`, `domains_delete`     |
| API Keys  | `api_keys_list`, `api_keys_create`, `api_keys_rotate`, `api_keys_revoke` |
| Metrics   | `metrics_get`                                                            |

Each tool returns a normalized payload:

```json theme={null}
{
  "ok": true,
  "data": {},
  "requestId": "req_..."
}
```

Errors return:

```json theme={null}
{
  "ok": false,
  "error": {
    "type": "forbidden",
    "status": 403,
    "message": "...",
    "requestId": "req_...",
    "retriable": false
  }
}
```
