Skip to content

McpMailProvider

Defined in: src/provider/mcp/provider.ts:74

Deliberately thin: one page, one batch. Iteration, batching, retry, and resumability live in shared machinery (paging.ts / batching.ts), so adapters only encode transport quirks.

THE NEVER-DELETE GUARANTEE: this interface has no delete/destroy methods and never will. archive() is the only sanctioned “removal” — it drops the Inbox label and keeps every other label. The worst any bug can do is mislabel or archive mail, never lose it.

readonly caps: ProviderCapabilities

Defined in: src/provider/types.ts:36

MailProvider.caps


readonly kind: "mcp"

Defined in: src/provider/mcp/provider.ts:75

MailProvider.kind

addLabels(emailIds, labelNames): Promise<void>

Defined in: src/provider/types.ts:51

One batch (caller chunks to <= caps.maxPageSize). Labels by name/path.

string[]

string[]

Promise<void>

MailProvider.addLabels


archive(emailIds): Promise<void>

Defined in: src/provider/types.ts:53

Remove from Inbox, keep all other labels. Never removeLabels: ['Inbox'].

string[]

Promise<void>

MailProvider.archive


connect(): Promise<void>

Defined in: src/provider/types.ts:39

JMAP: session discovery; MCP: initialize handshake. Idempotent.

Promise<void>

MailProvider.connect


ensureLabels(names): Promise<Map<string, Label>>

Defined in: src/provider/types.ts:46

Idempotent bulk create of missing labels (names may be ‘Parent/Child’ paths). JMAP: single Mailbox/set with client ids c0,c1,… and modal-parent inference for bare names. Returns name -> Label for every requested name.

string[]

Promise<Map<string, Label>>

MailProvider.ensureLabels


getEmail(id): Promise<EmailMeta>

Defined in: src/provider/types.ts:49

string

Promise<EmailMeta>

MailProvider.getEmail


listLabels(): Promise<Label[]>

Defined in: src/provider/types.ts:40

Promise<Label[]>

MailProvider.listLabels


searchEmails(query, page): Promise<SearchPage>

Defined in: src/provider/types.ts:48

One page. Adapters normalize array-vs-{items} response shapes.

SearchQuery

PageRequest

Promise<SearchPage>

MailProvider.searchEmails