Skip to main content

Migadu MCP Server

PyPI version Python 3.13+ License: MIT

Control your Migadu email hosting from AI assistants via the Model Context Protocol.

What is Migadu?

Migadu is a Swiss email host that prices on actual usage instead of mailbox count, with standard SMTP/IMAP/POP3 and no lock-in.

What this does

Covers the full Migadu API surface as MCP tools:

  • Domains — create, update, activate, DNS records, diagnostics, usage
  • Mailboxes — CRUD, autoresponders, password resets
  • Aliases — forwarding rules without a mailbox behind them
  • Identities — send-as addresses on a mailbox
  • Forwardings — external delivery copies with confirmation flow
  • Rewrites — pattern-based routing rules

Setup

Get an API key at Migadu Admin → My Account → API Keys.

Add to your MCP client config (e.g. Claude Desktop, ~/.claude.json, etc.):

{
  "mcpServers": {
    "migadu": {
      "command": "uvx",
      "args": ["migadu-mcp"],
      "env": {
        "MIGADU_EMAIL": "you@example.com",
        "MIGADU_API_KEY": "your-api-key",
        "MIGADU_DOMAIN": "example.com"
      }
    }
  }
}

Or via the Claude Code CLI:

claude mcp add migadu \
  --env MIGADU_EMAIL=you@example.com \
  --env MIGADU_API_KEY=your-api-key \
  --env MIGADU_DOMAIN=example.com \
  -- uvx migadu-mcp

MIGADU_DOMAIN is optional. It's the default domain used by tools like list_mailboxes when you don't pass one explicitly. Skip it if you manage multiple domains and prefer to pass domain on every call.

Example usage

Once configured, ask your AI assistant things like:

  • "Onboard a new domain acme.example — walk me through DNS setup and activation"
  • "Create mailboxes for alice@acme.example and bob@acme.example"
  • "Set up support@acme.example as an alias to both Alice and Bob"
  • "Configure an autoresponder on vacation@acme.example until January 15th"
  • "Delete the mailboxes for everyone who left: list of addresses..."

Three built-in prompts are registered to scaffold common workflows: mailbox_creation_wizard, bulk_operation_planner, domain_onboarding.

Tools

Domain

list_domains, get_domain, create_domain, update_domain, get_domain_records, get_domain_diagnostics, activate_domain, get_domain_usage

Mailbox

list_mailboxes, get_mailbox, create_mailbox, update_mailbox, delete_mailbox, reset_mailbox_password, set_autoresponder

Alias

list_aliases, get_alias, create_alias, update_alias, delete_alias

Identity

list_identities, get_identity, create_identity, update_identity, delete_identity

Forwarding

list_forwardings, get_forwarding, create_forwarding, update_forwarding, delete_forwarding

Rewrite

list_rewrites, get_rewrite, create_rewrite, update_rewrite, delete_rewrite

All mutation tools (create_*, update_*, delete_*, activate_*, set_autoresponder, reset_mailbox_password) accept a list[dict] of items and return a bulk-result envelope with per-item success/failure. A single-item list works too.

Resources

Read-only views addressable by URI:

  • domains:// — all domains on the account
  • domain://{name} — one domain's full config
  • domain-records://{name} — required DNS records for setup
  • domain-usage://{name} — message + storage metrics
  • mailboxes://{domain} — mailboxes for a domain
  • mailbox://{domain}/{local_part} — one mailbox
  • identities://{domain}/{mailbox} — identities on a mailbox
  • forwardings://{domain}/{mailbox} — forwardings on a mailbox
  • aliases://{domain} — aliases for a domain
  • rewrites://{domain} — rewrite rules for a domain

Notes

  • Migadu's API returns HTTP 500 on successful DELETE (known quirk). The client treats 200/204/404/500 as success on DELETE; other codes raise.
  • One long-lived httpx.AsyncClient per server process, closed on shutdown via FastMCP lifespan hook.
  • list_* tools pass responses through a static summarizer when they exceed ~2000 tokens, returning a count plus a sample instead of flooding context.

Development

git clone https://github.com/Michaelzag/migadu-mcp.git
cd migadu-mcp
uv sync --group dev

# Quality gates (same as CI)
uv run ruff format --check .
uv run ruff check migadu_mcp/ tests/
uv run ty check migadu_mcp/
uv run pytest
uv run bandit -r migadu_mcp/

Tests use respx to mock the Migadu API — no credentials needed. Integration tests (behind @pytest.mark.integration) hit the real API and are skipped by default.

License

MIT — see LICENSE.

Metadata

Release files for migadu-mcp 3.6.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for migadu-mcp 3.6.1
File Size Uploaded
migadu_mcp-3.6.1.tar.gz 56.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for migadu-mcp 3.6.1
File Interpreter ABI Platform
migadu_mcp-3.6.1-py3-none-any.whl Python 3 none any Details

Total release size: 87.3 kB

Release files / migadu_mcp-3.6.1.tar.gz

Download URL migadu_mcp-3.6.1.tar.gz
Size 56.5 kB
Tags Source
SHA-256 checksum
How to use checksums
a0d67429d68658b5a6e94fa7015a186ddadc6aa16d80501248ea397097b9a73f
BLAKE2b-256 checksum
How to use checksums
b9d4457402d05959e7a1e5b8e54a9a8a7520b31115a38c16b529151584df3d3f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Apr 22, 2026.

Transparency log

Release files / migadu_mcp-3.6.1-py3-none-any.whl

Download URL migadu_mcp-3.6.1-py3-none-any.whl
Size 30.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
869f929e1d5acab5909082e15c3c129dd66c318419183d7ac92a85b246d43d72
BLAKE2b-256 checksum
How to use checksums
78624746cbbea0abc2815e2c19b9bd92f8677e1c329c23e6fa9b4f1b33749331
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Apr 22, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

3.6.1 This release

2 release files

3.6.0

2 release files

3.5.1

2 release files

3.5.0

2 release files

3.4.0

2 release files

3.3.0

2 release files

3.2.0

2 release files

3.1.5

2 release files

3.1.1

2 release files

3.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page