Skip to content

Connect a client

Create a token in MailFlow (Settings → Security → API tokens) with the scopes the client should have. Then add the server; the sign-in page that opens takes the token.

Settings → Connectors → Add custom connector, with https://mailflow-mcp.example.org/mcp.

Run the command, then /mcp to sign in.

claude mcp add mailflow --scope user --transport http \
  https://mailflow-mcp.example.org/mcp

What happens at the sign-in

sequenceDiagram
  participant C as Client
  participant S as Sesamcp
  participant M as mailflow-mcp
  participant B as MailFlow
  C->>S: connect without a token
  S-->>C: 401, sign in here
  C->>S: sign-in form with the mfat_ token
  S->>B: try the token
  B-->>S: valid
  S-->>C: Sesamcp's own token
  C->>S: tool call with Sesamcp's token
  S->>M: the same call with the mfat_ token
  M->>B: API call with the mfat_ token
  B-->>M: data, or 401 / 403
  M-->>S: result
  S-->>C: result

Read it top to bottom: the mfat_… token is tried once at the sign-in, and after that the client only ever holds Sesamcp's token.

Renewing the token

MailFlow limits a token confirmed by single sign-on to 30 days at most. After that, create a new one and sign in to the connector again. If MailFlow refuses to create it, see Troubleshooting.