mcpg-plugin-backend-email MCP server
Commit 10. Nov. 2026Enables AI agents to send emails via SMTP and read mailboxes via IMAP as tools and resources.
Auch bekannt als mcpg-dev/mcpg-plugin-backend-email
- Stars
- 0
- Tools
- 1
- Downloads, 30 Tage
- —
- Neueste Version
- —
- Letzter Commit
- 10. Nov. 2026
- Lizenz
- Apache-2.0
Was ist mcpg-plugin-backend-email MCP?
mcpg-plugin-backend-email ist ein MCP server. Enables AI agents to send emails via SMTP and read mailboxes via IMAP as tools and resources. Er stellt 1 Tool bereit, etwa name.
Zusammenfassung generiert aus dem README des Projekts
Über mcpg-plugin-backend-email MCP server
Sending automated notifications or triaging an inbox is possible through this email backend binding plugin. It allows AI agents to interact with email systems by using SMTP for sending messages and IMAP for reading them. The server functions as a bridge, turning email operations into specific MCP tools and resources that an agent can call.
Users configure the server with host details, ports, and credentials. Security is handled via a gateway secret-resolver for passwords, supporting environment variables or vault paths. The system supports various TLS configurations including implicit, starttls for SMTP, or none for plaintext. When reading mail, the server uses non-destructive BODY.PEEK to ensure messages are not marked as seen automatically.
Beyond simple tools, the plugin includes a mailbox watch strategy. This feature monitors an inbox for changes like new messages, flag updates, or deletions. It can use the IDLE command for prompt updates or a periodic listing cadence to report changes as events to the agent.
Was du damit machen kannst
- 1Automated Alert NotificationsAn AI agent can send an email alert to a specific recipient using the send operation.
- 2Inbox Triage and ReadingA developer can instruct an agent to fetch the most recent messages from a shared mailbox to review them.
- 3Real-time Mailbox MonitoringThe system can watch a support mailbox and trigger an event whenever a new message arrives.
- 4Tracking Message Status ChangesAn agent can monitor if a message has been flagged or answered within a specific mailbox.
Geschrieben aus dem README des Projekts. Jeder Use Case wurde gegen ein Zitat daraus geprüft.
mcpg-plugin-backend-email MCP tools 1
Erkannt aus dem READMEname
| name | — |
README
Auf GitHub ansehenmcpg-plugin-backend-email
Email backend binding plugin for mcpg (kind: email). Sends mail over SMTP
(lettre) and reads a mailbox over IMAP (async-imap) as MCP tools and
resources — over rustls TLS (STARTTLS / implicit) or plaintext.
Part of the legacy → MCP bridge suite. Lets an agent send notifications/alerts and triage an inbox.
How it works
One binding = one operation = one MCP tool (or resource):
op |
Behaviour | Returns |
|---|---|---|
send (default) |
Build a message from the call arguments (to / subject / body) and deliver it over SMTP. |
{ sent: true } |
read |
Fetch the most recent limit messages from mailbox over IMAP (envelope + text body, read non-destructively via BODY.PEEK). |
{ messages, count } |
Configuration
| Field | Type | Default | Notes |
|---|---|---|---|
op |
send|read |
send |
The operation. |
host |
string (required) | — | SMTP (send) or IMAP (read) host. |
port |
int (required) | — | e.g. 587 (SMTP STARTTLS) / 465 (SMTP implicit) / 993 (IMAPS) / 143 (IMAP plaintext). |
tls |
none|starttls|implicit |
implicit |
starttls is SMTP-only. |
username |
string | "" |
Login user. Required for read; optional for an unauthenticated send. |
password |
string | "" |
Resolved via the gateway secret-resolver (${env.X} / vault://…). Per-caller cred:// is not supported. |
from |
string | — | From address. Required for send. |
mailbox |
string | INBOX |
Mailbox to read. read only. |
limit |
int | 10 |
Max recent messages to return. read only. |
timeout_ms |
int | 15000 |
connect + operation timeout. |
As a send tool
mcp:
capabilities:
tools:
- name: alerts.notify
description: Send an alert email.
input_schema:
type: object
properties:
to: { type: string }
subject: { type: string }
body: { type: string }
required: [to, subject, body]
backend:
kind: email
op: send
host: "smtp.corp.example.com"
port: 587
tls: starttls
username: "svc-mcpg"
password: "${env.SMTP_PASSWORD}"
from: "alerts@corp.example.com"
As a read tool
backend:
kind: email
op: read
host: "imap.corp.example.com"
port: 993
tls: implicit
username: "shared-inbox@corp.example.com"
password: "${env.IMAP_PASSWORD}"
mailbox: INBOX
limit: 20
Response envelope
{
"toolName": "alerts.notify",
"profile": "alerts.notify",
"request": { "op": "send", "host": "smtp.corp.example.com", "mailbox": "" },
"response": { "sent": true, "messages": null, "count": null, "durationMs": 120 },
"downstreamError": null, // non-null ⇒ isError:true (email_error / transport_error)
"downstreamErrors": [],
"error": null
}
op: read instead returns messages (and count); each message:
{
"seq": 12,
"from": ["Alice <alice@x>"], "to": ["shared@corp"],
"subject": "Re: ticket", "date": "Tue, 10 Jun 2026 …",
"internalDate": "2026-06-10T09:00:00+00:00",
"body": "the plain-text body …"
}
Security
- No plaintext secrets. The login
passwordresolves through the gateway secret-resolver (${env.X}/vault://…); it is never committed. cred://not supported. Per-callercred://is rejected at config validation — use a service mailbox + the config secret-resolver.- Non-destructive read.
readfetches withBODY.PEEK, so it does not set the\Seenflag. - TLS. rustls (lettre's
tokio1-rustls-tls; IMAP wrapped withtokio-rustls+webpki-roots). native-tls is banned. IMAP certificates are validated against the system roots.
Mailbox watch (imap_mailbox)
A second entity, a watch_strategy of kind imap_mailbox, watches a
mailbox as an inventory of messages and reports each change as the shared
object.changed event:
- a message that arrives is
created; - a flag change (
\Seen,\Flagged,\Answered,\Draft,\Deleted, a keyword) ismodified; - an expunged message is
deleted.
The watch lists UIDs, flags, sizes and dates every interval_ms on a
read-only session (EXAMINE), and IDLE on a second session, when the
server offers it, makes it list at once. Only a message that changed is
fetched in full: its event carries uid, flags, from, to, cc,
subject, date, messageId, inReplyTo and a preview of its text. A
restart reports exactly what changed while the watch was stopped while the
listing fits snapshot_bytes (about 2 900 messages); past that it records a
gap and starts from the mailbox it finds.
mcp:
capabilities:
events:
- name: support.mail
description: A message arrived in, or changed in, the support mailbox.
source:
watch:
strategy:
type: plugin
kind: imap_mailbox
host: imap.example.com
username: support@example.com
password: "${env.SUPPORT_IMAP_PASSWORD}"
event_type: object.changed
match: event.data.op == 'created'
| Field | Type | Default | Notes |
|---|---|---|---|
host, username, password |
string (required) | — | The password resolves before the watch starts; cred:// is rejected. |
port |
int | 993 |
|
tls |
implicit | none |
implicit |
IMAPS, or plaintext on a trusted network. |
mailbox |
string | INBOX |
|
idle |
bool | true |
IDLE for prompt changes, when the server offers it. |
interval_ms |
int | 60000 |
Listing cadence, at least 250. |
timeout_ms |
int | 30000 |
Budget of one listing, and of the fetch of what changed. |
preview_bytes |
int | 2048 |
The start of the text an event carries (at most 32768). A message over 256 KiB gets no preview. |
max_files |
int | 10000 |
Most messages watched: the newest (at most 100000). |
start_at |
now | existing |
now |
existing reports the messages there at a first start as created. |
snapshot_bytes, max_in_flight, ack_timeout_ms |
int | 131072, 256, 60000 |
As for every inventory source. |
The key is {uidvalidity}:{uid}, so a mailbox the server recreates (a new
UIDVALIDITY) reports its old messages deleted and its messages created.
Build / test
cargo build -p mcpg-plugin-backend-email
cargo test -p mcpg-plugin-backend-email # unit tests
cargo test -p mcpg-plugin-backend-email --features integration-tests # GreenMail (docker)
cargo clippy -p mcpg-plugin-backend-email --all-targets -- -D warnings
The integration suites run send → read, and an imap_mailbox watch through
a message there at a first start, a new message, a flag change, a delete and
expunge, an exact restart, and a listing IDLE wakes.
Scope / deferred
- IMAP STARTTLS —
readsupportsimplicit(IMAPS) ornone; STARTTLS upgrade on 143 is a follow-on. - MIME / attachments —
readreturns the envelope + the text body; attachment extraction + MIME-word-decoded headers are a follow-on. - Search criteria —
readfetches the most recent N; IMAPSEARCH(unseen, from, since) is a follow-on. - Per-caller credentials (
cred://) — v1 is one service mailbox per binding.
mcpg-plugin-backend-email MCP Fragen
Welche Tools bietet mcpg-plugin-backend-email MCP?
Er stellt 1 Tool bereit, darunter name.
Can the server read emails without marking them as read?
Yes, the read operation uses BODY.PEEK to fetch messages non-destructively, so it does not set the \Seen flag.
Can I use per-caller credentials?
No, per-caller credentials (cred://) are not supported in this version; you must use a service mailbox with the config secret-resolver.