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

Uploaded Python 3

File details

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

File metadata

  • Download URL: mailwire_sdk-0.1.4.tar.gz
  • Upload date:
  • Size: 9.3 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.4.tar.gz
Algorithm Hash digest
SHA256 b682d3245c51057eafddd8f647a24f5c78f97bef9602d43c1f852a08f32ca8de
MD5 3382b1d6ff6f94a84383f34048d4e21e
BLAKE2b-256 0c48ff96a4f7f1257c4ebd372c3f533930d6daf79500d18e7fe40ec4033b0243

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: mailwire_sdk-0.1.4-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.4-py3-none-any.whl
Algorithm Hash digest
SHA256 3625c74bbf88cbb874c9dab12301f67e8dae9b45edadb4b4d720a7bdb3c8171c
MD5 919cd6029106be6fb4a3631c1ce5bd10
BLAKE2b-256 c322ea258b734ddea3e1efea46d69d7b51c3e5cacfc700c752ef0dee5f4b44cc

See more details on using hashes here.

Provenance

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