Skip to main content

MEDRE XMPP adapter

Bridge live text between configured XMPP contacts, multi-user rooms and other MEDRE transports. The adapter uses Slixmpp for XMPP negotiation, authentication, TLS and MUC; MEDRE handles routing, persistence, policy and delivery planning.

Install

For a MEDRE installation managed by uv tools, install the provider explicitly:

uv tool install medre
medre adapters install xmpp
medre adapters check

Core 0.1.1 and later default fresh adapter requests to index packages. Existing saved Git requests and catalogs retain their sources. On Windows, run the printed uv installation command after MEDRE exits. No sibling clones are required. To opt into Git development, a custom source catalog can provide an xmpp alias (pin a full merged commit for reproducibility):

adapters:
  xmpp: medre-adapter-xmpp @ git+https://github.com/jeremiah-k/medre-adapter-xmpp.git@main

Use medre adapters install xmpp --sources /path/to/sources.yaml with that catalog. The catalog chooses package sources; runtime YAML contains connection settings.

Configure

Create an account on an XMPP server with a publicly trusted TLS certificate and join permissions for the selected rooms. Protect the runtime config as private.

medre config native --transport xmpp --adapter-id chat collects the connection fields offline: the account JID, an optional password, the optional room nickname, and optional host/port overrides. The form contacts no server, writes a private YAML file only after the typed config validates, and stores an entered password only in that file. Creating the TLS account, selecting rooms and peers, and granting join permissions stay manual: the form references an existing account and cannot provision one.

adapters:
  xmpp:
    chat:
      adapter_kind: real
      jid: bridge@example.org/medre
      nickname: medre
      rooms: [bridge@conference.example.org]
      peers: [friend@example.org]
      origin_label: XMPP
      # password is supplied through the environment, not version control.

Set MEDRE_ADAPTER__CHAT__PASSWORD in the process environment through the secret management mechanism used for the deployment; an environment override keeps precedence over a password stored in the file. Both the account's domain and configured conversations use prepared JIDs. Host and port overrides are optional and must appear together; omit both to use DNS SRV discovery. The connection requires verified TLS and offers no plaintext or certificate-check bypass. Transport encryption is not end-to-end encryption.

Use medre config bridge to connect the instance to another configured adapter. Use the room's bare JID as its context, or a configured peer's bare JID for a direct conversation. medre routes plan previews the routes offline. The adapter rejects destinations absent from rooms and peers and does not infer rooms from server names. The source side of room messages identifies the actual occupant (room@service/nick); direct messages use the contact's bare JID.

medre config sample includes SDK-free fake XMPP values after installation. Fake smoke evidence exercises routing and rendering; it proves no server login or native transport delivery.

Behavior

  • Relay text with MEDRE's shared attribution formatter. relay_prefix defaults to [{origin_label}] {sender}: followed by a space; an empty string suppresses it.
  • Join every configured MUC room before readiness, request zero history, and rejoin after disconnect. Authentication rejection requires operator action.
  • Exclude self echoes, delayed history, bodyless typing/receipt notifications, and unsupported edit/retract/reaction compatibility bodies.
  • Bridge native replies with destination-scoped references and readable quote fallback; use textual relation fallback when the native target is unavailable.
  • Preserve bounded XEP-0393 presentation and explicit unstyled content; retain plain text when semantic styles cannot be represented safely.
  • Forward opt-in transient typing through XEP-0085, with negotiated direct peers and configured MUC rooms; activity stays outside message history.
  • Bound pending inbound work and reject oversized output without silent clipping.
  • Correlate own MUC echoes with trusted room-issued IDs, with bounded waits; missing correlation does not turn a completed transport write into a retry.
  • Report local TLS transport writes separately from recipient delivery/read state.
  • Record supplied native metadata honestly: the negotiated TLS state on the transport slot, the room's XEP-0421 occupant-id, and a bounded opted-in public_facts projection (message type, stanza-ID trust outcome) feeding core's bridge context. None of these imply end-to-end encryption or sender authority.

This live bridge does not recover offline messages or room archives. XHTML, attachments, presence, read receipts, native mutations, OMEMO and puppeting are not implemented or advertised. The protocol design explains the standards and seams for those extensions. The adapter contract defines behavior; configuration and native metadata schemas publish the shapes.

