Skip to content

Runs on Sesamcp

Context and Problem Statement

MailFlow has no OpenAPI spec, so this server's tools are hand-written (ADR 0001) and it has no sign-in of its own: the client sends its mfat_… token, or the proxy in front signs the person in. What it shares with the other servers is the frame around the tools: the token gate, the token on every call, the Host allowlist, /health and the HTTP app. Sesamcp is that frame. Should this server use it?

Decision Outcome

It runs on Sesamcp 0.1.3 for the frame only. The tools, ALLOWED_CALLS and GuardedTransport stay as they are. MailFlowTokenAuth is Sesamcp's GrantAuth; build_app is Sesamcp's build_http_app in token mode, with TokenFormatGate in front, which keeps the old rule that only an mfat_… token, raw or as Bearer, gets through, with the same 401 text.

Consequences

  • Good: MCP_ALLOWED_HOSTS now works. It was a silent no-op here (FastMCP's allowed_hosts does nothing without host_origin_protection=True), the same bug Sesamcp 0.1.3 fixed; test_allowed_hosts_refuse_another_host pins it, /health included.
  • Neutral: FastMCP 3.4 → 4.2.6 and Python 3.12 (Sesamcp's floor); the image already ran 3.13.
  • Neutral: the image's builder installs git, as Sesamcp is pinned by git tag.
  • Not used: Sesamcp's spec loading, tool generation and sign-in; there is nothing here for them to do.