Docs Get key
Guides Inbound email

Inbound email to Google Sheets

For freelancers and small teams who want every enquiry, reply and form-notification in one spreadsheet — without owning a mail server, editing DNS, or writing a backend. Your agent does the setup; you keep the Sheet.

someone@their-site sends an email leads-acme.mailk.us parsed to JSON one row Google Sheets your agent reads it back No DNS records to publish · no server to run · works while your laptop is shut

What you need

  • An AI agent that can install a skill and add an MCP server (Claude Code, Cursor, Codex, Gemini CLI).
  • A Google account with Sheets, if you want the agent to read the result back.
  • Nothing else. No domain, no DNS, no card.

1. One prompt: account and tools

Paste this into your agent. It installs the MailKite skill, adds the hosted MCP server, and opens MailKite's sign-in page in your browser — signup included if the email is new. There is no API key to copy.

the one prompt
Set up MailKite for me, then wait for my next instruction.

1. Install the MailKite agent skill:
npx skills add mailkite/agent-skills -g

2. Add the hosted MailKite MCP server:
claude mcp add --transport http mailkite https://mcp.mailkite.dev/mcp

3. Connect and sign in when the browser opens. If I don't have an account,
create one with the email I give you.

4. Call mailkite_me, list the mailkite_* tools you can see, and stop.

Approve the browser step, then let it call mailkite_me and list its tools. The full prompt and the other clients' install lines live on Agent setup.

2. Claim a free subdomain — no DNS

This is the step that removes the usual drop-off. A custom domain means finding your registrar, adding MX, SPF, DKIM and DMARC records, then waiting for propagation. A MailKite subdomain publishes all of that for you, in a zone we run.

Ask your agent:

your second instruction
Claim a free MailKite subdomain called leads-acme and tell me the address when it can receive mail.
what the agent runs
// No DNS, no registrar, no waiting on propagation.
mailkite_claim_subdomain({ subdomain: "leads-acme" })
// → { domain: "leads-acme.mailk.us", status: "pending", dns: [] }

// "dns: []" is the whole point — we publish the records for you.
// Receiving starts as soon as the name resolves (usually minutes).

Receiving starts as soon as the name resolves, usually within minutes. Sending can take a little longer while the sending identity verifies — the agent can call mailkite_verify_domain to check. The address is <anything>@leads-acme.mailk.us: a catch-all covers every local part, so hello@ and fix-my-site@ both land in the same place.

Labels: at least 3 characters, letters, numbers and hyphens only. Reserved words like admin, mail and support are refused, and a taken label comes back as Already taken — ask for another.

3. Get the mail into the Sheet

