mailmcp — pošta v ChatGPT a Claudemail in ChatGPT and ClaudeJedna platba · žádné předplatnéOne payment · no subscriptionv0.4.0 · mailmcp.ai

Connect your mail to Claude or ChatGPT. Step by step.

From your first app password to your first question, “what came in from accounting this week”. Shared server: 10 minutes. Your own server for a company: another 15. In a hurry? A short version with a Czech/English switch is at https://mailmcp.ai/start, and you can let your ChatGPT or Claude walk you through it: send it the link https://mailmcp.ai/llms.txt.

What this is

mailmcp is a small server that gives Claude or ChatGPT access to your mailboxes: Gmail, Outlook, iCloud, Fastmail, Yahoo, Zoho or any IMAP account, several at once if you like. Claude can then search, read, summarise and prepare replies as drafts. Sending, moving and deleting are switched off until you turn them on yourself.

The crucial difference from off-the-shelf connectors: your mail passwords never travel through OpenAI or Anthropic in readable form and the server never stores them. Your whole configuration travels inside a single encrypted token. The key to it is split in two halves: one is in the token, the other (the master key) lives only on the server. Anyone holding just the token (logs at OpenAI, for example) can read nothing. Anyone holding just the master key has no configuration. Only the server can decrypt, and only at the moment it is handling a request for you.

WhoWhat they see
Youeverything
Your mail provider (Google, Microsoft…)what it always saw
OpenAI / Anthropic (ChatGPT, Claude)the results the assistant asked for, and your token as unreadable ciphertext
Operator of the shared server (the person or company running it)the master key; your data only in memory during your request, nothing at rest
Hosting (Vercel)the same as the operator
The author of mailmcpnothing

Which path to take

