DEV Community

Verifly Team
Verifly Team

Posted on

Adding Real-Time Email Verification to AI Agents with MCP

Disclosure: I work on the Verifly team (verifly.email). New accounts start with 100 free credits, pricing is pay-as-you-go, and risky or unknown results do not use a credit.

An AI agent that qualifies leads or onboards users often treats the first email it sees as a usable contact. The address may have come from a form, a CRM export, or a line of text the model extracted from a page. Typos, shut-down domains, and throwaway inboxes are common in those sources. If the agent stores the address or sends to it, a hard bounce can hurt the sending domain, and a disposable inbox can vanish before anyone follows up.

A regex only tests the shape of the string. An MX lookup only tests whether the domain publishes mail exchangers. Neither confirms that the mailbox exists, and neither flags a disposable domain that accepts mail today and disappears tomorrow. Catch-all domains make this worse: the server accepts every local part, so a mailbox probe can look successful even when no person will read the message. Verify the address in the same turn the agent first decides to trust it, and branch on a structured verdict instead of a single boolean.

Connect the hosted MCP server

Verifly publishes a hosted MCP server at https://verifly.email/mcp over Streamable HTTP. Point an MCP client at that URL and send your API key as a bearer token. No local install is required. In a Cursor or similar mcpServers config (this snippet matches the live /mcp page):

{
  "mcpServers": {
    "verifly": {
      "url": "https://verifly.email/mcp",
      "headers": {
        "Authorization": "Bearer vf_your_api_key"
      }
    }
  }
}
Enter fullscreen mode Exit fullscreen mode

For a local stdio process, the same site documents npx -y verifly-mcp-server with VERIFLY_API_KEY in the process environment. Keep the key out of prompts, logs, and tool arguments.

New accounts start with 100 free credits and no card. An agent can also mint a key through the register_account tool, which returns 100 usable trial credits with no inbox confirmation. Save the vf_ key when it is shown; it is not displayed again.

Call verify_email when you first trust an address

The tool for a single address is verify_email. It takes one required argument, email, and maps to GET /api/v1/verify?email=. Call it the moment the agent is about to store, send to, or qualify an address.

A hosted tools/call looks like this:

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "verify_email",
    "arguments": {
      "email": "lead@example.com"
    }
  }
}
Enter fullscreen mode Exit fullscreen mode

The result is a JSON object with email (normalized), is_valid, result, reason, recommendation, a details block of boolean flags, credits_charged, and remaining credits. The result enum is deliverable, undeliverable, risky, or unknown. The recommendation enum is safe_to_send, risky, or do_not_send. The flags you will branch on most often are details.is_disposable, details.is_catch_all, and details.is_role_account.

Do not treat is_valid alone as the decision. A disposable inbox and a catch-all domain can both look "valid" in a narrow sense. Use result plus the flags.

Instruct the agent to branch on five buckets

Give the agent an explicit policy, not a request to "check if the email is good."

  • Valid (deliverable, and not disposable). result is deliverable and details.is_disposable is false. This is the only bucket that should pass a "confirmed" gate. A role account such as info@ can still be deliverable; if the workflow needs a person, check details.is_role_account and ask for a personal address.
  • Invalid (undeliverable). result is undeliverable. Reject the signup or drop the lead, and ask the user to correct the address. recommendation is do_not_send.
  • Disposable. details.is_disposable is true, even if the mailbox would accept mail right now. For signup and lead qualification, reject it and ask for a durable address. For a campaign list, strip these before you send.
  • Catch-all. details.is_catch_all is true, or result is risky because the individual mailbox could not be confirmed. This is not invalid and not confirmed valid. Do not auto-qualify the lead. Allow the signup only if you have another reason to trust the user, or hold the address for review before you send.
  • Unknown. result is unknown: the check could not finish cleanly (timeout, greylisting, or a provider that will not disclose mailbox existence). Do not treat this as a bounce and do not treat it as confirmed. Retry once, or ask the user to confirm the address.

Paste this into the agent prompt: "Before you store or email an address, call verify_email. Accept only deliverable addresses that are not disposable. Reject undeliverable and disposable. Quarantine catch-all and risky. Retry or ask for confirmation on unknown. Do not decide from is_valid alone."

For a small list, the catalog also has a synchronous batch tool (up to 100 addresses). For a large CSV, use the async bulk tools (submit_bulk, then poll the job).

Credits, honestly

Only definitive outcomes use a credit: deliverable and undeliverable. Risky and unknown results are free, so it is safe to retry an unknown later instead of inventing a verdict. Check credits_charged and the returned balance after each call. Pricing is pay-as-you-go; credits do not expire. The 100-credit trial is enough to wire the branch logic above.

A verification result is a decision aid, not a guarantee of inbox placement. Passing SPF, DKIM, or DMARC on the messages you send does not replace this check.

Top comments (0)