# B2B Email Deliverability & DNS Security Audit (MCP) (`the_magic_dragon/b2b-email-deliverability-mcp`) Actor

Audit MX providers, true recursive RFC 7208 SPF lookups (10-lookup PermError ceiling), DKIM selectors, DMARC policy/alignment, MTA-STS, TLS-RPT, and BIMI with 0-100 deliverability scores and copy-paste DNS remediations. MCP-ready.

- **URL**: https://apify.com/the_magic_dragon/b2b-email-deliverability-mcp.md
- **Developed by:** [Cade Hockley](https://apify.com/the_magic_dragon) (community)
- **Categories:** AI, Developer tools, Lead generation
- **Features:** Limited permissions
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$4.00 / 1,000 domain auditeds

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## B2B Email Deliverability & DNS Security Audit (MCP)

Audit B2B sending domains for **MX mail providers**, **true recursive RFC 7208 SPF lookups** (10-lookup `PermError` ceiling + cycle detection), **DKIM selectors**, **DMARC policy & alignment**, **MTA-STS**, **TLS-RPT**, and **BIMI** with copy-paste DNS remediation snippets and a `0-100` deliverability score.

Built for **Apify Pay-per-Event** (`$0.004` per valid domain audited = `US$4.00 / 1,000 domains`; malformed/empty domains are not charged) and designed for **MCP / AI Agents**, **n8n**, and **Clay** workflows.

### Key Features

- **True Recursive RFC 7208 SPF Resolver:** Recursively follows `include:` and `redirect=` chains up to depth 12 with loop/cycle detection to expose hidden `>10` DNS lookup `PermError` failures and multiple SPF record conflicts.
- **Provider & Selector Intelligence:** Identifies Google Workspace, Microsoft 365, Proofpoint, Mimecast, Cloudflare, SendGrid, AWS SES, and other B2B ESPs; probes custom and common DKIM selectors concurrently and flags revoked/empty `p=` keys.
- **Full Transport & Brand Stack:** Checks `_dmarc.<domain>`, `_mta-sts.<domain>`, `_smtp._tls.<domain>`, and `default._bimi.<domain>`.
- **Concise MCP Mode (`conciseMcpMode: true`):** Caps verbose selector/tree payloads so AI agents stay comfortably within LLM context budgets.
- **Resilient Batch Execution:** Processes up to 500 domains concurrently (`concurrency: 1..20`); malformed/non-existent domains produce structured error records without crashing batch runs.

### Example Input

```json
{
  "domains": ["google.com", "bonfire.com.au"],
  "dkimSelectors": ["s1", "k1"],
  "followSpfIncludes": true,
  "conciseMcpMode": true,
  "concurrency": 10
}
```

### Example Output Item

```json
{
  "domain": "google.com",
  "status": "OK",
  "overallScore": 85,
  "rating": "EXCELLENT",
  "mailProviders": ["Google Workspace"],
  "mx": {
    "status": "PASS",
    "recordCount": 1,
    "records": [{ "priority": 10, "host": "smtp.google.com" }]
  },
  "spf": {
    "status": "PASS",
    "lookupCount": 4,
    "maxAllowedLookups": 10,
    "exceedsTenLookups": false,
    "allQualifier": "~all"
  },
  "dmarc": {
    "status": "PASS",
    "policy": "reject",
    "rua": "mailto:mailauth-reports@google.com"
  },
  "messageLevelLimits": [
    "DNS checks verify published records only; they cannot confirm live DKIM MIME header alignment or cryptographic validity on outbound messages."
  ]
}
```

### MCP Configuration (`mcp.apify.com`)

Connect this Actor in Claude Desktop, Cursor, or any MCP client using Apify's hosted MCP server after publishing to Apify Store:

```json
{
  "mcpServers": {
    "apify": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-remote",
        "https://mcp.apify.com/?actors=the_magic_dragon/b2b-email-deliverability-mcp",
        "--header",
        "Authorization: Bearer ${APIFY_TOKEN}"
      ]
    }
  }
}
```

### n8n & Clay Integration

- **Clay:** Add an **HTTP API** or **Apify Run Actor** enrichment column targeting `the_magic_dragon~b2b-email-deliverability-mcp` with `{"domains": ["{{Company Domain}}"], "conciseMcpMode": true}`.
- **n8n:** Use the official **Apify** node (`Run an Actor and get dataset items`) to gate outbound CRM sequences on `overallScore >= 65` and `spf.exceedsTenLookups == false`.

### Message-Level Verification Limits

DNS inspection confirms **published DNS records only**. It does **not** send or inspect live RFC 5322 email messages, cannot verify live DKIM cryptographic header alignment on outbound mail streams, and cannot measure sender IP reputation, bounce rates, or spam complaint rates.

# Actor input Schema

## `domains` (type: `array`):

List of up to 500 domain names (or URLs) to audit for email deliverability and DNS authentication.

## `dkimSelectors` (type: `array`):

Optional list of additional DKIM selector names to probe before common provider selectors (e.g. 's1', 'k1', 'hs1').

## `followSpfIncludes` (type: `boolean`):

Recursively resolve SPF include: and redirect= chains (up to depth 12 with cycle detection) to compute true RFC 7208 DNS lookup count.

## `conciseMcpMode` (type: `boolean`):

Trim verbose DNS payloads and unfound selector lists to stay lightweight inside LLM / MCP context windows.

## `concurrency` (type: `integer`):

Maximum number of domains audited concurrently (1-20).

## Actor input object example

```json
{
  "domains": [
    "google.com",
    "bonfire.com.au"
  ],
  "dkimSelectors": [],
  "followSpfIncludes": true,
  "conciseMcpMode": true,
  "concurrency": 10
}
```

# Actor output Schema

## `results` (type: `string`):

Structured per-domain MX, recursive SPF, DKIM, DMARC, MTA-STS, TLS-RPT, BIMI, score, and remediation records.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "domains": [
        "google.com",
        "bonfire.com.au"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("the_magic_dragon/b2b-email-deliverability-mcp").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = { "domains": [
        "google.com",
        "bonfire.com.au",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("the_magic_dragon/b2b-email-deliverability-mcp").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "domains": [
    "google.com",
    "bonfire.com.au"
  ]
}' |
apify call the_magic_dragon/b2b-email-deliverability-mcp --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,the_magic_dragon/b2b-email-deliverability-mcp"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/ThSC6Rh6b5bhcbbwN/builds/LFv3MG4rQkINjLpmn/openapi.json
