own-domain-mcp
Provisions own-domain email for families using Cloudflare's API, enabling automatic setup of email routing, catch-all forwarding, and verified destinations.
README
own-domain-mcp
One command to give a family their own-domain email — provisioned end to end on the MCP → API path, idempotently, for the whole fleet.
Every family/service account is registered under that family's own domain (service@theirdomain, owner@theirdomain). For those addresses to actually receive vendor sign-up and verification mail, the domain needs Cloudflare Email Routing: a verified destination, MX records, and a forward rule. This server does all of it via the Cloudflare REST API.
Why MCP → API (and why we keep it that way)
Direct API is the path; the browser is the last resort.
- Deterministic & fast. A REST call is one round trip with a known result. Driving the Cloudflare dashboard with simulated clicks (
cliclick+ screenshots) is slow, brittle, and breaks on any UI change. The day this tool was born, expanding one API token's scope had to be done by clicking dashboard dropdowns because Cloudflare won't let a token widen its own scope — that pain is exactly what we never want to repeat for a repeatable task. - Least privilege. A scoped API token (Zone Email Routing Rules + DNS, Account Email Routing Addresses) can do everything here except first-time enable. No full logged-in session, no password, no 2FA in the loop.
- Composable forever. Because it's an MCP wrapping the API, the agent/fleet calls it the same way every time, and it composes into the unified
super-mcp.
The one honest gap
Cloudflare does not grant the first-time POST /email/routing/enable (and the /email/routing settings GET) to scoped API tokens. This tool:
- tries the scoped token,
- falls back to a global API key if one is configured (
CLOUDFLARE_EMAIL+CLOUDFLARE_GLOBAL_API_KEY, or Keychaincloudflare-global-api-key) — keeping enable on the API path too, - otherwise reports
enable: blockedwith guidance and still sets the catch-all/rules, which activate the instant routing is enabled (one dashboard click, once per zone).
Everything else — destinations, catch-all, rules, status — is pure scoped-token API.
Tools
| Tool | What it does |
|---|---|
own_domain_targets |
List eligible family domains (all zones minus the exclude policy) + the forward-to inbox. Read-only. |
own_domain_status |
Per-domain (or fleet-wide) routing state: enabled, destination verified, catch-all target, functional. Read-only. |
own_domain_destination_ensure |
Ensure the forward-to inbox is a verified account destination (creates + triggers verification). confirm. |
own_domain_provision |
Full idempotent setup for ONE domain: destination → enable → catch-all/addresses → status. confirm. |
own_domain_fanout |
The same for EVERY eligible family domain — the one fleet command. confirm. |
Policy / safety
config/own-domains.json (env-overridable):
forwardTo— the inbox every address forwards to (e.g.you@example.com).mode—catch_all(forward every address) oraddresses(onlyowner@,service@).exclude— zones never touched. Empty by default; add any zone you never want catch-all'd to a personal inbox (e.g. a medical/PHI domain, or shared infrastructure).include— optional allowlist; when empty, all zones exceptexcludeare eligible.
Config
npm install && npm run build
claude mcp add own-domain -- node /path/to/own-domain-mcp/dist/index.js
Credentials (env first, then macOS Keychain):
- Scoped token:
OWN_DOMAIN_CF_TOKEN/CLOUDFLARE_API_TOKEN, or Keychaincloudflare-api-token/cloudflare-email-routing-token(account fromCLOUDFLARE_KEYCHAIN_ACCOUNTor$USER). - Optional global key (enable only):
CLOUDFLARE_EMAIL+CLOUDFLARE_GLOBAL_API_KEY, or Keychaincloudflare-global-api-key.
Env overrides: OWN_DOMAIN_FORWARD_TO, OWN_DOMAIN_MODE, OWN_DOMAIN_CONFIG, OWN_DOMAIN_ACCOUNT_ID.
npm test # unit tests (mock fetch, no live API)
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.