Enables AI agents to send and receive real emails and SMS, manage inboxes, and handle verification codes through natural language.
Also known as agenticmail/agenticmail, @agenticmail/mcp
- Stars
- 254
- Tools
- 65
- Downloads, 30 days
- 821
- Latest version
- 0.9.30
- Last commit
- Nov 13, 2026
- License
- MIT
What is AgenticMail MCP?
AgenticMail is an MCP server. Enables AI agents to send and receive real emails and SMS, manage inboxes, and handle verification codes through natural language. It exposes 65 tools, such as request_tools, invoke, send_email.
Summary generated from the project's README
About AgenticMail MCP server
Communicating via email and SMS through natural language is what developers achieve by connecting AI agents to the AgenticMail system. This MCP server acts as a bridge, providing 100 tools that allow an AI client to manage inboxes, send messages, reply to threads, and handle verification codes. It is designed for use with MCP-compatible clients like Claude Code, ChatGPT, Cursor, or Grok.
The server typically runs in stdio mode as a subprocess, meaning it communicates via standard input and output without opening network ports. For specialized environments like remote development tunnels or browser-based clients, it offers an optional HTTP transport mode that requires a bearer token for security. To function, the setup requires an AgenticMail API URL and an API key, with an optional master key for administrative tasks and account management.
What distinguishes this server is its ability to handle multi-agent coordination. It includes specialized tools like get_thread_id and save_thread_memory to help agents maintain context without re-reading entire message histories. It also supports per-call identity switching, allowing a single server instance to act as different agents by passing an account name during tool execution.
What you can do with it
- 1Automated email and SMS communicationAn AI agent can send emails with attachments or text messages to specific recipients using natural language commands.
- 2Efficient multi-agent coordinationDevelopers can use the wake parameter to ensure only specific agents are activated by a new email, saving on token usage.
- 3Managing multiple agent identitiesA single MCP server can manage various identities by switching accounts on a per-call basis.
- 4Optimizing agent memory and contextAgents can save summaries of conversations to avoid the high cost of re-reading long message threads.
Written from the project's README. Every use case is checked against a quote from it.
How to install AgenticMail MCP
Formats verified 10 Nov 2026Install AgenticMail MCP in Claude Code
$ claude mcp add --env AGENTICMAIL_API_KEY=<YOUR_AGENTICMAIL_API_KEY> --env AGENTICMAIL_MASTER_KEY=<YOUR_AGENTICMAIL_MASTER_KEY> mcp -- npx -y @agenticmail/mcpInstall AgenticMail MCP in Cursor
~/.cursor/mcp.json
{
"mcpServers": {
"mcp": {
"command": "npx",
"args": [
"-y",
"@agenticmail/mcp"
],
"env": {
"AGENTICMAIL_API_KEY": "<YOUR_AGENTICMAIL_API_KEY>",
"AGENTICMAIL_MASTER_KEY": "<YOUR_AGENTICMAIL_MASTER_KEY>"
}
}
}
}Install AgenticMail MCP in VS Code
.vscode/mcp.json
{
"servers": {
"mcp": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"@agenticmail/mcp"
],
"env": {
"AGENTICMAIL_API_KEY": "<YOUR_AGENTICMAIL_API_KEY>",
"AGENTICMAIL_MASTER_KEY": "<YOUR_AGENTICMAIL_MASTER_KEY>"
}
}
}
}Install AgenticMail MCP in Claude Desktop
claude_desktop_config.json
{
"mcpServers": {
"mcp": {
"command": "npx",
"args": [
"-y",
"@agenticmail/mcp"
],
"env": {
"AGENTICMAIL_API_KEY": "<YOUR_AGENTICMAIL_API_KEY>",
"AGENTICMAIL_MASTER_KEY": "<YOUR_AGENTICMAIL_MASTER_KEY>"
}
}
}
}Install AgenticMail MCP in Codex
~/.codex/config.toml
[mcp_servers.mcp] command = "npx" args = ["-y", "@agenticmail/mcp"] [mcp_servers.mcp.env] AGENTICMAIL_API_KEY = "<YOUR_AGENTICMAIL_API_KEY>" AGENTICMAIL_MASTER_KEY = "<YOUR_AGENTICMAIL_MASTER_KEY>"
Install AgenticMail MCP in Gemini CLI
~/.gemini/settings.json
{
"mcpServers": {
"mcp": {
"command": "npx",
"args": [
"-y",
"@agenticmail/mcp"
],
"env": {
"AGENTICMAIL_API_KEY": "<YOUR_AGENTICMAIL_API_KEY>",
"AGENTICMAIL_MASTER_KEY": "<YOUR_AGENTICMAIL_MASTER_KEY>"
}
}
}
}AgenticMail MCP tools 65
Detected from the READMErequest_toolsinvokesend_emaillist_inboxread_emailreply_emailforward_emailsearch_emailsdelete_emailmove_emailmark_readmark_unread
| request_tools | — | |
| invoke | — | |
| send_email | — | |
| list_inbox | — | |
| read_email | — | |
| reply_email | — | |
| forward_email | — | |
| search_emails | — | |
| delete_email | — | |
| move_email | — | |
| mark_read | — | |
| mark_unread | — |
Show all 65 toolsShow fewer tools
inbox_digestwait_for_emailimport_relay_emailbatch_deletebatch_mark_readbatch_mark_unreadbatch_movebatch_readmanage_contactsmanage_draftsmanage_tagsmanage_rulesmanage_signaturesmanage_templatesmanage_scheduledmanage_spammanage_pending_emailstemplate_sendcreate_folderlist_folderlist_folderscheck_healthlist_agentsmessage_agentcheck_messagescall_agentclaim_tasksubmit_resultcheck_taskscreate_accountdelete_agentstop_agentresume_agentcleanup_agentsdeletion_reportsupdate_metadatawhoamisetup_paymentcheck_gateway_statussetup_email_relaysetup_email_domainsetup_gmail_aliassetup_guidesend_test_emailpurchase_domainsms_setupsms_sendsms_messagessms_check_codesms_read_voicesms_recordsms_parse_emailsms_config
| inbox_digest | — | |
| wait_for_email | — | |
| import_relay_email | — | |
| batch_delete | — | |
| batch_mark_read | — | |
| batch_mark_unread | — | |
| batch_move | — | |
| batch_read | — | |
| manage_contacts | — | |
| manage_drafts | — | |
| manage_tags | — | |
| manage_rules | — | |
| manage_signatures | — | |
| manage_templates | — | |
| manage_scheduled | — | |
| manage_spam | — | |
| manage_pending_emails | — | |
| template_send | — | |
| create_folder | — | |
| list_folder | — | |
| list_folders | — | |
| check_health | — | |
| list_agents | — | |
| message_agent | — | |
| check_messages | — | |
| call_agent | — | |
| claim_task | — | |
| submit_result | — | |
| check_tasks | — | |
| create_account | — | |
| delete_agent | — | |
| stop_agent | — | |
| resume_agent | — | |
| cleanup_agents | — | |
| deletion_reports | — | |
| update_metadata | — | |
| whoami | — | |
| setup_payment | — | |
| check_gateway_status | — | |
| setup_email_relay | — | |
| setup_email_domain | — | |
| setup_gmail_alias | — | |
| setup_guide | — | |
| send_test_email | — | |
| purchase_domain | — | |
| sms_setup | — | |
| sms_send | — | |
| sms_messages | — | |
| sms_check_code | — | |
| sms_read_voice | — | |
| sms_record | — | |
| sms_parse_email | — | |
| sms_config | — |
Configuration
AGENTICMAIL_API_KEYSecretPer-agent API key issued when you create the agent. Scopes every tool call to that agent's mailbox and outbound. Either AGENTICMAIL_API_KEY or AGENTICMAIL_MASTER_KEY must be set.
AGENTICMAIL_MASTER_KEYSecretMaster key for admin operations (creating agents, listing all accounts, deleting agents). Set this when the MCP client needs admin tools; otherwise prefer the per-agent AGENTICMAIL_API_KEY.
AGENTICMAIL_API_URLBase URL of the AgenticMail HTTP API. Defaults to http://127.0.0.1:3100 (the port the local CLI binds). Override when the API runs on a different host or port.
| Name | Description | |
|---|---|---|
| AGENTICMAIL_API_KEY | Per-agent API key issued when you create the agent. Scopes every tool call to that agent's mailbox and outbound. Either AGENTICMAIL_API_KEY or AGENTICMAIL_MASTER_KEY must be set. | Secret |
| AGENTICMAIL_MASTER_KEY | Master key for admin operations (creating agents, listing all accounts, deleting agents). Set this when the MCP client needs admin tools; otherwise prefer the per-agent AGENTICMAIL_API_KEY. | Secret |
| AGENTICMAIL_API_URL | Base URL of the AgenticMail HTTP API. Defaults to http://127.0.0.1:3100 (the port the local CLI binds). Override when the API runs on a different host or port. |
Automated checks
Ran Nov 12, 2026Full report →Passed our automated checks. That is not a security audit: read the code and give the server the narrowest access it needs. How checks work
- Source repository linked and reachablePass
- Open source license (OSI)Pass
- Commit or release in the last yearPass
- Package name not close to a popular packagePass
- Remote endpoint uses HTTPSNot checked
- Destructive tools are labelledNot checked
- No hidden instructions to the modelPass
- No critical advisory in the package or its dependenciesPass
README
View on GitHubThe MCP (Model Context Protocol) server for AgenticMail — gives any MCP-compatible AI client full email and SMS capabilities.
When connected, your AI agent can send emails and texts, check inboxes, reply to messages, receive verification codes, manage contacts, schedule emails, assign tasks to other agents, and more — all through natural language. The server provides 100 tools that cover every email, SMS, and agent management operation.
✨ Security — 0.9.27
Fixes GHSA-63gr-g7jc-v8rg — missing authentication on the optional Streamable HTTP transport (--http / MCP_HTTP=1).
--httpmode now binds to127.0.0.1by default and requiresAuthorization: Bearer <token>on every/mcprequest.- The bearer token is auto-minted on first start and persisted to
~/.agenticmail/mcp-http-token(chmod 600). Override withMCP_HTTP_TOKENenv or--token=<value>. - Bind to other interfaces with
--host=0.0.0.0orMCP_HTTP_HOST=...— startup logs an explicit warning when the endpoint is reachable from the network. --insecurebrings back the old no-auth behavior for sandboxed test environments only. Startup prints a loud warning.- Stdio mode (the default) was never affected.
If you weren't using --http / MCP_HTTP=1, no action is needed.
✨ What's new in 0.9.0
- 🧠
get_thread_id+save_thread_memory— two new tools in themulti_agent_extrastier. Workers callget_thread_id({uid})once after reading a new message, thensave_thread_memory({threadId, summary, commitments?, openQuestions?, lastAction?, lastUid?})at end-of-wake. The dispatcher reads the memory back into the next wake's prompt automatically. Pairs with the dispatcher-side ThreadCache to flatten wake cost — agents no longer have to re-read 10 prior messages every time. - 🎯
send_email/reply_email/forward_email/template_senddocs updated for the newwakedefaults. CC'd local agents no longer wake by default;wake: 'all'opts back into the pre-0.9.0 behaviour.
✨ Earlier — 0.7.9
- 📐
call_agentacceptsoutputSchema— pass a JSON Schema (draft-7 subset) describing the deliverable shape and the API validatessubmit_resultagainst it; mismatches come back as validator errors so the worker can retry with a correct shape instead of returning free-form prose. The schema is rendered into the worker's wake prompt up-front. Example:await call_agent({ target: 'vesper', task: 'Audit row 34 of the YAML patch.', outputSchema: { type: 'object', required: ['summary', 'findings', 'recommendation'], properties: { summary: { type: 'string' }, findings: { type: 'array', items: { type: 'string' } }, recommendation: { type: 'string', enum: ['proceed', 'block'] }, }, }, }); - 📥
tail_worker(workerId, lines?)— paired withcheck_activity. When a worker shows up as long-running or stale,tail_workerreturns the trailing N lines of its log (every tool call, result, and assistant chunk as a one-liner). Master-key only. Lives in themulti_agent_extrastier so it ships in the default toolbelt for hosts that delegate work. - 📊
check_activityshows live progress — output now includes last tool used, tool-call count, duration inXh Ym Zs, and astaleflag derived from heartbeat age. Workers are no longer auto-evicted from the registry; staleness is diagnostic.
✨ Earlier — 0.7.7
wakeparameter on every send tool —send_email,reply_email,forward_email,template_send,manage_drafts(send)all acceptwake: ["alice", "bob"](or comma-separated string). The dispatcher gives a Claude turn only to listed agents; the rest still receive the mail but stay asleep. Single biggest token saver on multi-agent threads.check_activitytool (in theessentialset) — see which agents the dispatcher has woken right now, what they're working on, how long they've been running, plus a preview of recently-finished work. Answers "did the agent I just emailed actually start working?" without waiting for a reply.- Thread-close markers — put
[FINAL],[DONE],[CLOSED], or[WRAP]in a subject to tell the dispatcher this thread is sealed; no more wakes on any reply to it. The wake prompt teaches agents to add these markers when they sign off the work. - LLM-tolerant input coercion —
batch_mark_read({ uids: "[1,2,3,4]" }),wait_for_email({ timeout: "120" }),manage_drafts({ where: '{"id":"abc"}' }),manage_pending({ allowSensitive: "true" })all now just work. Strings get parsed before zod validates. No more "expected array, received string" retries. - Server
instructionsfield sent oninitialize— every connecting MCP client (Claude Code, ChatGPT, Cursor, Grok…) gets the coordination protocol in context before they touch any tool. Provider-agnostic. wait_for_emailfilters — block on a specific reply, not just "any new event". Supportsfrom,subject,inReplyTo,participants,includeTasks.
Install
npm install -g @agenticmail/mcp
Requirements: Node.js 22+, AgenticMail API server running
What This Package Does
This is the bridge between your AI client and the AgenticMail system. It runs as a subprocess that the AI communicates with through standard input/output (no network ports opened). Every tool call gets translated into an API request to the AgenticMail server, and the response comes back as formatted text the AI can understand.
Think of it this way: your AI agent doesn't know how to send email natively. This MCP server teaches it how by giving it a set of tools — "send_email", "list_inbox", "reply_email", and so on — that the AI can call when you ask it to do email-related tasks.
Setup
MCP Client Setup (CLI-Based)
Add to your MCP client configuration (e.g., .mcp.json or project settings):
{
"mcpServers": {
"agenticmail": {
"command": "npx",
"args": ["agenticmail-mcp"],
"env": {
"AGENTICMAIL_API_URL": "http://127.0.0.1:3829",
"AGENTICMAIL_API_KEY": "ak_your_agent_key"
}
}
}
}
Desktop Clients
For desktop AI applications, add to your MCP configuration file. Example paths:
- macOS:
~/Library/Application Support/<app>/config.json - Windows:
%APPDATA%\<app>\config.json
{
"mcpServers": {
"agenticmail": {
"command": "npx",
"args": ["agenticmail-mcp"],
"env": {
"AGENTICMAIL_API_URL": "http://127.0.0.1:3829",
"AGENTICMAIL_API_KEY": "ak_your_agent_key"
}
}
}
}
Environment Variables
| Variable | Required | Description |
|---|---|---|
AGENTICMAIL_API_URL |
Yes | AgenticMail API server URL. Default port is 3829 (changed from 3100 in @agenticmail/mcp@0.7.x to avoid common dev-tool conflicts). Example: http://127.0.0.1:3829. |
AGENTICMAIL_API_KEY |
Yes¹ | Agent API key (ak_...). Determines the default identity this MCP server acts as when a tool call doesn't pass _account. |
AGENTICMAIL_MASTER_KEY |
No | Master key (mk_...). Required for admin operations (create/delete agents, approve emails, gateway config). Also enables on-demand _account resolution — any tool call passing _account: "<name>" will lazily fetch that agent's API key via the master key the first time it sees the name, so freshly-create_account'd agents become addressable without restarting the MCP server. |
AGENTICMAIL_ACCOUNT_KEYS_JSON |
No | JSON map of {"<agentName>": "<apiKey>"} for per-call identity switching. When the caller passes _account: "Fola" (etc.), the server authenticates AS that agent for the duration of the call. Populated automatically by agenticmail claudecode install for the Claude Code integration. |
¹ Either AGENTICMAIL_API_KEY OR AGENTICMAIL_MASTER_KEY (or AGENTICMAIL_ACCOUNT_KEYS_JSON) must be set, but you don't strictly need all three.
Optional Streamable HTTP transport (--http)
Most users should stick with the default stdio transport — that's what every MCP client config above uses. For environments that need a long-lived HTTP endpoint (browser-based clients, remote-development tunnels, multi-host setups), pass --http:
agenticmail-mcp --http # 127.0.0.1:8014, auth required
agenticmail-mcp --http --port=9001
agenticmail-mcp --http --host=0.0.0.0 # expose on network (token still required)
agenticmail-mcp --http --token=mcphttp_xxx # use a known token instead of the minted one
agenticmail-mcp --http --insecure # sandbox/test only — disables auth
The token is read from (in order): --token=... flag, MCP_HTTP_TOKEN env, ~/.agenticmail/mcp-http-token (auto-minted on first run). Clients must send Authorization: Bearer <token> on every request to /mcp. GET /health stays open and returns only the session count.
Per-call identity switching (_account)
Every tool's input schema accepts an optional _account: "<name>" parameter. When passed, the server resolves that name to an apiKey (from AGENTICMAIL_ACCOUNT_KEYS_JSON, then falling back to a live master-keyed lookup of /accounts) and runs the call as that agent. Without _account, the call uses AGENTICMAIL_API_KEY as the default identity.
This is what powers the @agenticmail/claudecode integration: one MCP server process, many AgenticMail identities. A Claude Code subagent that "is" Fola passes _account: "Fola" on every call and ends up reading Fola's real inbox, sending mail from fola@localhost, and so on.
Meta-tools for cheap discovery (request_tools + invoke)
To keep host context windows small, only ~10 of the 100 tools are pre-declared in a typical subagent's tools: whitelist. The other ~50 stay reachable through two always-on meta-tools:
request_tools({ query?, sets? })— Returns a text catalogue of the unloaded tools, grouped by set (mail_extras,mail_compose,sms,account_admin, …). Optional substring filter or set-name filter.invoke({ tool, args, _account? })— Dispatches to any of the 100 tools by name. The agent usesrequest_toolsto discover,invoketo call.
Token impact: a typical subagent spawn loads ~3K tokens of tool schemas instead of ~15K. The cost is one extra round trip for uncommon operations (discover → invoke), which is almost always a worthwhile trade.
How It Works
The MCP server sits between your AI and the AgenticMail API:
AI Client → MCP tool call → agenticmail-mcp → HTTP request → AgenticMail API → Stalwart Mail Server
Each tool call:
- Receives structured arguments from the AI
- Validates the input (UIDs must be positive integers, arrays must be non-empty, etc.)
- Makes an HTTP request to the AgenticMail API with a 30-second timeout
- Returns formatted text results back to the AI
The server runs with stdio transport — the AI client sends JSON-RPC messages via stdin, and the server responds via stdout. No network ports are opened by the MCP server itself. It shuts down gracefully on SIGTERM or SIGINT.
Tools
Email — Core Operations (13 tools)
| Tool | Description | Example Prompt |
|---|---|---|
send_email |
Send email with to, subject, text/html, attachments, CC | "Send an email to john@example.com about the meeting" |
list_inbox |
List recent inbox messages (paginated, up to 100) | "Check my inbox" |
read_email |
Read full email content with security analysis | "Read email #42" |
reply_email |
Reply (or reply-all) preserving threading | "Reply to that email saying I'll attend" |
forward_email |
Forward an email with original attachments | "Forward that to sarah@example.com" |
search_emails |
Search by from, subject, body, date range, relay | "Find emails from John about the budget" |
delete_email |
Delete a specific email by UID | "Delete that spam email" |
move_email |
Move email to a folder | "Move this to Archive" |
mark_read |
Mark email as read | "Mark email #15 as read" |
mark_unread |
Mark email as unread | "Mark that as unread" |
inbox_digest |
Get inbox summary with body previews | "Give me a digest of my inbox" |
wait_for_email |
Wait for new email in real time (up to 5 minutes) | "Wait for a reply from john@example.com" |
import_relay_email |
Import email from connected Gmail/Outlook | "Import email UID 500 from Gmail" |
Email — Batch Operations (5 tools)
| Tool | Description |
|---|---|
batch_delete |
Delete multiple emails by UID list |
batch_mark_read |
Mark multiple emails as read |
batch_mark_unread |
Mark multiple emails as unread |
batch_move |
Move multiple emails to a folder |
batch_read |
Read multiple full emails at once |
Email — Organization (14 tools)
| Tool | Description |
|---|---|
manage_contacts |
Add, remove, and list contacts in address book |
manage_drafts |
Create, list, edit, delete, and send drafts |
manage_tags |
Create tags, assign to messages, remove, list |
manage_rules |
Create email filtering rules (auto-move, auto-delete, mark read) |
manage_signatures |
Create, list, and delete email signatures |
manage_templates |
Create, list, and delete email templates |
manage_scheduled |
Schedule emails for future delivery, list, cancel |
manage_spam |
List spam folder, report spam, mark as not-spam, get spam score |
manage_pending_emails |
View blocked outbound emails awaiting approval |
template_send |
Send email using a saved template with variable substitution |
create_folder |
Create a new IMAP folder |
list_folder |
List messages in a specific folder |
list_folders |
List all available folders |
check_health |
Check AgenticMail server and Stalwart health |
Multi-Agent Communication (8 tools)
| Tool | Description | Example Prompt |
|---|---|---|
list_agents |
List all agents with name, email, role | "Show me all agents" |
message_agent |
Send email to another agent (with priority levels) | "Tell the researcher to look up pricing data" |
check_messages |
Check for new messages from agents and externals | "Any new messages?" |
call_agent |
Call another agent with a task (sync or async) | "Call the analyst to research this topic" |
claim_task |
Claim a pending task assigned to you | "Claim that task" |
submit_result |
Submit result for a claimed task | "Submit the research findings" |
check_tasks |
Check incoming or outgoing tasks | "Do I have any pending tasks?" |
call_agent |
Synchronous RPC — waits for result (up to 5 min) | "Ask the researcher to find pricing and wait" |
Administration (7 tools)
These tools require the master key (AGENTICMAIL_MASTER_KEY):
| Tool | Description |
|---|---|
create_account |
Create a new agent with name and role |
delete_agent |
Delete an agent (archives emails, records report) |
stop_agent |
Soft-stop an agent mid-task — dispatcher refuses to wake it, mail still lands in the inbox (audit trail preserved) |
resume_agent |
Reverse stop_agent — dispatcher resumes waking the agent; mail received while stopped is in the inbox and picked up on next wake |
cleanup_agents |
List inactive agents, clean up, set persistent |
deletion_reports |
View past agent deletion reports |
update_metadata |
Update agent metadata (display name, owner, etc.) |
whoami |
Get current agent info (name, email, role, ID) |
setup_payment |
Get Cloudflare payment setup instructions |
Gateway Configuration (6 tools)
These tools require the master key:
| Tool | Description |
|---|---|
check_gateway_status |
Check current email gateway mode and health |
setup_email_relay |
Configure Gmail/Outlook relay mode |
setup_email_domain |
Configure custom domain with Cloudflare |
setup_gmail_alias |
Get Gmail "Send mail as" alias instructions |
setup_guide |
Show relay vs domain comparison guide |
send_test_email |
Send a test email to verify gateway |
purchase_domain |
Search for and purchase a domain |
SMS / Phone Number (8 tools)
| Tool | Description |
|---|---|
sms_setup |
Configure Google Voice or 46elks phone number access |
sms_send |
Send SMS through 46elks API or return Google Voice send instructions |
sms_messages |
List inbound/outbound SMS messages |
sms_check_code |
Extract verification/OTP codes from recent SMS |
sms_read_voice |
Read SMS directly from Google Voice web (fastest method) |
sms_record |
Record an SMS read from Google Voice web or any source |
sms_parse_email |
Parse SMS from forwarded Google Voice email (fallback) |
sms_config |
Get current SMS configuration |
Outbound Security Scanning
Every email sent through send_email, reply_email, or forward_email is scanned before going out. The scanner checks for:
What Gets Detected
Personal Information (PII) — Social Security numbers, credit card numbers, phone numbers, bank routing numbers, driver's license numbers, passport numbers, tax IDs, Medicare/Medicaid IDs, immigration numbers, PINs, security question answers, IBAN/SWIFT codes, cryptocurrency wallet addresses, wire transfer instructions
Credentials — API keys, AWS keys, passwords, private keys (PEM format), bearer tokens, database connection strings, GitHub tokens, Stripe keys, JWTs, webhook URLs, environment variable blocks, crypto seed phrases, 2FA backup codes, username/password pairs, OAuth tokens, VPN credentials
System Internals — Private IP addresses, file paths from common system directories, environment variable assignments
Owner Privacy — Mentions of the owner's personal information, revelations about who created or operates the agent
Risky Attachments — Private key files (.pem, .key, .p12, .pfx), environment files (.env, .credentials), database files (.db, .sqlite), executables (.exe, .bat, .sh, .ps1), and more
What Happens When Something Is Found
- Medium severity — the email is sent, but the AI receives a warning in the response
- High severity — the email is blocked and stored for human review
When an email is blocked, the AI is told the pending ID and instructed to let the user know. The user (owner) receives a notification email with the full blocked content and instructions.
Human-Only Approval
The AI cannot approve or reject its own blocked emails. The manage_pending_emails tool only allows listing and viewing — approve/reject actions are explicitly rejected with a clear error message. Only the human owner can approve (via the API, the interactive shell, or by replying "approve" or "yes" to the notification email).
Automatic Follow-Up Reminders
When an email is blocked, the MCP server automatically schedules escalating follow-up reminders for the AI:
- 12 hours — first reminder
- 6 hours — second reminder
- 3 hours — third reminder
- 1 hour — final reminder before cooldown
- 3-day cooldown — then the cycle restarts
These reminders are injected into tool responses, prompting the AI to ask the user about the pending approval. A background heartbeat checks every 5 minutes to detect if the owner has already approved or rejected the email, and cancels the reminders if so.
Inbound Security
When the AI reads an email with read_email, the response includes a security analysis:
- Spam score — how likely the email is to be spam or malicious (0-100)
- Category — what type of threat was detected (phishing, social engineering, prompt injection, etc.)
- Sanitization — whether invisible Unicode characters or hidden HTML were found and cleaned
- Attachment warnings — flags for executables, archives, HTML files, and disguised file extensions (like
report.pdf.exe)
Internal emails (between agents on the same system) are trusted and skip spam scoring.
Waiting for Email in Real Time
The wait_for_email tool opens a Server-Sent Events (SSE) connection to the API and listens for new emails or task notifications. If SSE is unavailable, it falls back to polling the inbox. This is useful for workflows where the AI needs to wait for a reply before continuing.
The wait has a configurable timeout (default 2 minutes, maximum 5 minutes). When an email arrives, the tool returns details about the message. If a task notification arrives instead, it returns the task information.
Relay Email Integration
When the owner has connected a Gmail or Outlook account as a relay, the AI can:
- Search the relay —
search_emailswithsearchRelay: truesearches both the local inbox and the connected Gmail/Outlook account. Relay results come back with a separate set of UIDs tagged by account. - Import from relay —
import_relay_emailpulls a specific email from the relay account into the local inbox, preserving all headers for proper threading.
This means the AI can find and import emails from the owner's real Gmail/Outlook inbox, then reply to them normally through the AgenticMail system.
Scheduled Emails
The manage_scheduled tool accepts flexible time formats:
- ISO 8601:
2026-02-14T10:00:00Z - Relative:
in 30 minutes,in 2 hours - Named:
tomorrow 8am,tomorrow 2pm - Day of week:
next monday 9am,next friday 2pm - Human format:
02-14-2026 3:30 PM EST - Casual:
tonight,this evening
The API server checks every 30 seconds for scheduled emails whose send time has arrived and sends them automatically.
Inter-Agent Communication
Message Priority
When using message_agent, the AI can set a priority level:
- Normal — no prefix
- High — subject prefixed with
[HIGH] - Urgent — subject prefixed with
[URGENT]
Synchronous RPC
The call_agent tool is unique — it assigns a task to another agent and then holds the connection open until that agent responds (up to 5 minutes). This is useful when the AI needs an answer from another agent before it can continue.
Under the hood, the API server polls every 2 seconds and also uses an instant resolution mechanism — when the target agent submits a result, the waiting connection resolves immediately.
Task Lifecycle
Tasks go through states: pending → claimed → completed or failed. Any agent that knows a task ID can claim it, which supports architectures where sub-agents handle tasks on behalf of a parent agent.
Resources
The MCP server provides one resource:
| URI | Name | Description |
|---|---|---|
agenticmail://inbox |
Agent Inbox | Browse the current agent's 20 most recent inbox messages |
AgenticMail MCP questions
How do I add AgenticMail MCP to Claude Code?
Run claude mcp add --env AGENTICMAIL_API_KEY=<YOUR_AGENTICMAIL_API_KEY> --env AGENTICMAIL_MASTER_KEY=<YOUR_AGENTICMAIL_MASTER_KEY> mcp -- npx -y @agenticmail/mcp in your terminal. Add --scope user to make it available in every project.
How do I add AgenticMail MCP to Cursor?
Open ~/.cursor/mcp.json and add the server under mcpServers, using the Cursor config shown in the install section above.
What tools does AgenticMail MCP provide?
It exposes 65 tools, including request_tools, invoke, send_email, list_inbox, read_email.
What can an AI agent do with AgenticMail?
AI agents can send emails and texts, check inboxes, reply to messages, receive verification codes, manage contacts, and schedule emails.
How do I install the AgenticMail MCP server?
You can install it globally using npm with the command npm install -g @agenticmail/mcp.
Does the server require an API key?
Yes, you must provide either an AGENTICMAIL_API_KEY or an AGENTICMAIL_MASTER_KEY to function.
Can I use this server over HTTP instead of stdio?
Yes, you can use the optional Streamable HTTP transport by passing the --http flag, which requires a bearer token for authentication.