Skip to main content

mailwire-sdk

Python SDK for mailwire-x1.

Install

pip install mailwire-sdk

To also install the MCP server entry point:

pip install 'mailwire-sdk[mcp]'

Usage

from mailwire_sdk import Client

with Client(token="mw_live_...", base_url="https://api.example.com") as mw:
    # Create an inbox on a verified tenant domain
    inbox = mw.inboxes.create(
        client_id="lena.taiwo",
        display_name="Lena",
        domain_id="dom_...",
        shareable_local_part="lena",
        private_address_count=2,
    )

    # Send a message
    msg = mw.messages.send(
        inbox_id=inbox["id"],
        from_address="Lena <lena@someonehq.com>",
        to=["recipient@example.com"],
        subject="Catching up",
        text="Hi — thinking of you.",
        idempotency_key="20260503-lena-001",
    )

    # List recent messages
    for m in mw.messages.list(inbox_id=inbox["id"], limit=20):
        print(m["id"], m["subject"])

    # Read the files on a message. Metadata comes with the message; the
    # bytes are fetched on demand.
    msg = mw.messages.get("msg_...")
    for att in msg["attachments"]:
        if att["is_inline"]:
            continue  # inline image, referenced from html_body as cid:<content_id>
        data = mw.messages.get_attachment(msg["id"], att["id"])
        print(att["filename"], att["content_type"], len(data))

Sub-clients

Attribute Resource
mw.tenants tenant CRUD (admin scope)
mw.api_keys mint / list / get / revoke (admin scope)
mw.domains register, fetch DNS records, verify, delete
mw.inboxes create, list, get, update, archive, add_address
mw.messages send, list, get, list_attachments, get_attachment

Errors

Every non-2xx response from mailwire becomes a typed exception:

from mailwire_sdk import (
    Client,
    AuthError,
    PermissionError,
    NotFoundError,
    ConflictError,
    ValidationError,
    ProviderError,
    MailwireError,  # base — catch-all
)

try:
    mw.messages.send(...)
except ConflictError as exc:
    # idempotency-key reused with a different body
    print(exc.code, exc.details)
except PermissionError as exc:
    # token is missing the required scope
    print("missing:", exc.details["required_scope"])
except MailwireError as exc:
    # any other API error — exc.type, exc.status_code, exc.request_id available
    raise

MCP server

mailwire-sdk[mcp] ships a stdio MCP server. Wire it into Claude Desktop / your IDE:

{
  "mcpServers": {
    "mailwire": {
      "command": "mailwire-mcp",
      "env": {
        "MAILWIRE_BASE_URL": "https://api.example.com",
        "MAILWIRE_TOKEN": "mw_live_..."
      }
    }
  }
}

Tools exposed:

  • mailwire_list_inboxes
  • mailwire_get_inbox
  • mailwire_send_message
  • mailwire_list_messages
  • mailwire_get_message

See docs/mcp.md for tool argument schemas and the end-to-end agent loop.

Versioning

mailwire-sdk 0.1.0 targets the mailwire-x1 v1 API. Breaking server changes go to a new /v2/ surface and a major-version SDK bump. Additive changes (new optional fields, new endpoints) ship in patch / minor versions.

Metadata

Release files for mailwire-sdk 0.1.6

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

Source distribution (sdist)

Source distribution for mailwire-sdk 0.1.6
File Size Uploaded Provenance Actions
mailwire_sdk-0.1.6.tar.gz 10.0 kB With provenance Details for mailwire_sdk-0.1.6.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for mailwire-sdk 0.1.6
File Interpreter ABI Platform Actions
mailwire_sdk-0.1.6-py3-none-any.whl Python 3 none any Details for mailwire_sdk-0.1.6-py3-none-any.whl

Total release size: 26.3 kB

Release files / mailwire_sdk-0.1.6.tar.gz

Download URL mailwire_sdk-0.1.6.tar.gz
Size 10.0 kB
Tags Source
SHA-256 checksum
How to use checksums
7ea50344c8b399d0cf0607b4753f9d6cb806a89e3e147099864241a62d0b2a91
BLAKE2b-256 checksum
How to use checksums
e80f2b76e5abc71c5b469f300658c5f470498f31d91c04fa960f23c06e9d3dce
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Sep 28, 2026.

Transparency log

Release files / mailwire_sdk-0.1.6-py3-none-any.whl

Download URL mailwire_sdk-0.1.6-py3-none-any.whl
Size 16.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
72592b16aee5e4a446d3dc2dec4c9bb2c1af3fc98a5dceac77a7c09b8cebc8a6
BLAKE2b-256 checksum
How to use checksums
923dbfcf3d119c1fccb5a8a3d38bd2c6082c0ce1e2169a39afc003ea7140cb41
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Sep 28, 2026.

Transparency log

Security for mailwire-sdk 0.1.6

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for mailwire_sdk-0.1.6.tar.gz

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 Sep 28, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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