# Mailbuttons (mbag.ai)

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.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed, Gemini CLI · ★ 1
- Author: mailbuttons
- License: MIT · policy=link-only · description only; the file stays with the author
- Source: https://github.com/mailbuttons/mcp-server
- Updated: 2026-07-15
- HTML: https://affpapa.org/en/nevibecode/mcp/mailbuttons-mbagai

## What it 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.

## Requirements
- Needs: Node.js (commands run via npx)
- Remote server: `https://mailbuttons.com/api/v1/mcp/rpc`
- Environment variables: `MAILBUTTONS_API_KEY`, `MAILBUTTONS_API_URL` — keys and tokens: ask the human for the values, never commit them or put them in shared files.

## Install

### Claude Code (native platform)

1. **Platform CLI**
```bash
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-server
```
Replace <…> with your own values

2. **Platform CLI: remote server**
```bash
claude mcp add --transport http mailbuttons-mbagai https://mailbuttons.com/api/v1/mcp/rpc
```

### Codex

1. **Platform CLI: remote server**
```bash
codex mcp add mailbuttons-mbagai --url https://mailbuttons.com/api/v1/mcp/rpc
```

2. **Platform CLI**
```bash
codex mcp add mailbuttons-mbagai --env MAILBUTTONS_API_KEY=<MAILBUTTONS_API_KEY> --env MAILBUTTONS_API_URL=<MAILBUTTONS_API_URL> -- npx -y @mailbuttons/mcp-server
```
Replace <…> with your own values

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "mailbuttons-mbagai": {
            "url": "https://mailbuttons.com/api/v1/mcp/rpc"
        }
    }
}
```
File `.cursor/mcp.json`:
```json
{
    "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

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "mailbuttons-mbagai": {
            "type": "http",
            "url": "https://mailbuttons.com/api/v1/mcp/rpc"
        }
    }
}
```
File `.vscode/mcp.json`:
```json
{
    "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

### Gemini CLI

1. **Platform CLI: remote server**
```bash
gemini mcp add -t http mailbuttons-mbagai https://mailbuttons.com/api/v1/mcp/rpc
```

2. **Platform CLI**
```bash
gemini mcp add -e MAILBUTTONS_API_KEY=<MAILBUTTONS_API_KEY> -e MAILBUTTONS_API_URL=<MAILBUTTONS_API_URL> mailbuttons-mbagai npx -y @mailbuttons/mcp-server
```
Replace <…> with your own values

## When to use it
- 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
- 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.

## Similar
- [REA](https://affpapa.org/en/nevibecode/mcp/rea.md) — MCP server · ★ 392262
- [GitHub](https://affpapa.org/en/nevibecode/mcp/github.md) — MCP server · ★ 33989
- [Netdata](https://affpapa.org/en/nevibecode/mcp/netdata.md) — MCP server · ★ 81163
- [browser-use](https://affpapa.org/en/nevibecode/mcp/browser-use.md) — MCP server · ★ 119231
- [Codebase Memory](https://affpapa.org/en/nevibecode/mcp/codebase-memory.md) — MCP server · ★ 47577
- [mcp-server](https://affpapa.org/en/nevibecode/mcp/mcp-server.md) — MCP server · ★ 43902

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
