Install MailCal

Five steps from a clean machine to your first agent with mailbox and calendar access. All examples use placeholders—replace them with your own values.

Step 1

Requirements

You need the .NET 10 SDK. Global .NET tools are installed to ~/.dotnet/tools—make sure that folder is on your PATH.

Step 2

Install the tools

Install the command line, the MCP server, or both. No nuget.org access token required.

dotnet tool install -g Ironbrain.MailCal.Cli
dotnet tool install -g Ironbrain.MailCal.Mcp
ironbrain-mailcal --version

Update later with dotnet tool update -g Ironbrain.MailCal.Cli or Ironbrain.MailCal.Mcp.

Step 3

Configure accounts

MailCal reads ~/.config/ironbrain/mailcal.json by default. Create the file and protect it, since it contains passwords:

mkdir -p ~/.config/ironbrain
touch ~/.config/ironbrain/mailcal.json
chmod 600 ~/.config/ironbrain/mailcal.json

This example sets up two accounts: assistant may send, personal is read-only.

{
  "defaultAccount": "assistant",
  "accounts": {
    "assistant": {
      "Email": {
        "Imap": {
          "Host": "mail.example.com",
          "Port": 993,
          "UseSsl": true,
          "Username": "bot@example.com",
          "Password": "REPLACE_ME"
        },
        "Smtp": {
          "Enabled": true,
          "Host": "mail.example.com",
          "Port": 587,
          "UseStartTls": true,
          "Username": "bot@example.com",
          "Password": "REPLACE_ME",
          "FromAddress": "bot@example.com",
          "FromName": "Assistant"
        }
      },
      "Calendar": {
        "HomeUrl": "https://mail.example.com/SOGo/dav/bot@example.com/Calendar/",
        "Username": "bot@example.com",
        "Password": "REPLACE_ME",
        "DefaultWriteCalendar": "personal"
      }
    },
    "personal": {
      "Email": {
        "Imap": {
          "Host": "mail.example.com",
          "Port": 993,
          "UseSsl": true,
          "Username": "you@example.com",
          "Password": "REPLACE_ME"
        },
        "Smtp": {
          "Enabled": false
        }
      }
    }
  }
}
  • Different path: use --config or the IRONBRAIN_MAILCAL_CONFIG environment variable.
  • Choosing an account: -a / --account or IRONBRAIN_MAILCAL_ACCOUNT; otherwise defaultAccount applies.
  • Calendars: with HomeUrl, MailCal discovers all of the account’s calendars itself, including shared ones. DefaultWriteCalendar decides where new appointments go.
  • Archive: unless configured otherwise, MailCal archives to Archive/{CurrentYear}.

A more detailed example with every option is in the repository at samples/mailcal.example.json.

Step 4

Test the connection

Check that accounts, mailboxes, and calendars are reachable. account list shows the configuration without passwords.

ironbrain-mailcal account list
ironbrain-mailcal -a assistant mail list --limit 5
ironbrain-mailcal -a personal mail list --limit 5
ironbrain-mailcal -a assistant cal calendars
ironbrain-mailcal -a assistant cal list --date today

Step 5

Add it to Cursor

The easiest way is the MailCal plugin on cursor.directory. Alternatively, add this entry to your MCP settings:

{
  "mcpServers": {
    "ironbrain-mailcal-mcp": {
      "command": "ironbrain-mailcal-mcp",
      "env": {
        "IRONBRAIN_MAILCAL_CONFIG": "${HOME}/.config/ironbrain/mailcal.json"
      }
    }
  }
}

Other MCP clients such as Claude Desktop add the server the same way, as a local command.

Security

  • Passwords are never logged or printed.
  • Keep the configuration file out of Git repositories and readable only by your user.
  • For personal mailboxes, give agents an account without send permission ("Enabled": false).

← Back to MailCal View on GitHub