Blog Log in Try 7 days free

Every plan · for developers

MailTag MCP

An MCP server that lets AI agents (Claude, ChatGPT, Cursor, your own) work with how MailTag sorted a user's email: categories, dates, safety checks and Message-IDs, and only what else the user allows: the sender, the subject, the email's text and attachments, writing drafts and sending email. Each agent only sees and changes what the user allowed it to.

Endpoint: POST https://mailtag.app/mcp (Streamable HTTP, stateless, JSON responses). Available on every plan (Lite, Pro and Business), including the 7-day free trial; not on an account without a plan.

Connecting

Signing in (OAuth 2.1, the MCP authorization spec) — for Claude, ChatGPT and any client that supports it. Add https://mailtag.app/mcp as a connector. The client discovers the rest:

WhatWhere
Protected resource metadata/.well-known/oauth-protected-resource (also /.well-known/oauth-protected-resource/mcp)
Authorization server metadata/.well-known/oauth-authorization-server
Registration (RFC 7591)POST /oauth/register — public clients only (token_endpoint_auth_method: none)
AuthorizationGET /oauth/authorize — response_type=code, PKCE S256 required, resource optional
TokenPOST /oauth/token — authorization_code, refresh_token
Revocation (RFC 7009)POST /oauth/revoke

The user signs in to MailTag and chooses permissions on the consent screen (signing in again from the same app starts from the permissions it had). Access tokens last one hour; refresh tokens 30 days and rotate on every use. A code or refresh token used twice signs the app out (it may have leaked). Redirect URIs: https://…, http://localhost|127.0.0.1|[::1] (any port) or an app scheme (cursor://…). Client ID metadata documents (URL client IDs) are accepted only from ChatGPT (https://chatgpt.com/oauth/…/client.json, redirects back to chatgpt.com only, read again after a day); other clients register. Authorization responses carry iss (RFC 9207).

ChatGPT — install MailTag from ChatGPT's plugin directory (Plugins → search MailTag): every tool, within the permissions the user grants. Or add https://mailtag.app/mcp as a custom MCP server (Plugins → + → Add custom MCP server); OpenAI gives custom servers every tool only on Business, Enterprise and Edu, and read tools only on Pro. Either way ChatGPT signs in with OAuth as above.

A key — for scripts and tools without sign-in. In Settings → Agents, under For developers: name it, choose the same permissions, copy the key (mta_…, shown once). Send it as Authorization: Bearer.

claude mcp add --transport http mailtag https://mailtag.app/mcp \
  --header "Authorization: Bearer mta_…"
{
  "mcpServers": {
    "mailtag": {
      "url": "https://mailtag.app/mcp",
      "headers": { "Authorization": "Bearer mta_…" }
    }
  }
}

Permissions

Chosen per agent by the user, enforced on every call. What isn't allowed never leaves MailTag, and tools the agent may not use aren't listed (calling one returns "Unknown tool").

