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

# MCP server

> Run @drin00/mcp to give any MCP-compatible agent 54 email tools — send, receive, manage domains and inboxes, read metrics — with a single API key.

The Drin MCP server (`@drin00/mcp`) exposes the whole API as 54 tools over the Model Context Protocol. Any MCP client — Claude Desktop, Claude Code, Cursor — can send and receive email, manage domains and inboxes, and read metrics with a single API key.

## Run it

The server speaks MCP over stdio. It needs one environment variable, `DRIN_API_KEY`:

```bash Run @drin00/mcp theme={null}
DRIN_API_KEY=drin_xxx npx -y @drin00/mcp
```

| Variable        | Required          | Purpose                                                                                      |
| --------------- | ----------------- | -------------------------------------------------------------------------------------------- |
| `DRIN_API_KEY`  | Yes               | Your API key — the Bearer credential.                                                        |
| `DRIN_SENDER`   | Account-wide keys | Default project `externalId` (the `X-Drin-Product` value). Omit it for a project-scoped key. |
| `DRIN_BASE_URL` | No                | Override the API origin. Defaults to `https://api.drin.run`.                                 |

<Note>
  **Already using the CLI?** It bundles the same server — `npx @drin00/cli mcp` is equivalent to running `@drin00/mcp` directly. See the [CLI guide](/agents/cli).
</Note>

## Add it to a client

Drop the config below into your client, restart it, and the agent can call tools like `send_email`, `list_threads`, and `reply_email`.

<CodeGroup>
  ```json Claude Desktop theme={null}
  {
    "mcpServers": {
      "drin": {
        "command": "npx",
        "args": ["-y", "@drin00/mcp"],
        "env": { "DRIN_API_KEY": "drin_xxx" }
      }
    }
  }
  ```

  ```json Cursor theme={null}
  {
    "mcpServers": {
      "drin": {
        "command": "npx",
        "args": ["-y", "@drin00/mcp"],
        "env": { "DRIN_API_KEY": "drin_xxx" }
      }
    }
  }
  ```

  ```bash Claude Code theme={null}
  claude mcp add drin -e DRIN_API_KEY=drin_xxx -- npx -y @drin00/mcp
  ```
</CodeGroup>

For Claude Desktop the block goes in `claude_desktop_config.json` (Settings → Developer → Edit Config). For Cursor it's `~/.cursor/mcp.json` (or `.cursor/mcp.json` in a project). Windsurf and VS Code take the same `mcpServers` block — VS Code keys it under `servers` in `.vscode/mcp.json`.

## What the agent can do

The 54 tools cover every surface of the API:

| Group             | Tools | Examples                                                               |
| ----------------- | ----- | ---------------------------------------------------------------------- |
| Sending           | 3     | `send_email`, `send_batch`, `reply_email`                              |
| Reading messages  | 4     | `list_emails`, `get_email`, `get_email_body`, `list_email_attachments` |
| Domains           | 7     | `add_domain`, `verify_domain`, `set_domain_receiving`, `delete_domain` |
| Inboxes & threads | 7     | `create_inbox`, `list_threads`, `get_thread`, `simulate_inbound`       |
| Contacts          | 7     | `create_contact`, `unsubscribe_contact`, `resubscribe_contact`         |
| Templates         | 8     | `create_template`, `render_template`, `list_template_gallery`          |
| Suppressions      | 3     | `list_suppressions`, `add_suppression`, `remove_suppression`           |
| Webhooks          | 5     | `create_webhook`, `update_webhook`, `delete_webhook`                   |
| API keys          | 3     | `list_api_keys`, `create_api_key`, `revoke_api_key`                    |
| Metrics & account | 2     | `get_metrics`, `list_account_messages`                                 |
| Integrations      | 5     | `install_integration`, `list_integrations`, `uninstall_integration`    |

Addresses accept `"Name <email>"` or a bare `"email"`; recipient fields accept a string or an array of strings. Show-once secrets (new API keys, webhook signing secrets) are returned only on the create call — persist them immediately.

<Warning>
  **The key is the agent's authority.** The MCP server acts with the full authority of the API key you give it. Scope the key to a single project where you can, and prefer a key with only the access the agent actually needs. Keys are shown once on creation — store them in your client's `env`, never in source.
</Warning>

<Card title="Prefer a CLI?" icon="terminal" href="/agents/cli">
  Every tool is also a command — `npx @drin00/cli send … --json`.
</Card>
