Skip to main content

Python SDK for mailwire-x1

Project description

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"])

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

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mailwire_sdk-0.1.2.tar.gz (9.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mailwire_sdk-0.1.2-py3-none-any.whl (15.3 kB view details)

Uploaded Python 3

File details

Details for the file mailwire_sdk-0.1.2.tar.gz.

File metadata

  • Download URL: mailwire_sdk-0.1.2.tar.gz
  • Upload date:
  • Size: 9.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for mailwire_sdk-0.1.2.tar.gz
Algorithm Hash digest
SHA256 0f30493b4bd6c3ec5b980b44bda26644812ba06a5299596037df0e18c642067c
MD5 87980046b407a9736431b0bb00bc7cc2
BLAKE2b-256 f92ec1c0684ca6ac5eb2ad978d315d5e7ff49acb4f1cac0243f8c95e65b27a47

See more details on using hashes here.

Provenance

The following attestation bundles were made for mailwire_sdk-0.1.2.tar.gz:

Publisher: sdk-release.yml on BlendingBytes/mailwire-agent-email

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mailwire_sdk-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: mailwire_sdk-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 15.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for mailwire_sdk-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 c5769024a131ce14d4f39bf7cbb0b9d62635fca072ce3e7b20ff6d710bc271be
MD5 e5846c2dd6f5538549fbb0bfc14ddaaa
BLAKE2b-256 1db737f08a526fdec1a4bae38b04c2226b9c7eec9ba88fe79b4372869bf86ec1

See more details on using hashes here.

Provenance

The following attestation bundles were made for mailwire_sdk-0.1.2-py3-none-any.whl:

Publisher: sdk-release.yml on BlendingBytes/mailwire-agent-email

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page