Shared serverThe recommended start. You use this server (https://mailmcp.ai), generate a token and paste it into ChatGPT, claude.ai, Claude Code or another client. No installation, no hosting.
Your own serverYou want the master key under your own control too (a company, a team). You deploy mailmcp to your own Vercel account with a single secret; everyone else then uses your server exactly like the shared one.
My computer onlyClaude Desktop or Claude Code locally. Nothing runs outside your computer, but it will not work from your phone or from ChatGPT.

Steps 1 to 3 describe the shared server. Your own server and the local variants come later.

Step 1 · Passwords for your accounts

mailmcp signs in to mailboxes over IMAP/SMTP, exactly like the mail app on your phone. Most providers require an app password for that: a special password you generate and can revoke at any time without changing your main password. Prepare one now for every mailbox.

Gmail

  1. Turn on two-step verification: myaccount.google.com → Security → 2-Step Verification. Without it Google will not offer app passwords.
  2. Open myaccount.google.com/apppasswords, enter mailmcp as the name and click Create.
  3. Google shows 16 characters in four groups. Copy them (the spaces do not matter). You will see this password only once.
Google Workspace accounts: app passwords have to be allowed by your domain administrator. If the option is missing, ask IT, or use a different account.

Outlook / Microsoft 365

App passwords work only if your tenant administrator enables them (they are blocked by Security defaults and by most MFA policies). Without an app password, signing in with a password usually fails, because Microsoft requires OAuth. OAuth support in mailmcp is planned.

Until then: ask your administrator to allow app passwords for your account, or use a different provider, or an IMAP mailbox on your own domain.

iCloud

  1. account.apple.com → Sign-In and Security → App-Specific Passwords → Generate.
  2. In the setup form enter the full address (for example name@icloud.com); mailmcp works out the difference between the IMAP and SMTP logins on its own.

Fastmail, Yahoo, Zoho

All three require an app password from the account security settings (Fastmail: Settings → Privacy & Security → Integrations). Fastmail does not offer IMAP access on the Basic plan.

Your own domain, company server

Have ready the IMAP server address and port (usually 993), the SMTP server address and port (465 or 587), the login name and the password. You will find them in your hosting provider's instructions under “mail client settings”.

Step 2 · Creating your token

Open https://mailmcp.ai/setup. The page runs in your browser: the passwords you type into it are encrypted before anything leaves your computer. Only a 32-byte encryption key goes to the server, which seals it with its master key and hands it back. Nothing is stored.

  1. Accounts. For every mailbox pick the provider, enter a short Account id (for example personal, work; the assistant will use it in its answers), the e-mail address and the password from step 1. For your own server fill in the IMAP/SMTP details as well.
  2. Permissions. Tick what the assistant may do with that mailbox. A good starting point: Read & search and Create drafts. Turn sending on only together with an allowlist (for example @yourcompany.com), otherwise the assistant cannot send anything at all.
  3. Edit password. Choose a password you will use later to load the token back, when you want to add a mailbox or change permissions. Assistants never see it, so a token on its own can never hand over your mail passwords. Without it the token can later only be created again from scratch.
  4. Click Generate my token. Copy Your mailmcp token (the long text starting with mmt1.). Save it in your password manager: whoever holds it can read your mail through this server.
The section “Options for your own single-owner deployment” and the values MAILMCP_CONFIG / MAILMCP_KEY are not needed on a shared server. They are for your own deployment and for Claude Desktop.

Step 3 · Connecting clients

The server address is https://mailmcp.ai/mcp. The token is used in two ways: as a bearer token where the client can send headers, or pasted into the login page where the client uses OAuth.

ChatGPT

  1. Settings → Connectors (or Apps & Connectors) → in the advanced settings turn on Developer mode. Custom connectors are available on the Plus, Pro, Business, Enterprise and Edu plans.
  2. Create → name “mailmcp”, URL https://mailmcp.ai/mcp.
  3. Authentication: either OAuth (ChatGPT opens the server's login page, where you paste your token), or, if the form offers a bearer token, paste the token straight in. Do not add any other headers or variables.
  4. Enable the connector in the chat and try: “List my mail accounts.”

claude.ai (web, mobile, Claude Desktop)

  1. Settings → Connectors → Add custom connector, URL https://mailmcp.ai/mcp, save, Connect.
  2. The server's login page opens. Paste your token and confirm. The connector is then active in the mobile app as well. Requires the Pro plan or higher.

Claude Code

claude mcp add --transport http mailmcp https://mailmcp.ai/mcp \
  --header "Authorization: Bearer mmt1.…your whole token…"

Cursor, VS Code, Gemini CLI and others

Same address, the token either as a bearer header or through OAuth sign-in. The exact snippets are in the details for individual clients.

Your own shared server

If you want to run the server for yourself or for a team, you need two values: the master key MAILMCP_KEY and the license key MAILMCP_LICENSE (Personal €4.99 for one person and up to 5 mailboxes; Unlimited €129 for shared token mode; pricing at https://mailmcp.ai/pricing). The server stores nothing, so it needs no database; for personal use the free Hobby plan on Vercel is enough, for a company use Vercel Pro or Docker.

  1. Accounts at github.com and vercel.com.
  2. Click the Deploy button in the wizard at https://mailmcp.ai/start: Vercel copies the distribution repository kojott/mailmcp-dist into your GitHub account and asks for both variables right away. (Manually: fork the repository and in Vercel choose Add New → Project → Import.)
  3. Under Environment Variables add MAILMCP_LICENSE (the key from the e-mail you got after buying) and MAILMCP_KEY: 32 random bytes in base64url. Generate them in a terminal with node -e "console.log(require('crypto').randomBytes(32).toString('base64url'))", or on the setup page in the section for your own deployment (the MAILMCP_KEY field). Save the key in your password manager: losing it invalidates every user token.
  4. Deploy. At https://your-project.vercel.app you will see the home page in shared mode; users create their tokens at /setup.
Never change the master key without telling your users: every change invalidates all issued tokens and everyone has to generate a new one.

Licensing: one license = one running installation; you can move it to another server at any time. The terms, including the 60-day refund, are in the LICENSE file in the repository.

Closed sign-up: set the extra variable MAILMCP_INVITE_CODE. Only someone who knows the code can then create tokens on the setup page (an “Invite code” field appears). Without it, anyone who knows the address can create a token on your server and use up your limits.

Your own reverse proxy (Docker, VPS): set MAILMCP_PUBLIC_URL to the public address of the server. Without it the server does not trust X-Forwarded-* headers (on Vercel it trusts them automatically).

Optionally you can also add MAILMCP_CONFIG with the operator's own mailboxes to your server; it then works as a single-user server (connector password, your own bearer token) and a shared one at the same time.

My computer only · A · Claude Desktop

For the local variants you need the values MAILMCP_CONFIG and MAILMCP_KEY from the “Values for your own deployment” section of the setup page, not a token.

  1. Download mailmcp.mcpb from the latest release on GitHub.
  2. Double-click it (or in Claude Desktop: Settings → Extensions → Install Extension). You need Node.js 20 or newer installed; Claude Desktop will tell you if it is missing.
  3. Paste MAILMCP_CONFIG and MAILMCP_KEY into the form. They are stored in your computer's system keychain.
  4. Open a new chat and write: “List my mail accounts.” Claude should call the list_accounts tool.
In this variant nothing runs outside your computer. When the computer sleeps, the connector does not work; for mobile use path B.

B · Your own single-user server on Vercel

An alternative to the shared server for anyone who wants everything in their own account but does not want to install anything. The procedure is the same as for your own shared server, except that instead of a master key you set two variables holding your configuration.

  1. Create an account at github.com and at vercel.com (sign in with GitHub, it saves a few steps).
  2. Make your own copy of the distribution repository on GitHub: on github.com/kojott/mailmcp-dist click Fork (or use the Deploy button at /start).
  3. In Vercel: Add New → Project → Import and pick your mailmcp fork. Vercel detects the app on its own; change nothing.
  4. Before clicking Deploy, expand Environment Variables and add MAILMCP_CONFIG and MAILMCP_KEY from step 2. (If you forget, you can add them later under Settings → Environment Variables and then pick Redeploy on the Deployments tab.)
  5. Click Deploy. In a minute you get an address like https://mailmcp-xyz.vercel.app. Open it: you should see the home page with your mailboxes. The /health address returns {"ok":true}.
  6. In claude.ai: Settings → Connectors → Add custom connector. As the URL enter your address with /mcp at the end, for example https://mailmcp-xyz.vercel.app/mcp. Save and click Connect.
  7. Your server's login page opens. Enter the connector password from the setup (not your e-mail password). Once confirmed, the connector is active in the mobile app and in Claude Desktop too.
Custom connectors are available on the Claude Pro, Max, Team and Enterprise plans. On Team/Enterprise they are added by the organisation owner.

C · Claude Code locally

Against the shared server the command from step 3 is all you need. Locally, with no hosting (requires Node.js 22+):

claude mcp add mailmcp -e MAILMCP_CONFIG="mmc1..." -e MAILMCP_KEY="..." -- npx -y mailmcp

To verify: claude mcp list shows mailmcp as connected.

Details for ChatGPT, Cursor, VS Code, Gemini CLI and others

Every tool connects to an address ending in /mcp. Two ways to sign in: OAuth (the client opens the server's login page, where you paste your token) or a bearer token in a header, where you paste the same token. The examples below use the address of your own server; on the shared server substitute https://mailmcp.ai/mcp.

ChatGPT

  1. In ChatGPT open Settings → Connectors (in some versions Settings → Apps & Connectors) and turn on Developer mode in the advanced settings. Custom connectors are available on the Plus, Pro, Business, Enterprise and Edu plans.
  2. Click Create (or +), enter the name “mailmcp” and as the URL your address with /mcp, for example https://mailmcp-xyz.vercel.app/mcp. Leave the authentication set to OAuth.
  3. ChatGPT redirects you to the server's login page. Paste your token (on your own single-user server, the connector password).
  4. Enable the connector in the tools menu of the chat. ChatGPT uses the search and fetch tools, which mailmcp provides for it: “search” searches all mailboxes with one query (Gmail syntax works for Gmail accounts, and you can pick a single mailbox with the prefix account:work), “fetch” reads one specific message. In Developer mode ChatGPT also has all the other tools available, drafts included.
ChatGPT requires PKCE, dynamic client registration or a Client ID Metadata Document, and the issuer confirmation on the redirect. mailmcp does all of that; there is nothing else to configure.

Cursor

The file ~/.cursor/mcp.json (globally) or .cursor/mcp.json in a project:

{
  "mcpServers": {
    "mailmcp": {
      "url": "https://mailmcp-xyz.vercel.app/mcp",
      "headers": { "Authorization": "Bearer mmt1.…your whole token…" }
    }
  }
}

Without the headers entry Cursor starts an OAuth sign-in in the browser; both variants work.

VS Code (GitHub Copilot)

The MCP: Add Server command → HTTP → address https://mailmcp-xyz.vercel.app/mcp. On the first connection VS Code opens the browser to sign in (OAuth). Written by hand into mcp.json:

{
  "servers": {
    "mailmcp": {
      "type": "http",
      "url": "https://mailmcp-xyz.vercel.app/mcp"
    }
  }
}

Gemini CLI

gemini mcp add --transport http --header "Authorization: Bearer mmt1.…your whole token…" \
  mailmcp https://mailmcp-xyz.vercel.app/mcp

Or in ~/.gemini/settings.json as "mailmcp": { "httpUrl": "https://…/mcp", "headers": { "Authorization": "Bearer …" } }.

Windsurf, Zed, Continue, JetBrains and others

Anywhere you can enter a “remote MCP server” with a Streamable HTTP address and an Authorization: Bearer … header, the same snippet as for Cursor works. Clients that speak OAuth sign in with the connector password.

How to work with it

Talk to Claude normally; it picks the tools itself. Questions that work well:

  • “List my mail accounts and what you are allowed to do with them.”
  • “What came in over the last three days across all accounts? Group it by account and tell me what needs a reply.”
  • “Find invoices with an attachment from this month in my work account.” (Gmail also understands queries like from:accounting has:attachment newer_than:30d.)
  • “Read me the last message from Chris Miller and prepare a polite reply as a draft.” You will find the draft in the Drafts folder of your mail app and send it yourself.
  • “Mark all newsletters from this week as read.” (works only with the Flag / label / move permission enabled)
ToolWhat it doesWhen it is available
list_accountslist of mailboxes and permissionsalways
search, fetchsimplified search and read for ChatGPT and similar clientsRead & search
search_messagessearch in one mailbox or all of themRead & search
get_message, get_threadreads a message and a whole threadRead & search
get_attachmentattachment as text, or a download link valid for an hourRead & search (downloadable attachments are the default)
create_draftsaves a draft, sends nothingCreate drafts
send_messagesends only to recipients on the allowlist, attachments includedSend + allowlist
send_draftsends a saved draft exactly as it is, attachments includedSend + allowlist
forward_messageforwards a message with all its attachments (or saves it as a draft)Send + allowlist / Create drafts
upload_attachment, request_upload, list_uploadshanding a file to the assistant: text or base64 directly, larger files through a one-hour upload linkCreate drafts or Send
modify_messageread, starred, labels, move, archiveFlag / label / move
trash_messagemoves to trash, never a permanent deleteMove to trash

Attachments

Attachments do not load up the assistant's context. For every message the assistant gets a list of attachments and, for each one, a download link valid for one hour. You click it and the file downloads straight from the server (which fetches it from your mailbox at that moment) without ever passing through OpenAI or Anthropic. Text attachments (TXT, CSV, JSON, XML) can also be read by the assistant directly; the contents of any other file go into the context only when you explicitly ask (“load the contents of that attachment for me”, up to 2 MB). The link works for anyone who has it, for an hour, so pass it on as carefully as a password.

Limits you set during setup: the length of a message body per read (8,000 characters by default), how many messages may be sent per hour, and whether attachments are listed only or downloadable too.

Sending attachments

The assistant can send an attachment as well, and the file never goes through the chat. Three ways:

  • An attachment already in your mail: “Forward that invoice to accounting.” The assistant uses forward_message, or attaches one specific attachment to a draft or an outgoing message; the server takes it straight from the mailbox.
  • A file the assistant wrote: a contract, a CSV, a quote. The assistant hands it over with upload_attachment and attaches it.
  • A file from your disk: the assistant asks for a one-hour upload link (request_upload). Claude Code, Cursor or Gemini CLI can send the file themselves (curl -T file link); in ChatGPT or claude.ai you open the link and drop the file in. In Claude Desktop the path to a file in an allowed folder (attachment_dirs) is enough.

Uploaded files wait in the mailmcp-uploads folder of your mailbox (the server keeps nothing) and are deleted once attached. The limit is 20 MB per message; on Vercel an upload through a link handles roughly 4 MB per file, so send larger files by forwarding them from your mail, or run mailmcp in Docker.

Changing your configuration

Shared server: at the bottom of the setup page expand “Edit an existing configuration”, paste your current token and your edit password and click Load. The form fills itself in (the passwords are decrypted only in your browser). Add a mailbox or change permissions, click Generate my token again and put the new token into your clients in place of the old one (for ChatGPT and claude.ai: disconnect and connect again). The old token stops working as soon as you delete the app password it contains at your provider.

Your own single-user server: Settings → Environment Variables → edit MAILMCP_CONFIG → Deployments → Redeploy. Claude Desktop: Settings → Extensions → mailmcp → Configure.

To revoke access at any time: delete the app password at your provider (Google, Microsoft, Apple…). The server then cannot get into the mailbox, no matter who holds the token.

Troubleshooting

“List my accounts” works, but searching reports a sign-in error (Invalid credentials, AUTHENTICATIONFAILED)

A wrong or invalid app password. For Gmail check that two-step verification is on and that the password has 16 characters. Generate a new one, load the configuration in the setup page, fix the password and deploy again.

I forgot my edit password, or I never set one

The token cannot be loaded back. Create a new token from scratch on the setup page (entering the mailboxes again), this time with an edit password, and swap it in your assistants. You invalidate the old token by deleting the app password at your provider and creating a new one.

An attachment link does not work (“Download link is invalid or has expired”)

Links are valid for one hour. Ask the assistant to load the message again; you will get a fresh link.

The server shows “This server needs a license key”

The MAILMCP_LICENSE variable is missing or invalid, or the configuration exceeds the license (Personal: at most 5 mailboxes in the configuration and in every token; Unlimited has no cap). The page states the exact reason. After fixing the variable, hit Redeploy.

“Token was not issued by this server”

The token was created on a different server, or the operator changed the master key. Create a new token on the setup page of the server you are connecting to.

ChatGPT or Cursor complains that the header is too long

The token carries the whole configuration; with many accounts it can exceed the header limit of some clients (roughly 8 kB). Create a token holding only the mailboxes you need in that client, or use the OAuth sign-in, where the limit does not apply.

Claude says the account “does not allow send/draft/modify”

That permission is not enabled for that mailbox. Turn it on in the setup (Edit existing) and update the configuration. This is by design: the default state is read-only.

“Recipient not in send_allowlist”

Sending is allowed, but the recipient is not on the list. Add the address or the domain (@company.com) to the allowlist, or let Claude create a draft and send it yourself.

The Vercel page shows the error “No configuration” or “Could not decrypt”

The MAILMCP_CONFIG and MAILMCP_KEY variables are missing, come from different pairs, or you did not Redeploy after changing them. Check that the blob starts with mmc1. and that you copied the whole line with no extra spaces.

claude.ai connector: “Unknown client_id”, or the sign-in ends with an error

Open the connector URL without /mcp in a browser; the home page has to appear. Then remove the connector in claude.ai and add it again. The address has to be exactly the one from Vercel, including https:// and with /mcp at the end.

The connector is added, but Claude “sees” no tools

In the connector settings in claude.ai check that it is enabled for the current chat (the connector icon under the message box). Failing that, sign out and connect again with the connector password.

The connection is slow, or the first query times out

On Vercel every query signs in to the IMAP server again, so expect 1 to 3 seconds. Try the query again; when searching all accounts, narrow the period (“over the last week”, for example).

Gmail: Claude searches “All Mail”, not just the inbox

That is by design: everything including the archive is searched. Say “in the inbox only” or use the Gmail operator in:inbox.

I want to know exactly what the server sends where

The server talks only to your mail servers and to your client (ChatGPT, Claude). No telemetry, no phoning home; the license is verified locally only. The distribution repository is on GitHub; the source code for review (by a DPO, for example) is provided to customers on request.

Security in five sentences

The server has been through a security audit (cryptography, OAuth, the mail layer, the web, operations). The known limitations of the stateless design, which the audit confirmed: the protection against replaying an authorization code holds within a single instance (the code is valid for 3 minutes and is protected by PKCE), access tokens are valid for 30 days (because of ChatGPT, which does not refresh them itself) and cannot be revoked individually before they expire (refresh tokens last 90 days); the only immediate revocation is deleting the app password at your provider, sign-in attempt limits are counted per server instance, and attachment links are valid for an hour for anyone holding them.

  • E-mail is untrusted content: the server strips hidden text and marks message bodies as data, so that a forged e-mail cannot “instruct” Claude. Even so: check whatever Claude proposes to send.
  • Start with read-only and drafts. Turn sending on only with a narrow allowlist.
  • Keep your token in a password manager, like a password. Whoever holds it can read your mail through this server; without the server's master key, though, it is unreadable for anyone else (OpenAI and Anthropic included). A token on its own never hands over your mail passwords: loading it back into the form also requires the edit password, which assistants never see.
  • Use app passwords, not your main account password. They can be revoked at any time with one click.
  • Signing in to the connector is limited to 5 attempts per 15 minutes; access tokens are valid for 30 days and refresh automatically.

Napojte svou poštu na Claude nebo ChatGPT. Krok za krokem.

Od prvního hesla pro aplikace po první dotaz „co mi tento týden přišlo od účetní“. Sdílený server: 10 minut. Vlastní server pro firmu: dalších 15. Spěcháte? Zkrácená verze s přepínáním češtiny a angličtiny je na https://mailmcp.ai/start, a svého ChatGPT nebo Claude můžete nechat, ať vás provede: pošlete mu odkaz https://mailmcp.ai/llms.txt.

Co to je

mailmcp je malý server, který dává Claude nebo ChatGPT přístup k vašim e-mailovým schránkám: Gmail, Seznam.cz, Volný.cz, iCloud, Fastmail, Yahoo, Zoho nebo libovolný IMAP účet, klidně několik najednou. Claude pak umí poštu prohledávat, číst, shrnovat a připravovat odpovědi jako koncepty. Odesílání, přesouvání a mazání jsou vypnuté, dokud je sami nezapnete.

Zásadní rozdíl proti hotovým konektorům: hesla k poště nikdy neputují přes OpenAI ani Anthropic v čitelné podobě a server si je neukládá. Vaše nastavení cestuje v jednom zašifrovaném tokenu. Klíč k němu je rozdělený na dvě půlky: jedna je v tokenu, druhá (hlavní klíč) jen na serveru. Kdo má jen token (například logy u OpenAI), nepřečte nic. Kdo má jen hlavní klíč, nemá žádné nastavení. Rozšifrovat umí jen server v okamžiku, kdy pro vás vyřizuje požadavek.

KdoCo vidí
Vyvše
Váš poštovní provider (Google, Seznam…)to, co viděl vždy
OpenAI / Anthropic (ChatGPT, Claude)výsledky, které si asistent vyžádal, a váš token jako nečitelný šifrovaný text
Provozovatel sdíleného serveru (lektor, firma)hlavní klíč; vaše data jen v paměti během vašeho požadavku, nic v klidu
Hosting (Vercel)totéž co provozovatel
Autor mailmcpnic

Kterou cestu zvolit

Sdílený serverDoporučeno pro kurz. Použijete tento server (https://mailmcp.ai), vygenerujete si token a vložíte ho do ChatGPT, claude.ai, Claude Code nebo jiného klienta. Bez instalace, bez hostingu.
Vlastní serverChcete mít i hlavní klíč pod svou kontrolou (firma, tým). Nasadíte mailmcp do vlastního Vercel účtu s jedním tajemstvím; ostatní pak používají váš server stejně jako sdílený.
Jen můj počítačClaude Desktop nebo Claude Code lokálně. Nic neběží mimo váš počítač, ale nefunguje z mobilu ani z ChatGPT.

Kroky 1 až 3 popisují sdílený server. Vlastní server a lokální varianty jsou dál.

Krok 1 · Hesla k účtům

mailmcp se do schránek přihlašuje protokolem IMAP/SMTP, tedy stejně jako poštovní program v telefonu. Většina poskytovatelů k tomu vyžaduje heslo pro aplikace: speciální heslo, které vygenerujete a kdykoli zrušíte, aniž byste měnili hlavní heslo. Pro každou schránku si ho připravte teď.

Gmail

  1. Zapněte dvoufázové ověření: myaccount.google.com → Zabezpečení → Dvoufázové ověření. Bez něj Google hesla pro aplikace nenabídne.
  2. Otevřete myaccount.google.com/apppasswords, jako název zadejte mailmcp a klikněte na Vytvořit.
  3. Google ukáže 16 znaků ve čtyřech skupinách. Zkopírujte je (mezery nevadí). Toto heslo uvidíte jen jednou.
Pracovní účet Google Workspace: hesla pro aplikace musí povolit správce domény. Pokud volba chybí, požádejte IT, nebo použijte jiný účet.

Seznam.cz

  1. Přihlaste se na email.seznam.cz, vpravo nahoře Nastavení → Zabezpečení.
  2. Máte-li zapnuté dvoufázové ověření, vytvořte Heslo pro aplikace. Bez dvoufázového ověření použijte běžné heslo k účtu.

Volný.cz

Stačí běžné heslo k účtu. V nastavení webmailu Volný.cz zkontrolujte, že je povolený přístup přes IMAP.

iCloud

  1. account.apple.com → Přihlášení a zabezpečení → Hesla aplikací → Vytvořit.
  2. V setupu zadejte celou adresu (např. jana@icloud.com); rozdíl mezi IMAP a SMTP přihlášením mailmcp vyřeší sám.

Fastmail, Yahoo, Zoho

Všichni tři vyžadují heslo pro aplikace z nastavení zabezpečení účtu (Fastmail: Settings → Privacy & Security → Integrations). Fastmail na tarifu Basic přístup přes IMAP nenabízí.

Vlastní doména, firemní server

Připravte si adresu IMAP serveru a port (obvykle 993), adresu SMTP serveru a port (465 nebo 587), přihlašovací jméno a heslo. Najdete je v návodu vašeho hostingu pod heslem „nastavení poštovního klienta“.

Microsoft 365 a Outlook.com heslem většinou nejdou (Microsoft vyžaduje OAuth). Podpora se připravuje.

Krok 2 · Vytvoření tokenu

Otevřete https://mailmcp.ai/setup. Stránka běží ve vašem prohlížeči: hesla, která do ní napíšete, se zašifrují dřív, než cokoli opustí váš počítač. Na server odchází jen 32bajtový šifrovací klíč, který server zapečetí svým hlavním klíčem a vrátí. Nic se neukládá.

  1. Účty. Pro každou schránku zvolte poskytovatele, zadejte krátké Account id (např. osobni, firma; asistent ho bude používat v odpovědích), e-mailovou adresu a heslo z kroku 1. U vlastního serveru vyplňte i IMAP/SMTP údaje.
  2. Oprávnění. Zaškrtněte, co smí asistent s danou schránkou dělat. Doporučený začátek: Read & search a Create drafts. Odesílání zapínejte jen s allowlistem (např. @vasefirma.cz), jinak asistent odeslat nic nemůže.
  3. Heslo pro úpravy. Zvolte heslo, kterým později token načtete zpět, až budete chtít přidat schránku nebo změnit oprávnění. Asistenti ho nikdy nevidí, takže samotný token nikdy nevydá vaše poštovní hesla. Bez něj jde token později jen vytvořit znovu od začátku.
  4. Klikněte na Generate my token. Zkopírujte Your mailmcp token (dlouhý text začínající mmt1.). Uložte ho do správce hesel: kdo ho má, může přes tento server číst vaši poštu.
Bod „Options for your own single-owner deployment“ a hodnoty MAILMCP_CONFIG / MAILMCP_KEY na sdíleném serveru nepotřebujete. Slouží pro vlastní nasazení a Claude Desktop.

Krok 3 · Připojení klientů

Adresa serveru je https://mailmcp.ai/mcp. Token se používá dvěma způsoby: jako bearer token tam, kde klient umí hlavičky, nebo se vloží na přihlašovací stránce tam, kde klient používá OAuth.

ChatGPT

  1. Settings → Connectors (případně Apps & Connectors) → v pokročilém nastavení zapněte Developer mode. Vlastní konektory jsou v tarifech Plus, Pro, Business, Enterprise a Edu.
  2. Create → název „mailmcp“, URL https://mailmcp.ai/mcp.
  3. Ověření: buď OAuth (ChatGPT otevře přihlašovací stránku serveru, kam vložíte token), nebo pokud formulář nabízí bearer token, vložte token přímo tam. Nepřidávejte žádné další hlavičky ani proměnné.
  4. V chatu zapněte konektor a zkuste: „Vypiš mé poštovní účty.“

claude.ai (web, mobil, Claude Desktop)

  1. Settings → Connectors → Add custom connector, URL https://mailmcp.ai/mcp, uložit, Connect.
  2. Otevře se přihlašovací stránka serveru. Vložte svůj token a potvrďte. Konektor je pak aktivní i v mobilní aplikaci. Vyžaduje tarif Pro nebo vyšší.

Claude Code

claude mcp add --transport http mailmcp https://mailmcp.ai/mcp \
  --header "Authorization: Bearer mmt1.…celý token…"

Cursor, VS Code, Gemini CLI a další

Stejná adresa, token jako bearer hlavička nebo OAuth přihlášení. Přesné zápisy jsou v detailech pro jednotlivé klienty.

Vlastní sdílený server

Když chcete provozovat server pro sebe nebo pro tým, potřebujete dvě hodnoty: hlavní klíč MAILMCP_KEY a licenční klíč MAILMCP_LICENSE (Personal €4,99 pro jednoho a až 5 schránek; Unlimited €129 pro sdílený režim s tokeny; ceník na https://mailmcp.ai/pricing). Server si nic neukládá, takže nepotřebuje databázi; pro osobní použití stačí tarif Hobby na Vercelu zdarma, pro firemní Vercel Pro nebo Docker.

  1. Účty na github.com a vercel.com.
  2. Klikněte na tlačítko Deploy v průvodci https://mailmcp.ai/start: Vercel si zkopíruje distribuční repozitář kojott/mailmcp-dist do vašeho GitHubu a rovnou se zeptá na obě proměnné. (Ručně: Fork repozitáře a ve Vercelu Add New → Project → Import.)
  3. Do Environment Variables přidejte MAILMCP_LICENSE (klíč z e-mailu po nákupu) a MAILMCP_KEY: 32 náhodných bajtů v base64url. Vygenerujete je v terminálu příkazem node -e "console.log(require('crypto').randomBytes(32).toString('base64url'))" nebo na setup stránce v části pro vlastní nasazení (pole MAILMCP_KEY). Uložte klíč do správce hesel: jeho ztráta zneplatní všechny tokeny uživatelů.
  4. Deploy. Na adrese https://vas-projekt.vercel.app se ukáže úvodní stránka se sdíleným režimem, uživatelé si tokeny vytvoří na /setup.
Hlavní klíč nikdy neměňte bez domluvy s uživateli: každá změna zneplatní všechny vydané tokeny a všichni si musí vygenerovat nové.

Licence: jedna licence = jedna běžící instalace; přenést ji na jiný server můžete kdykoli. Podmínky včetně vrácení peněz do 60 dnů jsou v souboru LICENSE v repozitáři.

Uzavřená registrace: nastavte navíc proměnnou MAILMCP_INVITE_CODE. Tokeny pak na setup stránce vytvoří jen ten, kdo kód zná (zobrazí se pole „Pozvánkový kód“). Bez něj si na vašem serveru může token vytvořit kdokoli, kdo zná adresu, a čerpat vaše limity.

Vlastní reverzní proxy (Docker, VPS): nastavte MAILMCP_PUBLIC_URL na veřejnou adresu serveru. Bez ní server hlavičkám X-Forwarded-* nevěří (na Vercelu je věří automaticky).

Volitelně lze na vlastní server přidat i MAILMCP_CONFIG s vlastními schránkami provozovatele; pak funguje zároveň jako jednouživatelský (connector password, vlastní bearer token) i sdílený server.

Jen můj počítač · A · Claude Desktop

Pro lokální varianty potřebujete ze setup stránky hodnoty MAILMCP_CONFIG a MAILMCP_KEY z části „Values for your own deployment“, ne token.

  1. Stáhněte soubor mailmcp.mcpb z poslední verze na GitHubu.
  2. Poklepejte na něj (nebo v Claude Desktop: Settings → Extensions → Install Extension). Potřebujete nainstalovaný Node.js 20 nebo novější; Claude Desktop vás případně upozorní.
  3. Do formuláře vložte MAILMCP_CONFIG a MAILMCP_KEY. Uloží se do systémové klíčenky vašeho počítače.
  4. Otevřete nový chat a napište: „Vypiš mi mé poštovní účty.“ Claude by měl zavolat nástroj list_accounts.
V této variantě neběží nic mimo váš počítač. Když počítač spí, konektor nefunguje; pro mobil použijte cestu B.

B · Vlastní jednouživatelský server na Vercelu

Alternativa ke sdílenému serveru pro jednotlivce, který chce mít vše ve vlastním účtu, ale nechce nic instalovat. Postup je stejný jako u vlastního sdíleného serveru, jen místo hlavního klíče nastavíte dvě proměnné se svou konfigurací.

  1. Založte si účet na github.com a na vercel.com (přihlaste se přes GitHub, ušetříte kroky).
  2. Na GitHubu si vytvořte kopii distribučního repozitáře: na stránce github.com/kojott/mailmcp-dist klikněte na Fork (nebo použijte tlačítko Deploy na /start).
  3. Ve Vercelu: Add New → Project → Import a vyberte svůj fork mailmcp. Vercel rozpozná aplikaci sám; nic neměňte.
  4. Před kliknutím na Deploy rozbalte Environment Variables a přidejte MAILMCP_CONFIG a MAILMCP_KEY z kroku 2. (Když to zapomenete, doplníte je později v Settings → Environment Variables a v záložce Deployments zvolíte Redeploy.)
  5. Klikněte na Deploy. Za minutu dostanete adresu ve tvaru https://mailmcp-xyz.vercel.app. Otevřete ji: měla by se ukázat úvodní stránka s vašimi schránkami. Adresa /health vrací {"ok":true}.
  6. V claude.ai: Settings → Connectors → Add custom connector. Jako URL zadejte svou adresu s /mcp na konci, například https://mailmcp-xyz.vercel.app/mcp. Uložte a klikněte na Connect.
  7. Otevře se přihlašovací stránka vašeho serveru. Zadejte connector password ze setupu (ne heslo k e-mailu). Po potvrzení je konektor aktivní i v mobilní aplikaci a v Claude Desktop.
Custom connectors jsou dostupné v tarifech Claude Pro, Max, Team a Enterprise. V Team/Enterprise je přidává vlastník organizace.

C · Claude Code lokálně

Proti sdílenému serveru stačí příkaz z kroku 3. Lokálně bez hostingu (vyžaduje Node.js 22+):

claude mcp add mailmcp -e MAILMCP_CONFIG="mmc1..." -e MAILMCP_KEY="..." -- npx -y mailmcp

Ověření: claude mcp list ukáže mailmcp jako připojený.

Detaily pro ChatGPT, Cursor, VS Code, Gemini CLI a další

Všechny nástroje se připojují na adresu končící /mcp. Dva způsoby přihlášení: OAuth (klient otevře přihlašovací stránku serveru, kam vložíte token) nebo bearer token v hlavičce, kam vložíte tentýž token. Příklady níže používají adresu vlastního serveru; na sdíleném serveru dosaďte https://mailmcp.ai/mcp.

ChatGPT

  1. V ChatGPT otevřete Settings → Connectors (v některých verzích Settings → Apps & Connectors) a v pokročilém nastavení zapněte Developer mode. Vlastní konektory jsou dostupné v tarifech Plus, Pro, Business, Enterprise a Edu.
  2. Klikněte na Create (nebo +), zadejte název „mailmcp“ a jako URL svou adresu s /mcp, například https://mailmcp-xyz.vercel.app/mcp. Ověření nechte na OAuth.
  3. ChatGPT vás přesměruje na přihlašovací stránku serveru. Vložte svůj token (na vlastním jednouživatelském serveru connector password).
  4. V chatu zapněte konektor v nabídce nástrojů. ChatGPT používá nástroje search a fetch, které mailmcp pro něj má připravené: „search“ prohledá všechny schránky jedním dotazem (u Gmailu funguje i Gmail syntaxe, jednu schránku vyberete předponou account:firma), „fetch“ přečte konkrétní zprávu. V Developer mode má ChatGPT k dispozici i všechny ostatní nástroje včetně konceptů.
ChatGPT vyžaduje PKCE, dynamickou registraci klienta nebo Client ID Metadata Document a potvrzení vydavatele v přesměrování. mailmcp to vše splňuje, nic dalšího nenastavujete.

Cursor

Soubor ~/.cursor/mcp.json (globálně) nebo .cursor/mcp.json v projektu:

{
  "mcpServers": {
    "mailmcp": {
      "url": "https://mailmcp-xyz.vercel.app/mcp",
      "headers": { "Authorization": "Bearer mmt1.…celý token…" }
    }
  }
}

Bez hlavičky headers Cursor spustí OAuth přihlášení v prohlížeči; obě varianty fungují.

VS Code (GitHub Copilot)

Příkaz MCP: Add Server → HTTP → adresa https://mailmcp-xyz.vercel.app/mcp. VS Code při prvním připojení otevře prohlížeč s přihlášením (OAuth). Ruční zápis do mcp.json:

{
  "servers": {
    "mailmcp": {
      "type": "http",
      "url": "https://mailmcp-xyz.vercel.app/mcp"
    }
  }
}

Gemini CLI

gemini mcp add --transport http --header "Authorization: Bearer mmt1.…celý token…"   mailmcp https://mailmcp-xyz.vercel.app/mcp

Nebo v ~/.gemini/settings.json jako "mailmcp": { "httpUrl": "https://…/mcp", "headers": { "Authorization": "Bearer …" } }.

Windsurf, Zed, Continue, JetBrains a další

Kdekoli lze zadat „remote MCP server“ se Streamable HTTP adresou a hlavičkou Authorization: Bearer …, funguje stejný zápis jako u Cursoru. Klienti, kteří umí OAuth, se přihlásí connector passwordem.

Jak s tím pracovat

Mluvte s Claude normálně; nástroje si vybírá sám. Osvědčené dotazy:

  • „Vypiš mi mé poštovní účty a co s nimi smíš dělat.“
  • „Co mi přišlo za poslední tři dny přes všechny účty? Rozděl to podle účtů a řekni, co vyžaduje odpověď.“
  • „Najdi v pracovním účtu faktury z tohoto měsíce s přílohou.“ (Gmail rozumí i dotazům jako from:ucetni has:attachment newer_than:30d.)
  • „Přečti mi poslední zprávu od Nováka a připrav zdvořilou odpověď jako koncept.“ Koncept najdete ve složce Koncepty svého poštovního programu a odešlete ho sami.
  • „Označ všechny newslettery z tohoto týdne jako přečtené.“ (funguje jen se zapnutým oprávněním Flag / label / move)
NástrojCo děláKdy je k dispozici
list_accountsseznam schránek a oprávněnívždy
search, fetchzjednodušené hledání a čtení pro ChatGPT a spol.Read & search
search_messageshledání v jedné nebo všech schránkáchRead & search
get_message, get_threadpřečtení zprávy a celého vláknaRead & search
get_attachmentpříloha jako text, nebo odkaz ke stažení platný hodinuRead & search (přílohy ke stažení jsou výchozí)
create_draftuloží koncept, nic neodesíláCreate drafts
send_messageodešle jen adresátům z allowlistu, i s přílohamiSend + allowlist
send_draftodešle uložený koncept tak, jak je, včetně přílohSend + allowlist
forward_messagepřepošle zprávu včetně všech příloh (nebo uloží jako koncept)Send + allowlist / Create drafts
upload_attachment, request_upload, list_uploadspředání souboru asistentovi: text nebo base64 rovnou, větší soubory přes hodinový odkaz k nahráníCreate drafts nebo Send
modify_messagepřečteno, hvězdička, štítky, přesun, archivFlag / label / move
trash_messagepřesun do koše, nikdy trvalé smazáníMove to trash

Přílohy

Přílohy nezatěžují kontext asistenta. U každé zprávy dostane asistent seznam příloh a ke každé odkaz ke stažení platný jednu hodinu. Kliknete a soubor se stáhne přímo ze serveru (ten ho v tu chvíli vyzvedne z vaší schránky), aniž by prošel přes OpenAI nebo Anthropic. Textové přílohy (TXT, CSV, JSON, XML) umí asistent přečíst i přímo; obsah jiného souboru vloží do kontextu jen když o to výslovně požádáte („načti mi obsah té přílohy“, do 2 MB). Odkaz funguje pro kohokoli, kdo ho má, hodinu; přeposílejte ho proto jako heslo.

Limity, které v setupu nastavíte: délka těla zprávy na jedno čtení (výchozí 8 000 znaků), počet odeslání za hodinu, přílohy jen jako seznam nebo i ke stažení.

Odesílání příloh

Asistent umí přílohu i poslat, a soubor přitom nikdy neprochází chatem. Tři cesty:

  • Příloha, která už v poště je: „Přepošli tu fakturu účetní.“ Asistent použije forward_message nebo přiloží konkrétní přílohu ke konceptu či odeslané zprávě; server si ji vezme přímo ze schránky.
  • Soubor, který asistent napsal: smlouva, CSV, nabídka. Asistent ho předá nástrojem upload_attachment a přiloží.
  • Soubor z vašeho disku: asistent si vyžádá hodinový odkaz k nahrání (request_upload). Claude Code, Cursor nebo Gemini CLI na něj soubor pošlou samy (curl -T soubor odkaz); v ChatGPT nebo claude.ai odkaz otevřete a soubor přetáhnete. V Claude Desktop stačí cesta k souboru v povolené složce (attachment_dirs).

Nahrané soubory čekají ve složce mailmcp-uploads vaší schránky (server nic nedrží) a po přiložení se smažou. Limit je 20 MB na zprávu; na Vercelu projde nahráním přes odkaz zhruba 4 MB na soubor, větší soubory pošlete přeposláním z pošty nebo z Dockeru.

Změna konfigurace

Sdílený server: na setup stránce dole rozbalte „Edit an existing configuration“, vložte svůj současný token a heslo pro úpravy a klikněte Load. Formulář se předvyplní (hesla se rozšifrují jen ve vašem prohlížeči). Přidejte schránku nebo změňte oprávnění, znovu klikněte Generate my token a nový token vložte do klientů místo starého (u ChatGPT a claude.ai: odpojit a znovu připojit). Starý token přestane fungovat, jakmile u poskytovatele smažete heslo pro aplikace, které obsahuje.

Vlastní jednouživatelský server: Settings → Environment Variables → upravte MAILMCP_CONFIG → Deployments → Redeploy. Claude Desktop: Settings → Extensions → mailmcp → Configure.

Zrušení přístupu kdykoli: smažte heslo pro aplikace u poskytovatele (Google, Seznam…). Server se pak do schránky nedostane, ať má token kdokoli.

Řešení potíží

„Vypiš mi účty“ funguje, ale hledání hlásí chybu přihlášení (Invalid credentials, AUTHENTICATIONFAILED)

Špatné nebo neplatné heslo pro aplikace. U Gmailu ověřte, že je zapnuté dvoufázové ověření a heslo má 16 znaků. Vygenerujte nové, v setupu načtěte konfiguraci, opravte heslo a nasaďte znovu.

Zapomněl jsem heslo pro úpravy, nebo jsem ho nezadal

Token pak nejde načíst zpět. Vytvořte na setup stránce nový token od začátku (schránky zadáte znovu), tentokrát s heslem pro úpravy, a v asistentech ho vyměňte. Starý token zneplatníte tak, že u poskytovatele smažete heslo pro aplikace a vytvoříte nové.

Odkaz na přílohu nefunguje („Download link is invalid or has expired“)

Odkazy platí hodinu. Požádejte asistenta, aby zprávu načetl znovu; dostanete nový odkaz.

Server ukazuje „Tento server potřebuje licenční klíč“

Chybí nebo je neplatná proměnná MAILMCP_LICENSE, nebo konfigurace překračuje licenci (Personal: nejvýš 5 schránek v konfiguraci i v každém tokenu; bez limitu je Unlimited). Stránka říká přesný důvod. Po opravě proměnné dejte Redeploy.

„Token was not issued by this server“

Token byl vytvořen na jiném serveru, nebo provozovatel změnil hlavní klíč. Vytvořte nový token na setup stránce toho serveru, ke kterému se připojujete.

ChatGPT nebo Cursor hlásí, že hlavička je příliš dlouhá

Token nese celou konfiguraci; s mnoha účty může přesáhnout limit hlavičky některých klientů (zhruba 8 kB). Vytvořte token jen pro schránky, které v daném klientovi potřebujete, nebo použijte OAuth přihlášení, kde limit neplatí.

Claude říká, že účet „does not allow send/draft/modify“

Pro tu schránku není oprávnění zapnuté. Zapněte ho v setupu (Edit existing) a aktualizujte konfiguraci. Toto je záměr: výchozí stav je jen čtení.

„Recipient not in send_allowlist“

Odesílání je povolené, ale adresát není na seznamu. Přidejte adresu nebo doménu (@firma.cz) do allowlistu, nebo nechte Claude vytvořit koncept a odešlete ho sami.

Vercel stránka ukazuje chybu „No configuration“ nebo „Could not decrypt“

Proměnné MAILMCP_CONFIG a MAILMCP_KEY chybí, jsou z jiné dvojice, nebo jste po jejich změně nespustili Redeploy. Zkontrolujte, že blob začíná mmc1. a že jste zkopírovali celý řádek bez mezer navíc.

claude.ai konektor: „Unknown client_id“ nebo přihlášení skončí chybou

Otevřete URL konektoru bez /mcp v prohlížeči; musí se ukázat úvodní stránka. Pak konektor v claude.ai odeberte a přidejte znovu. Adresa musí být přesně ta z Vercelu, včetně https:// a s /mcp na konci.

Konektor je přidaný, ale Claude „nevidí“ žádné nástroje

V nastavení konektoru v claude.ai zkontrolujte, že je zapnutý pro aktuální chat (ikona konektorů pod polem pro zprávu). Případně se odhlaste a znovu připojte connector passwordem.

Připojení je pomalé nebo první dotaz vyprší

Na Vercelu se každý dotaz přihlašuje k IMAP serveru znovu, počítejte s 1 až 3 sekundami. Zkuste dotaz zopakovat; při hledání ve všech účtech omezte období (např. „za poslední týden“).

Gmail: Claude hledá v „All Mail“, ne jen v doručené poště

To je záměr: prohledává se vše včetně archivu. Řekněte „jen v doručené poště“ nebo použijte Gmail výraz in:inbox.

Chci vědět, co přesně server odesílá kam

Server komunikuje jen s vašimi poštovními servery a s klientem (ChatGPT, Claude). Žádná telemetrie, žádné volání domů; licence se ověřuje jen lokálně. Na GitHubu je distribuční repozitář; zdrojový kód k prověření (např. pro DPO) poskytneme zákazníkům na vyžádání.

Bezpečnost v pěti větách

Server prošel bezpečnostním auditem (kryptografie, OAuth, poštovní vrstva, web, provoz). Známá omezení bezstavového návrhu, která audit potvrdil: ochrana proti opakovanému použití autorizačního kódu platí v rámci jedné instance (kód platí 3 minuty a je chráněn PKCE), přístupové tokeny platí 30 dní (kvůli ChatGPT, který je sám neobnovuje) a nejde je jednotlivě odvolat před vypršením (obnovovací 90 dní); jediné okamžité odvolání je smazání hesla pro aplikace u poskytovatele, limity pokusů o přihlášení se počítají per instance serveru, odkazy na přílohy platí hodinu pro kohokoli, kdo je má.

  • E-mail je nedůvěryhodný obsah: server odstraňuje skrytý text a označuje těla zpráv jako data, aby podvržený e-mail nemohl Claude „instruovat“. Přesto platí: co Claude navrhne odeslat, zkontrolujte.
  • Začněte s právy jen na čtení a koncepty. Odesílání zapněte až s úzkým allowlistem.
  • Token držte ve správci hesel jako heslo. Kdo ho má, může přes tento server číst vaši poštu; bez hlavního klíče serveru je ale pro kohokoli jiného (včetně OpenAI a Anthropic) nečitelný. Samotný token nikdy nevydá vaše poštovní hesla: k načtení zpět do formuláře je potřeba i heslo pro úpravy, které asistenti nevidí.
  • Používejte hesla pro aplikace, ne hlavní heslo k účtu. Jdou kdykoli zrušit jedním kliknutím.
  • Přihlášení do konektoru je omezené na 5 pokusů za 15 minut; přístupové tokeny platí 30 dní a obnovují se automaticky.