Develop and test

Keep the core checkout and provider checkout anywhere. From the core checkout:

uv sync --locked --extra dev
uv run --no-sync medre dev sync --sources /path/to/sources.yaml \
  --editable xmpp=/path/to/medre-adapter-xmpp xmpp
uv run --no-sync medre dev test --sources /path/to/sources.yaml \
  --editable xmpp=/path/to/medre-adapter-xmpp xmpp -- -q

The source catalog above adds the alias while the editable path selects the actual checkout. Use dev sync --sdk to install native dependencies, then the SDK-only selection in contributing for pinned SDK contracts. Keep the same catalog and editable selection on both commands; a local .medre-dev.yaml profile can remember them. No temporary core branch is recorded in package requirements, lockfiles or CI variables.

For an existing Python environment, install the chosen core checkout and this provider using that interpreter's pip interface. The deterministic suite needs core's dev dependencies; the SDK tier additionally needs the pinned Slixmpp SDK. CI checks core main, resolved once per run, on Python 3.11–3.14 with SDK-free and native SDK jobs. Keep MEDRE_CORE_REF unset; core_ref is a one-run qualification input, not a committed dependency. An authenticated live-server test is separate from these offline checks.

Opt-in native server proof

A two-account test verifies actual MUC ingress and direct egress. Use a dedicated test server that permits temporary MUC creation. The test creates a uniquely named room and destroys it in cleanup; it never configures an existing room. Set MEDRE_XMPP_TEST_CONFIG to a private JSON file outside the checkout:

{
  "bot_jid": "bot@example.org/medre",
  "bot_password": "REPLACE_IN_PRIVATE_FILE",
  "peer_jid": "peer@example.org/test",
  "peer_password": "REPLACE_IN_PRIVATE_FILE",
  "muc_domain": "conference.example.org"
}

Optional host and port entries override DNS discovery together. For a local server using a dedicated test CA, SSL_CERT_FILE can select that trusted CA; certificate validation and hostname checks stay enabled. Run the adapter suite with -m live after installing its SDK. Credentials, private keys and runtime state stay outside Git. The offline CI jobs do not start an authenticated server.

Discovery cleanup

Stopping an XMPP connection cancels and awaits its pending entity-capability lookups as well as session setup and outgoing filters. Capability discovery remains enabled while connected; unanswered peer queries cannot retain background callbacks after shutdown.

Development tooling

See contributing for the shared Trunk quality gate and uv-based editable development workflow.

Metadata

Release files for medre-adapter-xmpp 0.2.0

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

Source distribution (sdist)

Source distribution for medre-adapter-xmpp 0.2.0
File Size Uploaded Provenance Actions
medre_adapter_xmpp-0.2.0.tar.gz 75.8 kB With provenance Details for medre_adapter_xmpp-0.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for medre-adapter-xmpp 0.2.0
File Interpreter ABI Platform Actions
medre_adapter_xmpp-0.2.0-py3-none-any.whl Python 3 none any Details for medre_adapter_xmpp-0.2.0-py3-none-any.whl

Total release size: 116.8 kB

Release files / medre_adapter_xmpp-0.2.0.tar.gz

Download URL medre_adapter_xmpp-0.2.0.tar.gz
Size 75.8 kB
Tags Source
SHA-256 checksum
How to use checksums
e9a70b03df9f630f64a80a453cd368f0c9d9d7583df780de907929a9c9930222
BLAKE2b-256 checksum
How to use checksums
fadab7d94eec7fa63aa4c04ab7e74664d79d8bd16d768070fdd49e2a8414172a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 19, 2026.

Transparency log

Release files / medre_adapter_xmpp-0.2.0-py3-none-any.whl

Download URL medre_adapter_xmpp-0.2.0-py3-none-any.whl
Size 41.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1164a9bcd8bf875ff28e6709a505478933a08d48f8bbf759e4a9dfa9f61aeeb7
BLAKE2b-256 checksum
How to use checksums
7e5cbd91f60347149888248ddd081626e2ce402130542a1c7601aa903ede2d52
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 19, 2026.

Transparency log

Security for medre-adapter-xmpp 0.2.0

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 medre_adapter_xmpp-0.2.0.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 Nov 19, 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