
MCP (Model Context Protocol) server for Zimbra to manage emails, tags, and calendar.
概览
MCP (Model Context Protocol) server for Zimbra to manage emails, tags, calendar, and contacts. create_draft and send_email support linking to an original message for replies and forwards: Examples: - create_draft(to=[...], subject="...", body="...") - create_draft(to=[...], subject="Re: ...", body="...", orig_msg_id="123", reply_type="r", include_original="inline") - create_draft(to=[...], subject="Fwd: ...", body="...", orig_msg_id="123", reply_type="w", include_original="attachment") - in:inbox - Emails in inbox - from:john@example.
README
以下为原文 README 节选,完整内容请查看原文。
Zimbra MCP Server
MCP (Model Context Protocol) server for Zimbra to manage emails, tags, calendar, and contacts.
Installation
cd ~/Projets/MCP/zimbra-mcp
# With uv
uv sync
# Or with pip
pip install -e .
Configuration
Create a .env file from the example:
cp .env.example .env
Configure your Zimbra credentials:
ZIMBRA_URL=https://zimbra.example.com/service/soap
[email protected]
ZIMBRA_PASSWORD=your_password
ZIMBRA_TIMEOUT=30
ZIMBRA_ENABLE_SEND=false
| Variable | Description | Default |
|---|---|---|
ZIMBRA_URL |
Zimbra SOAP endpoint URL | (required) |
ZIMBRA_USER |
Zimbra account email | (required) |
ZIMBRA_PASSWORD |
Zimbra account password | (required) |
ZIMBRA_TIMEOUT |
Request timeout in seconds | 30 |
ZIMBRA_ENABLE_SEND |
Enable send_email tool (true/1/yes) |
false |
Usage
Start the server
uv run zimbra-mcp
Test with MCP Inspector
mcp dev src/zimbra_mcp/server.py
Available Tools
Emails
| Tool | Description |
|---|---|
search_emails |
Search with Zimbra syntax (in:inbox, from:, tag:, etc.) |
get_email |
Retrieve an email by ID with full body |
download_attachment |
Download an attachment to a local file |
list_folders |
List all mail folders |
search_folder |
Search for a folder by name or path (case-insensitive partial match) |
move_emails |
Move emails to a folder |
mark_as_read |
Mark emails as read or unread |
delete_emails |
Delete emails (soft delete to Trash, or hard delete) |
create_draft |
Create a draft with optional reply/forward support |
send_email |
Send an email directly (opt-in, requires ZIMBRA_ENABLE_SEND=true) |
Reply & Forward Drafts
create_draft and send_email support linking to an original message for replies and forwards:
| Parameter | Description |
|---|---|
orig_msg_id |
ID of the original message |
reply_type |
"r" for reply, "w" for forward |
include_original |
"inline" to quote in body, "attachment" to attach as .eml |
Examples:
- Simple draft:
create_draft(to=[...], subject="...", body="...") - Reply with quote:
create_draft(to=[...], subject="Re: ...", body="...", orig_msg_id="123", reply_type="r", include_original="inline") - Forward as attachment:
create_draft(to=[...], subject="Fwd: ...", body="...", orig_msg_id="123", reply_type="w", include_original="attachment")
Zimbra Search Syntax
Basic operators:
in:inbox- Emails in inboxfrom:[email protected]- Emails from Johnto:me- Emails sent to metag:important- Emails with “important” tagsubject:meeting- Subject containing “meeting”has:attachment- Emails with attachmentsafter:2024-01-01 before:2024-12-31- Date range (ISO or MM/DD/YYYY)is:unread- Unread emailsis:flagged- Flagged emails
Boolean operators:
安装
This server does not publish a one-line install command.
Open the repository installation guide 新手?先看 mcpskill.org 教程 →配置
{
"mcpServers": {
"zimbra": {
"command": "uv",
"args": ["run", "--directory", "/home/me/Projets/MCP/zimbra-mcp", "zimbra-mcp"],
"env": {
"ZIMBRA_URL": "https://zimbra.example.com/service/soap",
"ZIMBRA_USER": "[email protected]",
"ZIMBRA_PASSWORD": "your_password"
}
}
}
}