Search packages
cerase.ai Marketplace
← Back to the catalog
Connector

MailTrackMCP

by La Reale Errante

Open and click tracking for the emails your assistant sends. Your company deploys the open-source MailTrackMCP server on its own Cloudflare account; each person connects with their own key. The readme explains how to deploy and use it.

Community

About this package

What it is

MailTrackMCP tells you whether an email your assistant sent was opened and which links were clicked. It is an open-source server (MIT, by headlessfounder) that your company runs on its own Cloudflare account: one Worker and one D1 database. Recipients, opens and clicks are stored there.

Before an email is sent, the assistant passes its HTML to the server, which adds an invisible 1×1 image and rewrites the links to go through your server. The assistant then sends that HTML with your mail connector.

What you need

  • A Cloudflare account. The free plan allows 100,000 requests and 100,000 database rows written per day.
  • A GitHub or GitLab account, used by Cloudflare's deploy button to copy the code.
  • A mail connector that sends HTML, such as Gmail or Zoho Mail. Plain-text emails cannot be tracked.

1. Deploy the server (once per company)

  1. Open Deploy to Cloudflare and follow the steps. It creates the Worker and the database.
  2. Before anything else, add a secret named ADMIN_TOKEN (Cloudflare dashboard → Workers & Pages → your Worker → Settings → Variables and Secrets → type Secret). Use a long random string of letters and digits. Without it, whoever opens /setup first owns the server.
  3. Add a second secret, SESSION_SECRET, if you also want sign-in links by email.
  4. Open https://<your-worker>/setup?k=<ADMIN_TOKEN>, enter your name and email, and copy the token that starts with dt_. It gives full access to your data: keep it in a password manager and do not give it to an assistant.

From the command line instead:

git clone https://github.com/headlessfounder/MailTrackMCP && cd MailTrackMCP
npm install
npx wrangler d1 create mailtrackmcp   # put the printed id in wrangler.jsonc
npm run db:init
npx wrangler secret put ADMIN_TOKEN
npx wrangler deploy

2. Create a key for the assistant (each person)

  1. Open https://<your-worker>/app, choose Use an API token instead and paste your dt_ token.
  2. In Agent keys, create a key with the permissions register (track new emails) and read (see opens and clicks). You can set a daily limit.
  3. Copy the key that starts with mk_. It is shown once.

The assistant sees only the tools the key allows: with read alone it cannot register emails.

Adding a colleague. Each person has separate data and their own dt_ token:

curl -X POST https://<your-worker>/api/admin/users \
  -H "x-admin-token: <ADMIN_TOKEN>" -H "content-type: application/json" \
  -d '{"name":"Jane Smith","email":"jane@yourdomain.com"}'

The answer contains their token and dashboard link.

3. Connect it in Cerase

Install the connector, then connect it from the Connectors page with two values:

  • Server address: https://<your-worker>, without /mcp.
  • Key: the mk_ key.

Using it

Ask your assistant, for example:

  • “Send this proposal to anna@example.com and track it, campaign spring.”
  • “Who opened my emails today?”
  • “Did anyone at Northwind click the link?”
  • “Which campaign has the best open rate?”
Tool What it does
register_tracked_email Returns the HTML to send, with image and links added
list_recent_emails Recent emails with opens and clicks
get_email_status Timeline of one email
get_campaign_stats Totals per campaign
get_filtering_comparison Filtered opens compared with every image load

First test. Send a tracked email to yourself, wait a few minutes, open it, click a link, then ask for its status. The returned HTML must be sent unchanged, otherwise nothing is recorded.

Reading the numbers

A click is the most reliable signal. Opens are approximate: some mail programs block images, and others load them without anyone reading. The server marks automatic loads and leaves them out of the confirmed opens.

Open tracking concerns your recipients' personal data: check what GDPR and ePrivacy require of you, such as a mention in your privacy notice.

Optional

  • Your own domain for tracked links (helps deliverability): set TRACKING_HOST to a subdomain of the domain you send from and enable routes in wrangler.jsonc.
  • Alerts and sign-in links by email: configure Cloudflare Email Sending or a Resend key, as in the project documentation.

Problems

What you see Likely cause
The connection is refused (401) Wrong or revoked key, or wrong address
Some tools are missing The key lacks register or read
/setup answers 403 ADMIN_TOKEN missing from the address, or an account already exists
No opens recorded The recipient blocks images, or the HTML was changed before sending