The MCP server
The MCP server lets an AI agent work your inboxes. It presents mail compactly, for a reader whose attention costs money: cleaned bodies, one line per thread, and a token budget on every read.
Connect
Its address (Streamable HTTP):
https://api.mailcraft.ntconnect.com/mcp
It signs in with an API key sent as Authorization: Bearer <key>. There is no OAuth. Create a key on the console's API keys page; it is shown once. The key's organization is the one the agent works in.
Claude Code
Add the server with one command. The scope is local by default; use --scope user for all your projects. For a shared project, use the .mcp.json below rather than --scope project, so no key is committed.
claude mcp add --transport http mailcraft https://api.mailcraft.ntconnect.com/mcp --header "Authorization: Bearer mc_live_…"
A key passed to claude mcp add --header is stored in plain text, in ~/.claude.json or .mcp.json. To keep the key out of a committed file, put this in the project's .mcp.json and set MAILCRAFT_API_KEY in your environment:
{
"mcpServers": {
"mailcraft": {
"type": "http",
"url": "https://api.mailcraft.ntconnect.com/mcp",
"headers": {
"Authorization": "Bearer ${MAILCRAFT_API_KEY}"
}
}
}
}
Claude Desktop and claude.ai
Free, Pro and Max (Free allows one custom connector): open Customize, then Connectors, choose + Add, then Add custom connector. Enter a name and the MCP address, and choose Continue. Under Authentication choose No sign in, because MailCraft has no OAuth. Under Request headers, add Authorization: Bearer <key>, then choose Add.
Team and Enterprise: an Owner adds it (on Team, an Owner or Primary Owner; on Enterprise, also a custom role with "Manage access to Libraries"). Open Organization settings, then Connectors, choose Add, then Custom, then Web. Use the same Authentication (No sign in) and Request headers. Members then find it under Customize, then Connectors, and choose Connect. Everyone who uses the connector reaches MailCraft with that same key, so use a key whose access suits all of them.
Cursor
Put this in ~/.cursor/mcp.json, or .cursor/mcp.json in a project, with MAILCRAFT_API_KEY set in your environment:
{
"mcpServers": {
"mailcraft": {
"url": "https://api.mailcraft.ntconnect.com/mcp",
"headers": {
"Authorization": "Bearer ${env:MAILCRAFT_API_KEY}"
}
}
}
}
VS Code
Put this in .vscode/mcp.json. VS Code asks for the key once and stores it securely.
{
"servers": {
"mailcraft": {
"type": "http",
"url": "https://api.mailcraft.ntconnect.com/mcp",
"headers": {
"Authorization": "Bearer ${input:mailcraft-key}"
}
}
},
"inputs": [
{
"type": "promptString",
"id": "mailcraft-key",
"description": "MailCraft API key",
"password": true
}
]
}
The fourteen tools
To read
list_inboxes: your organization's inboxes, one line each: address and id.create_inbox: create an inbox, optionally with a username and display name; without a username one is assigned.list_threads: an inbox's threads, newest first, one line each (25 a page at most); pass the returned cursor for more. It takes the search filters below, so it can list only the threads that match.search_threads: search threads across every inbox (or one, withinbox_id), newest first, one line each that also names its inbox. It needs at least one filter (below) and pages with the same cursor.get_thread: a thread withinmax_tokens(default 3000, up to 8000): the newest message up to half the budget, older ones shorter, the rest as one line each pointing atget_message.get_message: one message: headers, the cleaned body cut atmax_tokens(default 2000, up to 8000) with an offset to continue from, and its attachments.get_attachment_url: a link to download one attachment, valid for 5 minutes.list_new_mail: new mail since a cursor, one line per received message and per draft sent or rejected, oldest first, then anext:cursor to pass assincenext time. An agent can poll it cheaply.
To write
send_message: send a new message from one of your inboxes; it starts a new thread.reply: reply to a message, from the inbox it arrived in. It goes to the original's Reply-To or sender (for a message you sent, its To);reply_allalso copies the original's other To and Cc.forward: forward a message, from the inbox it is in, to new recipients, with an optional note above it. The original's attachments go with it (received mail only;include_attachments: falseleaves them out), and it starts a new thread.create_draft: save a draft, to send later; every field is optional until it is sent.send_draft: send a saved draft. A draft sends once.get_draft: a draft's state: open, sent or rejected; whether it waits for approval; its Reply-To andX-headers; a reviewer's note; and the message id once sent.
The search filters, for list_threads and search_threads: query (words anywhere in the subject, addresses and text; -word excludes, "quoted words" are a phrase; a whole address, its local part or its domain matches; INV-4417 also matches 4417), from, subject, after and before (ISO 8601 with a zone) and has_attachments. A thread is listed when one message matches all the filters. Typos, word stems and attachment contents do not match, and results are newest first, not ranked. A search that runs too long answers "Search took too long; narrow it."
Pass idempotency_key to send_message, reply and forward, and reuse it when you retry: without one each call is new, so a retried call can send twice. forward carries the original's attachments (received mail only), and no tool takes files of its own; send files with the REST API (attachments on POST /v0/inboxes/{inboxId}/messages or on a draft).
send_message, reply, forward and create_draft also take reply_to (1 to 5 addresses, not recipients) and headers (an object of at most 20 X- headers; X-SES-*, X-MailCraft-* and X-Mailer are refused; each value is 1 to 997 printable ASCII characters with at least one non-space; names and values together at most 8 KiB).
Drafts and approval apply to MCP sends too. If an inbox requires approval, a send from the agent is held as a draft until an owner or admin approves it: the tool answers status: pending_approval with the draft id, and get_draft shows the outcome. See Human approval.
The server also offers the REST API's reference as two plain-text resources, the API Brief: mailcraft://brief is every operation on one line, each ending in a ref, and mailcraft://brief/{ref} (the ref without its #) is one operation in full, with an example request.
How mail is presented
- One fact per line. Lists are one line per inbox, thread or message, with the id last; empty fields are left out.
- Cleaned bodies. Quoted replies and signatures are collapsed.
get_messagewithinclude_quotedshows them. - A token budget on every read, never a silent cut. Tokens are estimated as characters ÷ 4. When a body is longer than its budget, it ends with a marker saying about how many tokens remain and the offset to continue from with
get_message. - Threads within one budget.
get_threadgives the newest message up to half the budget; older messages share the rest at no less than 200 tokens each, and those that don't fit are listed as one line pointing atget_message. - Attachments listed, never inlined. Each is a line with its name, type and size; the agent asks for a link only when it needs the file.
- Authentication shown. A message carries its SPF, DKIM and DMARC results, so the agent knows how far to trust what it read before acting on it.
- Header lines can't be forged. Line breaks and control characters in a sender's name or subject become spaces, so mail cannot fake the
message:andthread:lines an agent relies on.