AI and MCP
Translate, write and summarise mail, connect AI clients to your mailbox, call MCP tools, and ask the docs.
AI commands
| Command | What it does | Sign-in |
|---|---|---|
| ai translate | Translate a subject and body without sending anything | Either kind, with emails:send |
| ai languages | List every language translation accepts | Any, or none: signed out it prints the table built into the CLI |
| ai compose "<prompt>" | Write an email body in your own style | A browser sign-in |
| ai summarize <thread-id> | Print the summary OpenEmail keeps for a thread | A browser sign-in |
translate and compose each spend one AI action from the workspace allowance for the day, and a spent allowance stops with exit code 8. compose and summarize run through the MCP tools composeEmail and getThreadSummary, which is why they need a browser sign-in: an API key cannot reach the MCP server.
Translate
openemail ai translate --to de --subject "Your invoice" --text "The invoice is attached."openemail ai translate --to Japanese --body-file reply.html --no-originalcat notes.txt | openemail ai translate --to fropenemail ai languages --search portIt runs the translation a translated send would run and prints the result, so you can read it before anything leaves. Nothing is stored or sent. --to takes a code, an English name or the language’s own name. The body comes from --text, --html, --body-file or stdin, and --text and --html also read a file with @path.
- Your original text is kept below the translation, unless you pass
--no-original. - The detected source language is printed on stderr, and
--jsonprints the whole translation. - To translate as you send, use
openemail send --translate de.
Write and summarise
openemail ai compose "thank Ada for the invoice and ask for a PDF copy" --to [email protected]openemail ai compose "say yes to Tuesday at 3pm" --thread CAHk7pQ2x9LmZ4 --tone friendlyopenemail ai compose "decline politely" --thread CAHk7pQ2x9LmZ4 | openemail send --to [email protected] --subject "Re: Proposal"openemail ai summarize CAHk7pQ2x9LmZ4composeprints a body written in your style and sends nothing, so pipe it intoopenemail sendwhen you are happy with it. With--threadit reads the latest messages of the thread first and writes a reply.--toneis one offormal,friendly,casual,concise,directorwarm.summarizeprints the summary with the subject, sender and date. Summaries are written when mail arrives, and a thread that holds an encrypted message has none, which exits with code5.
Connect an AI client
The OpenEmail MCP server gives an AI client the tools the assistant in the app uses: it can read and send mail and manage contacts, templates, domains and more, limited to what you approve. A client connects in one of two ways, and openemail mcp config prints both for the client you use:
- The remote server. The client runs its own browser sign-in, you approve it on the OpenEmail consent page, and it appears in Account → Connected apps. This is the simpler choice when the client supports it.
- The local bridge,
openemail mcp serve, which the client starts throughnpx. It uses the sign-in of this CLI, so runopenemail loginfirst. It suits clients that only start local servers.
openemail mcp configopenemail mcp config --client claude-codeopenemail mcp config --client cursor --profile workopenemail mcp config --client vscode --jsonclaude mcp add --transport http openemail https://api.openemail.uk/mcpclaude mcp add openemail -- npx -y @openemail/cli mcp serveAfter adding the remote server, Claude Code signs in from /mcp and Codex with codex mcp login openemail. Claude Desktop adds it under Settings → Connectors → Add custom connector. openemail mcp config --client <name> also says which file each client reads.
The local bridge
openemail mcp serve reads newline-delimited JSON-RPC on stdin, forwards each message to the MCP server with your saved browser sign-in, and writes each answer to stdout as one line. It refreshes an expired access token without the client noticing, answers a batch as one array, and stops when stdin closes. Only protocol reaches stdout, and stderr stays quiet unless you pass --debug.
echo '{"jsonrpc":"2.0","id":1,"method":"tools/list"}' | openemail mcp serveopenemail mcp serve --profile workopenemail mcp serve --debug 2> mcp.logThe bridge cannot ask for a verification code over stdio. A tool that needs one reaches the client as a refusal, and the bridge prints one hint on stderr. Run openemail verify in a terminal with the same profile, and those tools run for the next 60 minutes.
Call tools yourself
openemail mcp toolsopenemail mcp tools composeEmailopenemail mcp call whoAmIopenemail mcp call listThreads --arg folder=inbox --arg maxResults=5openemail mcp call getThread --args '{"threadId":"CAHk7pQ2x9LmZ4"}'mcp toolslists the tools this sign-in may use, which already leaves out any your role or the approval does not allow. Name a tool to see its description and arguments.mcp calltakes the arguments as one JSON object in--args(inline,@fileor-), and--arg key=valuesets one at a time. A value is read as JSON when it parses, so quote a number you mean as text.- The MCP server never asks for confirmation, so a tool that sends or deletes acts at once.
- A result that starts with
Refused (exits with code4. An unknown tool exits with5, invalid arguments with7, and a spent AI allowance with8.
Six tools make a change the REST API guards with a verification code, and they ask for the same code: createRule, setRuleEnabled, removeDomain, removeDomainAddress, deleteAudience for an audience you created, and emptyAudience for an audience you created that still has contacts. In a terminal, mcp call asks for the code and calls the tool again. Unattended it exits with code 4, so run openemail verify first.
Ask the docs
openemail docs ask "how do I verify a domain?"openemail docs open cli/authenticationopenemail docs read cli/commandsopenemail docs readdocs askputs a question to the docs assistant and prints the answer as it is written, then the pages it came from. It answers only from this documentation, needs no sign-in and never sends your credentials. A question can be up to 600 characters, and each network can ask a limited number a day.docs openopens a page in your browser, and--printprints its link instead.docs readprints a page as Markdown. With no page it prints the index of every page.