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.3.tar.gz (9.4 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.3-py3-none-any.whl (15.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: mailwire_sdk-0.1.3.tar.gz
  • Upload date:
  • Size: 9.4 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.3.tar.gz
Algorithm Hash digest
SHA256 f4b1c917838374d6def154d807882b18bb7eceb25359b423674b91ae43663865
MD5 4d467be68157ad1503ee935799bbed30
BLAKE2b-256 4d76ccdf25a8b772799a5bfd68ad371b1f22a529b7542bc8311a3f7a5f572625

See more details on using hashes here.

Provenance

The following attestation bundles were made for mailwire_sdk-0.1.3.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.3-py3-none-any.whl.

File metadata

  • Download URL: mailwire_sdk-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 15.5 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.3-py3-none-any.whl
Algorithm Hash digest
SHA256 6a492451e85ed8c730de4ce6971174f46f78613ba45ef2c190583aff12d349bc
MD5 51a4a63a2b511ad0b0cc445cc7722172
BLAKE2b-256 882787169527bc13c0c3a594c650add1611a18dd230117638e98c7cb32c159d2

See more details on using hashes here.

Provenance

The following attestation bundles were made for mailwire_sdk-0.1.3-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