Mailbuttons — Claude Code MCP server for agent email
Mailbuttons gives an agent a scoped inbox and checks email actions against server-side rules. Use it when an agent needs to handle mail with human oversight.
claude mcp add --env MAILBUTTONS_API_KEY=<MAILBUTTONS_API_KEY> --env MAILBUTTONS_API_URL=<MAILBUTTONS_API_URL> --transport stdio mailbuttons-mbagai -- npx -y @mailbuttons/mcp-serverWhat Mailbuttons (mbag.ai) does
The server applies rules to incoming and outgoing mail. By default, messages from unknown senders are rejected, and the agent can inspect—but not edit—the recipient blocklist. Account send limits and a hash-linked audit record cover refusals too.
Connect Mailbuttons to Claude Code over HTTP or run it locally with npx. Local setup uses a Mailbuttons token and the MAILBUTTONS_API_KEY and MAILBUTTONS_API_URL environment variables. A person must approve external sending or a wider scope. The agent cannot approve its own request, so a sandbox token alone does not authorize mail to external recipients.
What it helps with
- give an agent a scoped mailbox
- reject messages from unknown senders
- block mail to selected recipients
- record sends and refusals in an audit log
- require human approval for external sending
Example prompts for the agent
- Check my Mailbuttons inbox and summarize the incoming messages.
- Draft a message to this recipient, but wait for approval before sending it externally.
- Find out why this email was blocked.
How to install Mailbuttons (mbag.ai)
1Platform CLI
claude mcp add --env MAILBUTTONS_API_KEY=<MAILBUTTONS_API_KEY> --env MAILBUTTONS_API_URL=<MAILBUTTONS_API_URL> --transport stdio mailbuttons-mbagai -- npx -y @mailbuttons/mcp-serverReplace <…> with your own values
2Platform CLI: remote server
claude mcp add --transport http mailbuttons-mbagai https://mailbuttons.com/api/v1/mcp/rpc1Platform CLI: remote server
codex mcp add mailbuttons-mbagai --url https://mailbuttons.com/api/v1/mcp/rpc2Platform CLI
codex mcp add mailbuttons-mbagai --env MAILBUTTONS_API_KEY=<MAILBUTTONS_API_KEY> --env MAILBUTTONS_API_URL=<MAILBUTTONS_API_URL> -- npx -y @mailbuttons/mcp-serverReplace <…> with your own values
Config file
{
"mcpServers": {
"mailbuttons-mbagai": {
"url": "https://mailbuttons.com/api/v1/mcp/rpc"
}
}
}{
"mcpServers": {
"mailbuttons-mbagai": {
"command": "npx",
"args": [
"-y",
"@mailbuttons/mcp-server"
],
"env": {
"MAILBUTTONS_API_KEY": "<MAILBUTTONS_API_KEY>",
"MAILBUTTONS_API_URL": "<MAILBUTTONS_API_URL>"
}
}
}
}Replace <…> with your own values
Config file
{
"servers": {
"mailbuttons-mbagai": {
"type": "http",
"url": "https://mailbuttons.com/api/v1/mcp/rpc"
}
}
}{
"servers": {
"mailbuttons-mbagai": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"@mailbuttons/mcp-server"
],
"env": {
"MAILBUTTONS_API_KEY": "<MAILBUTTONS_API_KEY>",
"MAILBUTTONS_API_URL": "<MAILBUTTONS_API_URL>"
}
}
}
}Replace <…> with your own values
1Platform CLI: remote server
gemini mcp add -t http mailbuttons-mbagai https://mailbuttons.com/api/v1/mcp/rpc2Platform CLI
gemini mcp add -e MAILBUTTONS_API_KEY=<MAILBUTTONS_API_KEY> -e MAILBUTTONS_API_URL=<MAILBUTTONS_API_URL> mailbuttons-mbagai npx -y @mailbuttons/mcp-serverReplace <…> with your own values
Step by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more
Questions about Mailbuttons (mbag.ai)
How do I install Mailbuttons in Claude Code?
To connect over HTTP, run claude mcp add --transport http mailbuttons-mbagai https://mailbuttons.com/api/v1/mcp/rpc.
What does Mailbuttons do?
It gives an agent a mailbox and applies rules to incoming and outgoing email. Its audit record includes rejected actions.
Can the agent enable external sending on its own?
No. A named human must approve external sending or a broader scope; the agent cannot approve its own request.