Browse docs

Limit what an MCP client can do

Give each local or HTTP MCP connection only the Fluxmail email permissions it needs.

Fluxmail can limit the email actions available to each MCP connection. Give a research agent read-only access, or let an inbox organizer manage messages without granting send or permanent-delete access.

Permissions control which tools Fluxmail exposes to the client, and which actions are accepted by certain tools, e.g. modify_emails.

Choose a permission profile

Profile What it allows
read-only Read and search mail, list folders and scheduled sends, and download attachments
read-write Everything in read-only, plus drafts, inbox organization, and moving messages to or from Trash
full Everything in read-write, plus sending mail and permanently deleting messages

Fluxmail uses full when you do not choose a profile. Set a narrower profile for clients that do not need every email action.

Limit a local stdio connection

Pass a profile when your MCP client launches Fluxmail:

fluxmail stdio --profile read-only

For a client config file, put the profile in the argument list:

{
  "mcpServers": {
    "fluxmail": {
      "command": "fluxmail",
      "args": ["stdio", "--profile", "read-only"]
    }
  }
}

Limit an HTTP connection

HTTP permissions belong to the API key. Create a separate key for each MCP client so you can change or revoke one connection without affecting the others.

fluxmail apikey create --name research-agent --profile read-only
fluxmail apikey create --name inbox-agent --profile read-write

The key is shown once. fluxmail apikey list shows each key ID and permission profile without revealing the secret.

Change an existing key by its ID:

fluxmail apikey permissions <key-id> --profile read-only

Existing keys and keys created without permission options use full. When FLUXMAIL_AUTH=none, the HTTP endpoint also uses full because there is no API key to identify the client. Only disable authentication behind a network boundary you control.

Build a custom policy

Use repeated --allow options when the named profiles are too broad. List the available capabilities first:

fluxmail apikey capabilities
Capability Actions
mail.read List, search, and read mail; inspect status and folders; list scheduled sends; download attachments
mail.drafts Create, update, and delete drafts; cancel scheduled sends
mail.organize Mark read or unread, star, archive, move, and manage user labels
mail.trash Move messages to or from Trash
mail.delete Permanently delete messages
mail.send Send or schedule messages

Create a custom HTTP key like this:

fluxmail apikey create \
  --name drafting-agent \
  --allow mail.read \
  --allow mail.drafts

The same options work with stdio:

fluxmail stdio --allow mail.read --allow mail.organize

Some workflows need more than one capability. Reply drafts need mail.drafts and mail.read; replies need mail.send and mail.read; forwarding also needs mail.send and mail.read.