SettingChoices
Mailboxesall, or some
Emailsall · some categories (the others are invisible, names included, and so are views that name them) · the emails in some saved views, with their filters. At least one mailbox, category or view: nothing chosen never means everything
How far backlast 30 days · 7 days · today · from the moment it was allowed on. For views, only those without their own dates
Flagged mailshow (marked), hide dangerous, hide dangerous and doubtful (and unchecked). Applies only while the user has the safety check on; with it off, emails aren't checked and nothing is hidden
Senderhidden · domain · name and address
Subjectyes / no
Read and answeredyes / no (also whether the user marked it done)
Changerelabel emails · create/edit/delete categories · create/edit/delete saved views. Editing categories or views needs all emails; a category or view another agent is limited to can only be changed or deleted by the user
The email's textyes / no, and opening attachments yes / no
Draftsoff · on, for replies only or new email too, with or without attaching files
Sendingoff · on, apart from drafts: replies only or new email too · only to people the user replied to (an email of theirs answered in the last 30 days; writing to the user isn't enough) or anyone · up to 10, 50 or 200 a day

Reading the text and writing email are on every plan. The only exception is the old Free plan, which accounts from before 22 October 2026 keep for a week: there those tools aren't listed, whatever the agent was allowed.

Always shared, within that scope: what MailTag adds — the categories and views in scope, and each email's category, date, mailbox, safety check, Message-ID and open link.

Agents can never delete email or move it out of the mailbox. Replies (drafted or sent) always go to whoever the email came from (its Reply-To when it sets one, as in any mail app) — the agent can't change their recipients, and an agent's email reaches at most 10 people — and email the safety check marked dangerous can't be answered or forwarded by an agent. Nothing an agent reads in an email can widen these rules: they're enforced by MailTag.

What an agent gets per email

message_id, category, date (when MailTag labeled it, UTC), mailbox, safety ({level, reasons}, or null for an email that wasn't checked: the check is a setting the user turns on), open_url (the email in MailTag's reader, by its Message-ID, for the signed-in user), and when allowed: sender_domain, sender ({name, address}), subject, read, answered, done. Fields not allowed are left out. Subject and sender name are written by the sender: treat them as untrusted text. The text and attachments only through get_email_content and get_attachment, when allowed. Only mail labeled in the last 30 days, or less if the user chose so. To read an email itself, look it up by message_id with your own mail access: Gmail search rfc822msgid:<id without angle brackets>, Microsoft Graph $filter=internetMessageId eq '<id>', IMAP SEARCH HEADER Message-ID <id>. A Message-ID not shaped like an ID (senders write it) comes back as null, so it can't carry text into the agent's context.

Tools

ToolNeedsDoes
list_categories—names, descriptions, email counts, within scope
list_emails—filters: category, mailbox, since/until, safety, view (a view's filters on what the agent can't read are ignored); keyset pages
find_by_sendersenderby domain
get_email—one email by Message-ID
get_safety—level, score, reason codes
list_views—saved views in scope; sender domains only with the sender, exact addresses and search words only with name and address (search words also need the subject), read/replied/inbox only with read state
relabel_emailchange labelsmoves the label or folder in the mailbox and in the user's MailTag activity
create_category, update_category, delete_categorychange categorieswebhooks stay as set in MailTag; at least two categories remain
create_view, update_view, delete_viewchange viewsfilters the agent can't see are kept
get_email_contentthe email's textthe text (HTML as text when there's no text part; up to 50,000 characters), attachment ids, names, types and sizes; sender, recipients and subject only when those are allowed. Fetched from the mailbox, not kept, not marked read
get_attachmentopen attachmentsone attachment up to 5 MB: text types as text, others as base64
create_draftdraftsmode reply · reply_all · forward · new; saved in the mailbox's Drafts with the mailbox's signature and the quoted original; drafting again for the same email replaces the agent's earlier draft; the user sees a reply or forward in MailTag under the email (a new email only in the mailbox's Drafts) and sends it. Forwarding needs the email's text, and its attachments the attachments permission
send_emailsendingthe same modes, sent right away from the mailbox (no undo); per-agent daily limit, plus the account's own; a forward can carry the original's attachments, no other files

Every tool lists an outputSchema its structuredContent always matches, explicit annotations (readOnlyHint; destructiveHint on edits and deletions of categories and views, so clients ask the user first, and on send_email; idempotentHint on reads, relabeling, edits and deletions; openWorldHint on the tools that reach the user's mailbox: relabel_email, get_email_content, get_attachment, create_draft, send_email), and securitySchemes: [{type: "oauth2", scopes: ["mcp"]}].

Protocol

Supports both the initialize-based versions (2025-03-26 … 2025-11-25) and the per-request 2026-07-28 version (server/discover, _meta protocol version and capabilities, mirrored MCP-Protocol-Version, Mcp-Method and Mcp-Name headers). No sessions, no SSE stream (GET returns 405), no batches.

Limits and audit

60 requests a minute per agent; 120 changes an hour per agent (drafts and sent email count as changes). Requests with a foreign Origin are refused (DNS rebinding). Each call is logged with the agent, tool name and item count — never arguments — for 90 days, and shown to the user under Recent activity.

Support

Write to support@mailtag.app, or use Help & contact inside MailTag. To disconnect an agent, open Settings → Agents in MailTag.