There are two honest ways to do this, and the choice matters more than it looks. Google's Apps Script web apps answer POST with a redirect, and MailKite's webhook delivery deliberately does not follow redirects (a 3xx is a failed delivery, not a success you can't see). So you either push to a receiver that answers 200 directly, or you let a small script in the Sheet pull.

Option A — push, with a no-code webhook (instant)

Zapier, Make and n8n all give you a URL that accepts a JSON POST and answers 200 immediately. Zapier is the shortest path if you already have an account; the steps are the same in Make.

Zapier: Catch Hook → Google Sheets
Trigger:  Webhooks by Zapier  →  Catch Hook
copy the URL it gives you, e.g.
https://hooks.zapier.com/hooks/catch/123456/abcdef/

Action: Google Sheets → Create Spreadsheet Row
Spreadsheet: MailKite Leads
Worksheet: Sheet1

Map the fields Zapier shows after your first test:
Received ← receivedAtIso
From ← from__address
To ← to__0__address
Subject ← subject
Message ← textFromHtml (or text, when the sender wrote plain text)
ID ← id

Then hand the hook URL to the agent:

wire it up
Point hello@leads-acme.mailk.us at https://hooks.zapier.com/hooks/catch/… and send me a test message so I can check the row.

The agent calls mailkite_set_webhook with that URL. Every message to the subdomain is now parsed and POSTed within seconds — including while your laptop is shut, because the delivery happens on our edge, not in your session.

Option B — pull, with Apps Script (free, no third party)

If you would rather not add another account, put the script in the Sheet itself. It reads your newest inbound messages once a minute and appends anything it hasn't seen. Create a Sheet called MailKite Leads, open Extensions → Apps Script, and paste this:

Code.gs
// In the Sheet: Extensions → Apps Script. Paste this, save, then run install().
// Project Settings → Script properties → add MAILKITE_KEY = mk_live_…

function install() {
ScriptApp.getProjectTriggers().forEach(function (t) { ScriptApp.deleteTrigger(t); });
ScriptApp.newTrigger('pull').timeBased().everyMinutes(1).create();
pull();
}

function pull() {
var key = PropertiesService.getScriptProperties().getProperty('MAILKITE_KEY');
if (!key) throw new Error('Set MAILKITE_KEY in Project Settings → Script properties.');

var res = UrlFetchApp.fetch('https://api.mailkite.dev/api/messages?limit=50', {
headers: { Authorization: 'Bearer ' + key },
muteHttpExceptions: true,
});
if (res.getResponseCode() !== 200) {
console.error('MailKite ' + res.getResponseCode() + ': ' + res.getContentText().slice(0, 200));
return;
}

var book = SpreadsheetApp.getActiveSpreadsheet();
var sheet = book.getSheetByName('Leads') || book.insertSheet('Leads');
if (sheet.getLastRow() === 0) {
sheet.appendRow(['Received', 'From', 'To', 'Subject', 'Message', 'ID']);
sheet.setFrozenRows(1);
}

// Dedupe on the message id, so a re-run never double-writes a row.
var seen = {};
if (sheet.getLastRow() > 1) {
sheet.getRange(2, 6, sheet.getLastRow() - 1, 1).getValues()
.forEach(function (row) { if (row[0]) seen[row[0]] = true; });
}

var rows = JSON.parse(res.getContentText())
.filter(function (m) { return m.direction === 'inbound' && !seen[m.id]; })
.reverse() // oldest first
.map(function (m) {
return [
new Date(m.received_at),
(m.from && m.from.address) || '',
(m.to && m.to[0] && m.to[0].address) || '',
m.subject || '',
(m.text || m.textFromHtml || m.snippet || '').slice(0, 5000),
m.id,
];
});

if (!rows.length) return;
sheet.getRange(sheet.getLastRow() + 1, 1, rows.length, 6).setValues(rows);
}

Add your API key under Project Settings → Script properties as MAILKITE_KEY (the agent can fetch it with mailkite_get_api_key), then run install() once and approve the permissions. It writes a header row, pulls the 50 newest messages, skips ones it already has, and repeats every minute.

Which one? Pick A for instant rows and zero code. Pick B when you want no third-party service and no webhook URL to manage — the trade is up to a minute of latency and a key stored in the Sheet's script. Either way, the Sheet is the only place the data lives; MailKite keeps its own copy for the plan's retention window.

4. Let the agent read the Sheet back

Google publishes an official Workspace extension for Gemini CLI, and the same repository ships the MCP workspace server it runs on. It signs in with the Google account that can already see your Sheet:

Google Workspace extension (official)
gemini extensions install https://github.com/gemini-cli-extensions/workspace

Then give it a job worth doing:

read it back
Google's official Workspace extension is installed and signed in.
Read the spreadsheet called "MailKite Leads" and tell me:
- how many rows arrived today
- the last five, as From / Subject / one-line summary
Then stop.

Know what it can do: Google's extension currently exposes three Sheets tools — sheets.getMetadata, sheets.getRange and sheets.getText. All three read. It cannot append a row, which is exactly why step 3 exists. The agent reads and summarises; the webhook or the script writes.

5. Test the whole path

the round trip
# From any mailbox, to the address you claimed
To: hello@leads-acme.mailk.us
Subject: Website fix for the contact form

(The local part doesn't matter — a catch-all covers every address on the subdomain.)

Send from your phone, from Gmail, from anywhere. The message is parsed at MailKite's edge, delivered to the Sheet, and then your agent can read it back. Inbound mail to a catch-all is stored for your plan's retention window and visible in the Messages list, so a failed automation never loses the message — you can replay the delivery from the dashboard or the API.

Notes before you put it in front of real people

  • Quotas. Free is 3,000 emails a month and 200 a day, inbound and outbound together. Unlimited domains and addresses. A personal enquiry form will not get close.
  • Spam. The webhook payload carries auth.spam and auth.spamSignals; the list API returns a spam verdict per row. Filter on it in the Zap or the script if you publish the address anywhere scrapable.
  • Personal data. A lead sheet is other people's email. Keep the Sheet private, and remember that anyone with edit access to a bound Apps Script can read the key in its script properties.
  • The 50-message window. Option B reads the 50 newest messages each minute. That is far more than a one-person inbox; if you expect bursts, use Option A.

A little about MailKite

MailKite is inbound-first email infrastructure: every message to a domain you control is parsed and delivered as JSON, and outbound goes over the same verified domain with one API call. The same account works through the MCP server, the SDKs, the CLI and raw HTTP — so the setup your agent does today is the setup you keep using.

Next: set up your agent's email, build a support inbox agent, or the inbound webhook reference.