Himalaya MCP Server
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Himalaya MCP Server summarize the most recent unread emails in my inbox"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
himalaya-mcp-server
MCP server that exposes email operations to AI agents (Claude Cowork, Claude Code, etc.) via the himalaya CLI.
Read-only by default. Write and send operations must be explicitly enabled.
Features
Broad himalaya coverage: accounts, folders, envelopes, messages, flags, attachments, templates
Three modes: read-only (safe default), full (write operations), and dangerzone (sending emails)
No destructive operations: delete, purge, and expunge commands are deliberately excluded (see Excluded Commands)
Security-first: write tools labeled
[DANGER: WRITE], send tools labeled[DANGERZONE: SENDS EMAIL]No shell injection: all CLI calls use
subprocess.run()with list argumentsStdio transport: works natively with Claude Desktop / Cowork via
claude_desktop_config.json
Related MCP server: Mail Agent MCP
Prerequisites
Python 3.12+
himalaya — installed and configured with at least one email account
Verify himalaya is working:
himalaya account listInstallation
Clone the repository:
git clone https://github.com/andasv/himalaya-mcp-server.git
cd himalaya-mcp-server
uv syncUsage with Claude Cowork / Claude Desktop
Add the server to your claude_desktop_config.json:
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%\Claude\claude_desktop_config.json
Read-only mode (default, recommended)
{
"mcpServers": {
"himalaya": {
"command": "uv",
"args": ["run", "--project", "/path/to/himalaya-mcp-server", "himalaya-mcp-server"]
}
}
}Full mode (enables move, copy, flag, and other write operations)
Warning: Full mode allows the AI agent to move messages, modify flags, create folders, and save drafts. It does not allow sending emails.
{
"mcpServers": {
"himalaya": {
"command": "uv",
"args": ["run", "--project", "/path/to/himalaya-mcp-server", "himalaya-mcp-server"],
"env": {
"HIMALAYA_MODE": "full"
}
}
}
}Dangerzone mode (enables sending emails)
Warning: Dangerzone mode allows the AI agent to send real emails to real recipients. This is irreversible. Only enable this if you fully understand the risks.
Dangerzone mode requires the APPROVED_RECIPIENTS environment variable — a comma-separated list of email addresses the AI is allowed to send to. Sending to any other address will be blocked with a friendly error.
{
"mcpServers": {
"himalaya": {
"command": "uv",
"args": ["run", "--project", "/path/to/himalaya-mcp-server", "himalaya-mcp-server"],
"env": {
"HIMALAYA_MODE": "dangerzone",
"APPROVED_RECIPIENTS": "alice@example.com,bob@example.com",
"HIMALAYA_SEND_TIMEOUT": "15"
}
}
}
}After editing the config, restart Claude Desktop for changes to take effect.
Usage with Claude Code
# Read-only (default)
claude mcp add himalaya -- uv run --project /path/to/himalaya-mcp-server himalaya-mcp-server
# Full mode (write operations, no sending)
claude mcp add --env HIMALAYA_MODE=full himalaya -- uv run --project /path/to/himalaya-mcp-server himalaya-mcp-server
# Dangerzone mode (write + send, with approved recipients)
claude mcp add --env HIMALAYA_MODE=dangerzone --env APPROVED_RECIPIENTS=alice@example.com,bob@example.com himalaya -- uv run --project /path/to/himalaya-mcp-server himalaya-mcp-serverModes
Mode | Env var | Tools available |
readonly (default) |
| List accounts/folders/envelopes, read messages, download attachments, generate templates |
full |
| All of the above + move, copy, flag, create folders, save drafts |
dangerzone |
| All of the above + send emails |
Environment Variables
Variable | Required | Default | Description |
| No |
| Operating mode: |
| In dangerzone | — | Comma-separated list of email addresses allowed as recipients |
| No |
| Timeout in seconds for send operations. Himalaya retries SMTP 450 errors indefinitely, so this prevents hangs. Keep below 60s (Cowork's tool timeout). |
| No |
| Log verbosity: |
Available Tools
Read-only tools (always available)
Tool | Description |
| List configured email accounts |
| List folders/mailboxes |
| List message envelopes with search/filter/pagination |
| Get thread view of envelopes |
| Read a message body by ID |
| Read a full message thread |
| Download attachments from a message |
| Generate a blank email template (MML) |
| Generate a reply template |
| Generate a forward template |
Write tools (full and dangerzone modes)
These tools are prefixed with [DANGER: WRITE] in their descriptions so the AI agent clearly sees the risk.
Tool | Description |
| Create a new folder |
| Copy a message to another folder |
| Move a message to another folder |
| Save a raw MIME message to a folder |
| Add flags to a message |
| Replace all flags on a message |
| Remove flags from a message |
| Compile MML template and save to folder |
Send tools (dangerzone mode only)
These tools are prefixed with [DANGERZONE: SENDS EMAIL] in their descriptions. They send real emails to real recipients and cannot be undone.
Tool | Description |
| Send a raw MIME message |
| Compile MML template and send email |
Composing and sending emails
Since himalaya's interactive editor commands can't be used in an MCP context, email composition uses the template pipeline:
Generate a template with
template_write,template_reply, ortemplate_forwardEdit the template (the AI fills in To, Subject, body, etc.)
Send with
template_send(requires dangerzone mode) or save as draft withtemplate_save(requires full mode)
MML template format
From: you@example.com
To: recipient@example.com
Subject: Hello
Your message body here.Excluded Commands
The following himalaya commands are deliberately not exposed through this MCP server for safety reasons. Allowing an AI agent to permanently delete emails or folders carries too high a risk of irreversible data loss.
himalaya command | What it does | Why it's excluded |
| Permanently removes messages marked for deletion | Irreversible bulk deletion |
| Deletes ALL messages in a folder | Irreversible bulk deletion |
| Deletes an entire folder and its contents | Irreversible data loss |
| Permanently deletes a single message | Irreversible data loss |
If you need these operations, use the himalaya CLI directly.
Security
Read-only by default — no write tools are even registered unless
HIMALAYA_MODE=fullordangerzoneSending requires dangerzone — email send tools are isolated in their own mode, separate from other write operations
Recipient allowlist — in dangerzone mode,
APPROVED_RECIPIENTSmust be set; emails can only be sent to explicitly approved addressesNo destructive operations — delete, purge, and expunge commands are excluded entirely
Danger labels — write tools show
[DANGER: WRITE], send tools show[DANGERZONE: SENDS EMAIL]No shell injection — all subprocess calls use list arguments, never
shell=TrueInput validation — all parameters are validated before being passed to the CLI
Subprocess timeouts — all CLI calls have a 30-second timeout to prevent hangs
himalaya handles auth — this server never touches credentials; himalaya manages its own auth via its config
License
MIT
Available Tools
10 toolsaccount_listA
List all configured email accounts.
Returns a list of accounts with their name, backend type, and default status.
Args: account: Optional specific account name to query.
Inputs: account. Returns: result
attachment_downloadC
Download all attachments from a message.
Attachments are saved to the current working directory.
Args: envelope_id: The envelope/message ID. folder: Folder name. Defaults to INBOX. account: Account name. If omitted, uses the default account.
Inputs: envelope_id (required), folder, account. Returns: result
envelope_listA
List message envelopes (headers) in a folder.
Returns sender, subject, date, and flags for each message without downloading full bodies.
Args: folder: Folder name (e.g. "INBOX"). Defaults to INBOX. account: Account name. If omitted, uses the default account. page: Page number for pagination (starts at 1). page_size: Number of envelopes per page. query: Search/filter query string (himalaya query syntax).
Inputs: folder, account, page, page_size, +1 more. Returns: result
envelope_threadA
Get thread view for a specific envelope.
Shows the conversation thread structure for the given message.
Args: envelope_id: The envelope/message ID. folder: Folder name. Defaults to INBOX. account: Account name. If omitted, uses the default account.
Inputs: envelope_id (required), folder, account. Returns: result
folder_listB
List all folders/mailboxes for an email account.
Args: account: Account name. If omitted, uses the default account.
Inputs: account. Returns: result
message_readB
Read a message by its envelope ID.
Returns the plain text body of the message by default.
Args: envelope_id: The envelope/message ID to read. folder: Folder name. Defaults to INBOX. account: Account name. If omitted, uses the default account. headers: If True, include message headers. raw: If True, return raw MIME content.
Inputs: envelope_id (required), folder, account, headers, +1 more. Returns: result
message_threadA
Read a full message thread by envelope ID.
Returns all messages in the conversation thread.
Args: envelope_id: The envelope/message ID. folder: Folder name. Defaults to INBOX. account: Account name. If omitted, uses the default account.
Inputs: envelope_id (required), folder, account. Returns: result
template_forwardB
Generate a forward template for a message.
Returns an MML template pre-filled with forwarded message content.
Args: envelope_id: The envelope/message ID to forward. folder: Folder name. Defaults to INBOX. account: Account name. If omitted, uses the default account.
Inputs: envelope_id (required), folder, account. Returns: result
template_replyB
Generate a reply template for a message.
Returns an MML template pre-filled with reply headers and quoted original message.
Args: envelope_id: The envelope/message ID to reply to. folder: Folder name. Defaults to INBOX. account: Account name. If omitted, uses the default account. reply_all: If True, reply to all recipients.
Inputs: envelope_id (required), folder, account, reply_all. Returns: result
template_writeA
Generate a new email template (MML format).
Returns a blank email template that can be filled in and sent via template_send. MML (MIME Meta Language) is himalaya's format for composing emails.
Args: account: Account name. If omitted, uses the default account. headers: Optional pre-filled headers (e.g. "To: user@example.com\nSubject: Hello").
Inputs: account, headers. Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 10 tools
Most tools have distinct purposes, but there is some overlap between envelope_thread and message_thread that could cause confusion. Both tools involve retrieving message threads, though envelope_thread focuses on structure while message_thread returns full messages. Other tools like account_list, folder_list, and attachment_download are clearly distinct.
The naming follows a consistent pattern with underscores separating words (snake_case). However, there is a minor inconsistency: most tools use a verb_noun format (e.g., account_list, envelope_list), but template_forward, template_reply, and template_write use a noun_verb format, which slightly deviates from the overall convention.
With 10 tools, the count is well-suited for an email management server. It covers essential operations like listing accounts and folders, reading messages, handling attachments, and generating email templates, without being overwhelming or too sparse for the domain.
The tool set provides good coverage for email reading, organization, and template generation, but lacks explicit tools for sending emails (e.g., a send_message tool) or managing drafts beyond templates. While template_send is mentioned in a description, it's not included as a tool, creating a minor gap in the email lifecycle.
Maintenance
Related MCP Connectors
Email for AI agents: read, search and send from your Gmail, Outlook, Yahoo, iCloud or IMAP inbox.
Give AI agents their own email inboxes: list, read and send mail via scoped, revocable OAuth grants.
Governed email for AI agents: a sandbox inbox to read and send from, human approval to go external.
Email for AI agents: send email, manage domains, templates and contacts. Risky steps ask you first.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables AI agents to interact with email accounts via IMAP and SMTP, supporting mailbox listing, email search, retrieval, sending, and management.MIT
- AlicenseBqualityBmaintenanceEnables AI agents to securely interact with Gmail and QQ Mail, including IMAP search/read/organization, attachments, and preview-confirmed sending.412MIT
- AlicenseNot gradedqualityAmaintenanceEnables AI assistants to securely manage multiple email accounts via IMAP and SMTP, including searching, reading, sending, replying, forwarding, organizing folders, marking, and bulk deleting messages.1,009 npmMIT
- AlicenseNot gradedqualityAmaintenanceEnables AI assistants to manage email across multiple IMAP/SMTP accounts with secure encrypted credentials, including searching, reading, sending, replying, forwarding, organizing, and bulk-deleting messages.1,009 npmMIT