Skip to main content

MARP Python SDK

Typed, dependency-free, synchronous implementation of Minimal Assistant Room Protocol (MARP) 0.9.0.

Conforms to MARP 0.9 Core, Direct JSON Profile, and Function Calling Profile. Multi-reply profile: first by default (also supports all and nonblocking).

This library is unrelated to the Marp Markdown-presentation ecosystem.

The approved distribution and import name is marp.

pip install marp

The canonical protocol specification is at https://github.com/marprotocol/marp/blob/main/PROTOCOL.md.

from marp import RoomState

room = RoomState()
room.join("u1")
turn = room.accept_direct({"messages": [{"to": ["u1"], "text": "Hello"}], "reply_from": ["u1"]})
room.present_next()
assert room.capture_message("u1", "Hi") == "waiting"
assert room.complete_presentation() == "advanced"

Private delivery is routing metadata only: room operators and model providers processing a room can access delivery contents.

accept_event, join, and leave return "accepted". capture_message automatically adds the active pending reply_to when omitted and returns "advanced", "waiting", or "accepted"; inspect normalized_history() for the server-created event. Present a turn, then call complete_presentation() to make its completion observable. accept_calls() is atomic and returns ordered queued or typed rejected acknowledgements.

For function-calling providers, retain the original provider assistant item and append function_history(assistant_item, acknowledgements); this produces one correlated tool result per call ID and does not duplicate normalized turns in provider history.

Copy-paste examples

Parse

from marp import parse_event

event = parse_event({"event": "message", "user": "u1", "text": "Hello"})

Validate

from marp import parse_turn, validate_turn

turn = validate_turn(parse_turn({"messages": [], "reply_from": []}), ["u1"])

Ordered calls

from marp import RoomState, ToolCall

room = RoomState()
acks = room.accept_calls([ToolCall("c1", {"messages": [], "reply_from": []})])
assert acks[0].turn == 1

Present

from marp import RoomState

room = RoomState()
room.join("u1")
room.accept_direct({"messages": [], "reply_from": []})
assert room.present_next().turn == 1
assert room.complete_presentation() == "advanced"

Capture

from marp import RoomState

room = RoomState()
room.join("u1")
room.accept_direct({"messages": [], "reply_from": ["u1"]})
room.present_next()
assert room.capture_message("u1", "answer") == "waiting"
assert room.complete_presentation() == "advanced"

Replay

from marp import RoomState

room = RoomState()
first = room.accept_direct({"messages": [], "reply_from": []}, response_id="r1")
assert room.accept_direct({"messages": [], "reply_from": []}, response_id="r1") == first

Conformance

# From python/marp:
# python -m pytest tests/test_conformance.py

Metadata

Release files for marp 0.9.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 marp 0.9.0
File Size Uploaded Provenance Actions
marp-0.9.0.tar.gz 11.9 kB With provenance Details for marp-0.9.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for marp 0.9.0
File Interpreter ABI Platform Actions
marp-0.9.0-py3-none-any.whl Python 3 none any Details for marp-0.9.0-py3-none-any.whl

Total release size: 28.5 kB

Release files / marp-0.9.0.tar.gz

Download URL marp-0.9.0.tar.gz
Size 11.9 kB
Tags Source
SHA-256 checksum
How to use checksums
408db80ab382d5bf125220dd7dffcba05e324d0967f4e1028583b54f238b9fbf
BLAKE2b-256 checksum
How to use checksums
6223deb887e485970a407d6cbcd323bd3e8a9937eb4b495bcf5e3882086da666
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 Aug 5, 2026.

Transparency log

Release files / marp-0.9.0-py3-none-any.whl

Download URL marp-0.9.0-py3-none-any.whl
Size 16.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b430985d9ecd71c47aa0bbfee29cf8af4f77b10026cc8bf2470d5166fb6b0ad9
BLAKE2b-256 checksum
How to use checksums
94844e4a90525b4259d8b0c1d88303ffd0318ca279b8c4d08a1d55625f0a0e7b
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 Aug 5, 2026.

Transparency log

Security for marp 0.9.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

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for marp-0.9.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 Aug 5, 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.

Release history Release notifications | RSS feed

This release

0.9.0 This release

2 release files Full provenance

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