imap-mcp

communication MCP Server

Self-hosted remote MCP server that lets an AI (Claude, etc.) read, search and send email through multiple IMAP/SMTP accounts

Verified
communicationcommunication
2 views2 stars0 forksv0.1.0MIT

Why This Matters

Discovered via github-topic:mcp and last synced 2mo ago.

Verified
Source
github-topic:mcp
Stars
2
Last synced
2mo ago
Install
Check source

Install

Install instructions not detected yet

Check the source repository for the latest setup steps.

View source instructions
176
Tools
0
Resources
0
Prompts
Standard I/O
Transport

Available Tools (176)

OIDC_CLIENT_ID

Yes

OIDC_CLIENT_SECRET

Yes

size_gt

bytes

fetch_headers

HEADERS

IMAP_MCP_APPEND_TIMEOUT

no

Concern

Choice

587

❌ off

Port

SSL/TLS checkbox

search_messages

IMAP `SEARCH` by `from`, `to`, `subject`, `body`, date ranges, unread

unflag_messages

Remove `\Flagged`

ORM

[`drizzle-orm`](https://orm.drizzle.team)

set_flags

Add and/or remove arbitrary IMAP flags (`\Answered`, `$Important`, labels…)

create_folder

Create a new IMAP mailbox (supports hierarchical paths)

create_mailbox

Create a new folder

get_unread_count

Unread email count

Mode

Description

authenticate

Manual login with username/password

search_by_subject

Search by subject text

move_email

Move emails to another folder

refresh_cache

Force refresh the in-memory cache

get_auto_archive_list

List auto-archive sender patterns

Linux

SecretService (GNOME Keyring / KDE Wallet)

connect

Manual IMAP connection to a host

fetch_emails

Fetch emails with limit/offset, date filters

search_by_sender

Search by sender address

unflag_email

Remove a flag

Platform

Backend

range

Emails within a specific date range

select_mailbox

Open a mailbox folder

download_attachment

Download attachment content (base64)

process_auto_archive

Archive matching emails (supports dry_run)

macOS

Keychain (protected by Touch ID / login password)

Windows

Windows Credential Locker

recent

Load the last N emails (newest first)

new

Only emails newer than the most recent cached email

older

Go further back in time: N emails older than the oldest cached

auto_connect

Connect using config.json + keyring credentials (recommended)

disconnect

Close connection and stop watchers

list_mailboxes

List all mailbox folders

get_mailbox_status

Get message count, unseen, UIDNEXT, etc.

get_email_headers

Get headers only (faster)

get_email_body

Get body as text or HTML

get_attachments

List attachment metadata

search_by_date

Search by date range

search_unread

Get all unread emails

search_flagged

Get all flagged/starred emails

flag_email

Add a flag (e.g. `\Flagged`, `\Important`)

copy_email

Copy emails to another folder

archive_email

Move emails to Archive folder

save_draft

Save a draft with optional signature

get_total_count

Total email count in mailbox

start_watch

Start IDLE watchers on all configured folders

remove_auto_archive_sender

Remove a sender from auto-archive

reload_auto_archive

Reload sender list from file

load_cache

Flexible cache loader (recent/new/older/range modes)

search_emails

Search emails using IMAP SEARCH criteria

IMAP_PORT

No

BIND_ADDR

No

list_accounts

List the current user's configured accounts

mark_read

Add `\Seen` to one or more UIDs

IMAP_PROVIDERS

No

Format

Binary

IMAP_HOST

Yes

antiword

`apt install antiword` (Debian/Ubuntu)

get_attachment

Return a signed 15-minute HTTPS download URL for an attachment (file never persisted on the MCP server). Images are also previewed inline. `inline_blob=true` opts into returning the raw base64 as an embedded MCP resource.

BASE_URL

Yes

list_emails

List emails in a folder (uid, date, from, subject, seen flag)

OIDC_ISSUER_URL

Yes

ENCRYPTION_KEY

Yes

RUST_LOG

No

mark_unread

Remove `\Seen`

get_email

Fetch full email by UID (headers + plain text body, S/MIME signed supported)

add_account_url

Return a fresh 15-minute signed link the user opens in a browser to connect another mailbox

REDIS_URL

Yes

rename_folder

Rename or reparent a mailbox

Language

TypeScript (strict)

Tool

Purpose

reply_message

Reply preserving `In-Reply-To` / `References`; same Sent-folder behavior as `send_message`.

iCalendar

[`ical.js`](https://github.com/kewisch/ical.js) (Mozilla)

25

❌ off

copy_messages

Copy UIDs to another folder without removing the original

Sanitizer

[`isomorphic-dompurify`](https://github.com/kkomelin/isomorphic-dompurify)

delete_messages

Move to Trash by default; `permanent: true` expunges

Framework

Next.js 15 (App Router), React 19

Transport

**Streamable HTTP** (MCP spec 2025-06-18)

flag_messages

Add `\Flagged` (the star/favorite)

get_event

Fetch a single event (parsed + raw iCal)

Database

PostgreSQL 16

465

✅ on

get_message

Full message: headers, text, HTML, attachments metadata (with indexes)

create_event

Create an event. Optional `tz` (IANA name) anchors it to a real timezone — recurrences then survive DST correctly.

find_free_slots

Find free intervals across one or more calendars, with optional working-hours filter (DST-correct in the working-hours tz).

add_auto_archive_sender

Add a sender/domain to auto-archive

shared_token

stdio + HTTP

accept_incoming

no

FULL

Everything including attachments (`fetch_attachment`)

older_than

duration

fetch_envelope

ENVELOPE

create_draft

`draft_append`

IMAP_MCP_HTTP_PORT

no

token_cache

no

path

yes

id

yes

fetch_attachment

FULL

get_caller_identity

Resolved `caller_id` for the current session

to

(string, required): The recipient's email address

subject

(string, required): The email subject line

yes

—

stdio_trusted

stdio only

move_out

no

BODY

Plain-text and HTML bodies (`fetch_body`)

flagged

boolean

bulk_mark_seen

`mark_seen`

Variable

Required

provider

no

file_dir

Plaintext files; confidentiality from the surrounding system (git-crypt, SOPS, LUKS)

default

yes

COUNT

Message count only (`folder_stats`)

fetch_body

BODY

IMAP_MCP_HTTP_HOST

no

no

—

draft_append

no

Predicate

Type

search

METADATA

move

`move_out` + `accept_incoming`

IMAP_MCP_CALLER_ID

stdio_trusted only

Field

Required

host

no

port

no

user

no

env_var

Read-only from environment variables.

gpg_file

Per-file GPG decryption using the operator's key

Type

Transport

rules

no

mark_seen

`mark_seen`

mark_tagged

`mark_tagged`

Level

What is exposed

METADATA

UIDs, sizes, flags (`search`)

ENVELOPE

From, To, Subject, Date (`fetch_envelope`, `list_messages`)

HEADERS

Full RFC 5322 header block (`fetch_headers`)

from

(string, optional): The sender's email address (defaults to IMAP_USERNAME)

to_contains

substring

subject_contains

substring (case-insensitive, NFC-normalized)

has_attachment

boolean

newer_than

duration

list_folders

IMAP `LIST` — all mailboxes for a given account

list_labels

COUNT

folder_stats

COUNT

copy

`accept_incoming`

describe_policy

Caller's own policy profile (accounts, folders, capabilities, hidden counts). Never reveals rule patterns or other callers.

Backend

Description

mode

yes

NONE

Nothing (message is invisible)

from_domain

domain (case-insensitive, trailing-dot tolerant)

size_lt

bytes

IMAP_MCP_OAUTH_CLIENT_SECRET

xoauth2 accounts

get_transaction_status

WAL state of a cross-account move saga

OTEL_EXPORTER_OTLP_ENDPOINT

no

IMAP_MCP_CONFIG_DIR

yes

IMAP_MCP_OAUTH_CLIENT_ID

xoauth2 accounts

sync_emails

Download emails for a date range into SQLite (incremental)

stop_watch

Stop all IDLE watchers

get_cached_overview

Get in-memory overview of inbox/next/waiting/someday

idle_watch

Watch a single mailbox temporarily (with timeout)

get_cache_stats

Cache statistics (count, size, encryption status)

body

(string, required): The email body content

list_messages

Headers of the N most recent messages in a folder (with filters)

get_thread

Full conversation around a message; Gmail X-GM-THRID fast-path + RFC 5322 References fallback. `cross_folder=true` scans every mailbox.

send_message

Send via the account's SMTP, appending the HTML signature and base64 attachments; the sent copy is IMAP-appended to the Sent folder (skipped on Gmail, which saves it automatically).

move_messages

Move UIDs from one folder to another

delete_folder

Delete a mailbox (INBOX is rejected)

list_calendar_accounts

List the user's CalDAV accounts (independent of email accounts)

list_calendars

Discover the calendar collections of an account (returns `url` for each)

list_events

Events in a window. Returns `etag` for optimistic concurrency, `tz`, `startLocal`/`endLocal` and the raw `RRULE`. Pass `expand_recurring=true` to also receive expanded `occurrences[]`.

update_event

Patch an event. Requires the `etag` from list/get; a stale etag returns 412. `tz=null` re-anchors to UTC.

delete_event

Delete an event by URL. Pass `etag` for safe optimistic deletion.