Himalaya MCP Server
Click on "Install 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 Serversummarize 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
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
This server cannot be installed
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/andasv/himalaya-mcp-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server