# Use MailHawk abilities with an assistant or automation

Published 2026-11-07. Last updated 2026-11-24.

Want an assistant to check your site’s sending health or help investigate a held email? MailHawk registers 20 tools with the WordPress Abilities API, which is part of WordPress 6.9 and later. On older versions of WordPress they are not registered.

Registering abilities does not connect an assistant or give it anonymous access. You need an authenticated connection, such as the official MCP Adapter plugin described below. Groundhogg is not required for MailHawk’s abilities.

## Connecting an AI assistant

The official [MCP Adapter](https://wordpress.org/plugins/mcp-adapter/) plugin from WordPress turns the abilities on your site into tools that any MCP client can use, such as Claude Desktop, Claude Code, Cursor or VS Code. It needs WordPress 6.9 or later and PHP 7.4 or later. Its source and full documentation are on [GitHub](https://github.com/WordPress/mcp-adapter).

### 1. Install the MCP Adapter

Go to **Plugins > Add New**, search for **MCP Adapter**, then install and activate it. With WP-CLI, run:

```
wp plugin install mcp-adapter --activate
```

There is nothing to turn on in MailHawk. Its abilities are marked public, so the adapter’s default server offers them straight away through three tools: **mcp-adapter-discover-abilities** lists them, **mcp-adapter-get-ability-info** describes one, and **mcp-adapter-execute-ability** runs one.

### 2. Choose the user the assistant acts as

Every request from the assistant runs as a WordPress user, and MailHawk’s abilities only run for a user with **manage_options**, which administrators have. The MCP Adapter’s own guide suggests a lower-privileged user such as an Editor; that works for other plugins, but MailHawk’s abilities will refuse it. We recommend a separate administrator account for the assistant, so you can tell its changes apart and take its access away without affecting anyone else.

### 3. Connect your assistant

**For a site on the internet**, connect over HTTPS with an Application Password:

1. Sign in as the assistant’s user and go to **Users > Profile**. Under **Application Passwords**, enter a name such as “AI assistant” and click **Add New Application Password**. Copy the password; it is only shown once.
2. Open your MCP client’s configuration. In Claude Desktop that is **Settings > Developer > Edit Config**; in Cursor it is `~/.cursor/mcp.json`.
3. Add the server below with your own site address, username and Application Password, then save the file and restart the app. It runs a small proxy with `npx`, so Node.js has to be installed on your computer.

```
{
  "mcpServers": {
    "mailhawk": {
      "command": "npx",
      "args": ["-y", "@automattic/mcp-wordpress-remote@latest"],
      "env": {
        "WP_API_URL": "https://example.com/wp-json/mcp/mcp-adapter-default-server",
        "WP_API_USERNAME": "your-username",
        "WP_API_PASSWORD": "xxxx xxxx xxxx xxxx xxxx xxxx"
      }
    }
  }
}
```

Claude Code can connect over HTTP without the proxy. Encode your username and Application Password with `printf 'your-username:xxxx xxxx xxxx xxxx xxxx xxxx' | base64`, then add the server with the result:

```
claude mcp add --transport http mailhawk https://example.com/wp-json/mcp/mcp-adapter-default-server --header "Authorization: Basic PASTE_THE_ENCODED_VALUE_HERE"
```

If your site uses plain permalinks, the server address is `https://example.com/?rest_route=/mcp/mcp-adapter-default-server` instead.

**For a site on your own computer or one you reach over SSH**, the client can start the server with WP-CLI instead. No Application Password is needed; `--user` sets which user the assistant acts as:

```
{
  "mcpServers": {
    "mailhawk": {
      "command": "wp",
      "args": [
        "--path=/path/to/your/wordpress/site",
        "mcp-adapter",
        "serve",
        "--server=mcp-adapter-default-server",
        "--user=your-username"
      ]
    }
  }
}
```

### 4. Check the connection

Ask the assistant “Check MailHawk’s status.” If it works, you will get the same picture as the MailHawk Overview screen. If it does not:

- **The assistant gets a 401 error:** the username or Application Password is wrong, or your server is dropping the Authorization header, which some Apache setups do. Your host can tell you which.
- **No MailHawk abilities are listed:** check that the site runs WordPress 6.9 or later and that MailHawk is active.
- **MailHawk abilities are listed but refuse to run:** the user is not an administrator. See step 2.

To disconnect the assistant, revoke its Application Password under **Users > Profile**, or remove the server from your MCP client.

## Example prompts

Ask in plain words; the assistant picks the abilities. Most of these only read. The ones marked **(acts)** send email or change something, so check what the assistant plans to do before you let it go ahead.

### Check sending health

- “Is email from this site healthy? Tell me anything that needs attention.”
- “How many emails did we send in the last 7 days, and how does that compare with the week before?”
- “How much of our monthly sending allowance is left?”

### Set up a sending domain

- “Which of our domains are not authenticated yet, and which DNS records do they still need?”
- “Add shop.example.com and give me the records to add at my DNS host.” **(acts)**
- “I added the records. Check whether shop.example.com is verified now.”

### Find out what happened to an email

- “Did the order confirmation to jane@example.com go out yesterday? If it failed, why?”
- “List every email that bounced in the last 7 days.”
- “Send me a test email to check delivery.” **(acts)**

### Review held emails and recipients

- “What is held for review, and which emails will be deleted soonest?”
- “Why would an email to bob@example.com be held?”
- “Release held email 123 and trust the people it goes to.” **(acts)**

### Check or change settings

- “What is our default From address, and how long do we keep the email log?”
- “Change the default From name to Example Store.” **(acts)**

## Start safely

1. Confirm MailHawk is active on a WordPress 6.9 or later site and its service connection is ready.
2. Connect your assistant as described above, or with another integration using its own authentication instructions.
3. Use a WordPress account with the appropriate permissions. MailHawk’s abilities require **manage_options** through their permission callback.
4. Ask the assistant to inspect status or reports first, without sending or changing anything.
5. Review proposed recipients, message IDs and settings before authorizing actions that send mail or change data.

Ask for message bodies only when necessary; they can contain private information.

The public registration metadata is not an anonymous permission grant. Keep integration access narrow and revoke it through that integration when it is no longer needed.

## Which abilities only read and which act

Every ability is marked with whether it only reads, and whether it does something that can not be taken back. Many assistants and MCP clients use these marks to decide when to ask you before running a tool.

- **Read only:** get-status, get-reports, list-domains, get-domain-dns, list-emails, get-email, get-quarantine-report, list-recipients, assess-recipient-risk and get-settings. They send nothing and change nothing.
- **Change something, safe to repeat:** add-domain, check-domain-dns, trust-recipient and update-settings.
- **Destructive:** delete-domain, send-test-email, retry-email, release-email, reject-email and remove-recipient. They send email or delete or forget something, and running one twice can send twice.

## Status and reporting abilities

- **mailhawk/get-status** — optional **refresh** boolean, default false. Returns connection/setup information, usage, domain state, sending health, held count and issue codes. When the account is suspended, **suspension** gives the reason MailHawk gave, when it happened, whether it covers only this site or the whole account, and the account page where a person signs in to see what to do next. Refresh recalculates cached sending health; it does not repair a connection or prove a webhook subscription is correct.
- **mailhawk/get-reports** — optional **range**: today, 7, 14 or 30; default 7. Returns the selected range, preceding comparison range, changes, chart series and usage. Today means the last 24 hours. Unavailable complaint data is null, not a verified zero.

## Domain abilities

- **mailhawk/list-domains** — no input fields. Returns the account’s domains and authentication state.
- **mailhawk/add-domain** — required **domain**, such as example.com; a www in front is dropped. Registers it with the account and returns its information and DNS data; an existing registration is not a new domain. Free providers like gmail.com are refused.
- **mailhawk/get-domain-dns** — required **domain**. Returns the DKIM TXT, Return-Path CNAME and SPF TXT records, and a DMARC TXT record when MailHawk checks DMARC for the domain, each with its value and verification state. DMARC is marked **recommended**: a domain is authenticated without it, but some providers, Apple in particular, turn away mail from domains that have none. If the domain already has an SPF or DMARC record, that record is returned instead. Each record has a **host** (what goes in the Name field, relative to the domain, with @ for the domain itself) and a full **hostname**; for a subdomain whose records go in its parent domain’s DNS, the subdomain is included in host. It does not edit your DNS provider.
- **mailhawk/check-domain-dns** — required **domain**. Requests a fresh DNS verification, like Verify in the admin.
- **mailhawk/delete-domain** — required **domain** and matching **confirm**. Removes an account-level domain, affecting other connected sites using it. The default From domain is protected by the ability. Only do this after reviewing the exact domain and account-wide impact.

Use [the DNS guide](https://mailhawk.io/documentation/configure-dns/) to interpret relative names and subdomain zones correctly, and [Add a DMARC record](https://mailhawk.io/documentation/add-a-dmarc-record/) for choosing a DMARC policy. Getting a record is not the same as publishing it.

## Email abilities

- **mailhawk/list-emails** — optional **status**, **recipient**, **subject**, **after**, **before**, **order**, **limit** and **offset**. Status values are sent, delivered, failed, bounced, softfail, complained and quarantine. Recipient/subject filters match contained text; dates use the site’s time zone. Order is desc or asc; limit defaults to 20 and allows 1–100; offset defaults to zero. Returns summaries, total and pagination, without message bodies. Each entry lists the abilities that can act on it.
- **mailhawk/get-email** — required positive **id**; optional **include_body**, default false. Returns details and headers; the body is included only when requested and may be shortened. Check **body_truncated** before assuming you received the whole message.
- **mailhawk/send-test-email** — optional **to**, defaulting to the current user’s address. Sends fixed test content and returns acceptance/held information and a log ID when available. It is not an arbitrary-message composer. A sent result is acceptance, not guaranteed inbox delivery.
- **mailhawk/retry-email** — required positive **id**. Attempts another send from the retained log. It can create a duplicate and refuses held mail or recipients who would currently require quarantine review. Do not use it to bypass a complaint or resend a delayed message without investigating first.

The API’s **softfail** means Delayed in the interface; **complained** means Reported as spam.

## Quarantine abilities

- **mailhawk/get-quarantine-report** — optional **expiring_days** (1–365, default 7) and **limit** (1–50, default 5). Returns waiting/expiring counts, retention and the listed held entries closest to expiry, plus recipient counts. The item list is not the entire queue.
- **mailhawk/release-email** — required positive **id**; optional **trust_recipients**, default false. Attempts sending a held message. The result distinguishes trusted and not_trusted addresses. Known complainants are not granted trust, and service suppression can still prevent delivery.
- **mailhawk/reject-email** — required positive **id**; optional **unsubscribe_contacts**, default false. Deletes a held entry; the optional unsubscribe behavior concerns Groundhogg contacts. Check Groundhogg availability rather than assuming the flag updates another CRM.

Release and reject are real actions. Do not automatically approve a queue just because a report lists it.

## Recipient abilities

- **mailhawk/list-recipients** — optional **status** (trusted, watching or blocked), **search**, **limit** (1–200, default 50) and **offset** (default zero). Returns remembered records, total and pagination, not every address ever emailed. The API’s blocked status corresponds to Reported spam in the admin.
- **mailhawk/assess-recipient-risk** — required **email**. Returns the current risk, threshold, held decision, contributing factors and remembered record if present. It sends nothing.
- **mailhawk/trust-recipient** — required **email**. Trusts an eligible address; rejects a known complainant. A later hard bounce can withdraw trust.
- **mailhawk/remove-recipient** — required **email**. Forgets an eligible local trust/bounce record and returns whether one was removed. It refuses spam-complaint records. This is not a CRM deletion, unsubscribe or service-suppression removal.

## Settings abilities

- **mailhawk/get-settings** — no input fields. Returns sender defaults, logging, retention and retry settings. API keys and license tokens are not returned.
- **mailhawk/update-settings** — at least one supported field: **from_name**, **from_email**, **email_logging_enabled**, **log_retention_days**, **retry_failed_emails** or **failed_email_retries**. The ability accepts retention from 1–365 days and retries from 1–10; these are ability-schema limits. It returns current settings and the changed-field list. Use an authenticated From domain and check it with list-domains first. This ability rejects free-provider addresses, but does not itself verify the new domain’s SPF/DKIM state. Shortening retention can cause deletion at cleanup.

The settings ability does not expose or change connection secrets, the uninstall-delete switch or Network Sender Domain.

## Handle errors and missing data

Use the ability’s returned error and schema, not a guessed endpoint. A missing log entry may have expired; a missing recipient table requires the database update; a connection error is not a zero-result report. Most abilities return a not_connected or suspended error until the site is connected and the account is in good standing; get-status still answers and says why. List operations are paginated, so do not assume the first page is complete.

Do not automatically repeat sends, releases or deletions after an uncertain response. Inspect current state first. Ask a developer about **mailhawk/abilities/enabled** if these abilities should not be registered on the site.
