Skip to main content
Glama
ews-gate

ews-gate

ews-gate

One MCP URL for every Wick denizen's Exchange mailbox. Each caller reaches only their own.

Built on viartemev/outlook-ews-mcp (MIT), pinned by commit in the Dockerfile and used as a library, not forked:

  • Identity: the caller's bearer token is hashed and matched to one [[denizen]] in gate.toml. The config holds only sha256 hashes, never tokens or passwords.

  • Isolation: one upstream MCP server object per denizen in one process: their own Exchange client and NTLM login, their own concurrency gate, MCP sessions and attachment root. No impersonation role; Exchange itself enforces what each login may see. A session id from one denizen 404s for another.

  • Attachments as bytes: upstream's tools take server-side paths, which a remote caller can't use and which would let one denizen attach another's files. Every path argument becomes {filename, content_base64} (send, reply, forward, drafts, add_attachment), and get_attachment returns bytes. The gate refuses to start if any tool still takes a path.

  • Lockout guard: one rejected login closes the gate for that denizen until restart, so a stale password costs AD one failed attempt, not one per tool call. Other denizens are unaffected.

  • Cost: ~80 MiB for the whole gate (measured with 2 denizens), not ~80 MiB per denizen.

Run

ews-gate token            # prints {"token": ..., "token_sha256": ...}; token to the denizen, hash to gate.toml
EWS_GATE_CONFIG=/etc/ews-gate/gate.toml ews-gate    # serves /mcp and /healthz on :8080

Config format: see ews_gate/config.py. Passwords come from password_file (a mounted secret).

Related MCP server: oauth-mail-mcp

Test

tests/e2e_client.py covers: bad/missing token → 401; tool list and bytes-only schema; mailbox info and folders; attachment round trip through a draft (byte-identical, filename stripped of ../); a ghost denizen gets an auth error and none of the real data; a session hijack across tokens → 404.

Later

Authelia OIDC: accept Authelia-issued access tokens next to static ones, mapping a claim to a denizen, and serve OAuth protected-resource metadata so claude.ai and mobile clients can sign in.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    Related MCP Connectors

    • Hosted email MCP for your own Gmail, Outlook.com, Microsoft 365, iCloud or IMAP inbox: read, search, draft, reply in thread, forward and file mail. It moves or flags up to 500 messages in one call, and a send leaves exactly one copy in Sent. A calendar is a separate connection, and connecting one adds diary and scheduling tools.

    • Your agent needs a mailbox of its own — to receive, thread, draft and send, with attachments, without borrowing your personal inbox or your company's SMTP. **What you can ask for** • "Create an inbox for this agent and tell me its address." • "Read the new messages in this thread and draft a reply." • "Send this message with the attachment and wait for the response." • "Search this inbox for everything from that domain." • "Show delivery metrics and the events on this inbox." **How to use it** Point any MCP client at https://mcp.aisa.one/mail/mcp and sign in with OAuth — there is no key to create or paste. 49 tools: create and delete inboxes, list and read messages, raw message bodies, attachments, threads, drafts and draft attachments, send and reply, message search, inbox events, metrics, and list entries — reads and writes. **Why this rather than the source** A real inbox an agent owns, rather than an SMTP credential it borrows from a human. **It is also a door to the rest** The same login reaches 26 sources and 580+ operations. Find the contact elsewhere in the catalogue, then write to them from here — without adding a second server. **What it costs** Finding and inspecting an operation is free. Running one is billed per call at API prices, with no seat and no monthly minimum, and every call takes max_price_usd so an agent cannot overspend by accident. **Where else it reaches** https://mcp.aisa.one/sales/mcp finds the person to write to.

    • Hosted MCP server for Gmail, Outlook, iCloud, Fastmail & Yahoo Mail with per-workspace controls.

      https://mcp.postkeep.ai/mcp
    • Manage domains, mailboxes, inbox, campaigns and deliverability from any MCP client.

      https://www.mailmark.dev/mcp

    Related MCP Servers

    • A
      license
      Not graded
      quality
      B
      maintenance
      Exposes Exchange Online mailbox, distribution-group, and mobile-device management operations as MCP tools over Streamable HTTP, covering actions Microsoft Graph cannot express such as converting mailboxes to shared, hiding from the GAL, and removing distribution group members.
      Apache 2.0
    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables authenticated MCP clients to list, search, read, flag, draft, and optionally send mail from one Gmail or Microsoft 365 mailbox using OAuth without app registration.
      MIT
    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables MCP clients to read and organize mail, manage drafts, and perform broader mailbox operations under configurable read-only, draft-only, or full-access modes.
      1
      MIT
    • A
      license
      Not graded
      quality
      C
      maintenance
      Gives AI clients controlled access to one or more Microsoft Exchange mailboxes over EWS to read, search, file, flag, send, and manage inbox rules and calendars. Multiple mailboxes are served from one endpoint with per-account read-only, send, and calendar-write gates that default to closed.
      MIT