MAGPIE
Message Abstraction & General-Purpose Integration Engine
MAGPIE is a transport-agnostic messaging and RPC framework for developers and AI agents.
Whether the wire is ZeroMQ, MQTT, WebRTC, or something entirely custom, the application layer never changes. Services built with MAGPIE are natively consumable by both code and AI tools via built-in MCP support — making it a natural integration engine for distributed systems, edge devices, and the next generation of AI-driven pipelines.
Table of Contents
Features
- One API, any transport —
StreamWriter,StreamReader,RpcRequester,RpcResponderwork identically over ZMQ, MQTT, and WebRTC; swap transports with one constructor change - Topic-based streaming — high-throughput pub/sub via typed frames; publishers and subscribers are completely decoupled
- Request / Response RPC — synchronous request/reply with ACK, timeout, and per-call demux over any transport
- Schema-based RPC — JSON-RPC 2.0 dispatch via
JsonRpcSchema; define your API once, call methods by name with the proxy interface (client.add(a=3, b=4)) - MCP support out of the box —
McpSchematurns any MAGPIE RPC responder into a fully compliant MCP tool server (initialize,tools/list,tools/call);McpTransportlets any FastMCPClientcall those tools over ZMQ, MQTT, or WebRTC - MQTT transport — full streaming and RPC over MQTT; shared connection; supports
mqtt://,mqtts://,ws://,wss://, TLS, auth, LWT, and auto-reconnect - WebRTC transport — P2P streaming, video/audio, and RPC over WebRTC; MQTT, ZMQ, or HTTP used for signaling; STUN + optional TURN for NAT traversal
- Typed frames —
ImageFrameJpeg,ImageFrameCV,AudioFrameRaw,AudioFrameFlac, and more; automatic serialization/deserialization across all transports - Node helpers —
SourceNode,SinkNode,ProcessNode,ServerNodeadd lifecycle and thread management on top of the raw transport primitives - Network discovery — mDNS/Zeroconf node advertisement and scanning via
ZconfDiscovery - Rich CLI toolset — streaming read/write, RPC request, video/audio capture and playback, SSH tunneling, and network discovery; available across ZMQ, MQTT, and WebRTC transports
- Lightweight core — ZeroMQ is the only core dependency; all media and protocol extras are opt-in
Installation
Core (ZMQ streaming + RPC)
pip install luxai-magpie
Optional extras
| Extra | What it adds |
|---|---|
pip install "luxai-magpie[mqtt]" |
MQTT transport + MQTT CLI tools |
pip install "luxai-magpie[webrtc]" |
WebRTC transport with ZMQ and HTTP signaling; add [mqtt] for MQTT signaling |
pip install "luxai-magpie[webrtc-http]" |
Compatibility alias for the WebRTC extra |
pip install "luxai-magpie[mcp]" |
MCP adapter — McpTransport for FastMCP Client |
pip install "luxai-magpie[audio]" |
Audio frames + capture/player CLI tools |
pip install "luxai-magpie[video]" |
Image frames + capture/viewer CLI tools |
pip install "luxai-magpie[discovery]" |
magpie-discovery CLI tool |
pip install "luxai-magpie[full]" |
All optional extras except MCP |
Quick Start
ZMQ Streaming
Writer:
import time
from luxai.magpie.transport import ZmqStreamWriter
writer = ZmqStreamWriter("tcp://*:5555")
i = 0
while True:
try:
writer.write({'id': i, 'value': 'hello'}, topic='/mytopic')
i += 1
time.sleep(1)
except KeyboardInterrupt:
writer.close()
break
Reader:
from luxai.magpie.transport import ZmqStreamReader
reader = ZmqStreamReader("tcp://127.0.0.1:5555", topic=['/mytopic'], bind=False)
while True:
try:
data, topic = reader.read()
print(f"{topic}: {data}")
except KeyboardInterrupt:
reader.close()
break
ZMQ Request / Response RPC
Responder:
from luxai.magpie.transport import ZMQRpcResponder
def handle(request):
return {'status': 'ok', 'echo': request}
server = ZMQRpcResponder("tcp://*:5556")
while True:
try:
server.respond(handler=handle, timeout=1.0)
except TimeoutError:
pass
except KeyboardInterrupt:
server.close()
break
respond() processes one request and returns False on timeout. The previous handle_once() name remains available for existing code.
Requester:
from luxai.magpie.transport import ZMQRpcRequester
client = ZMQRpcRequester("tcp://127.0.0.1:5556")
try:
response = client.call({'action': 'greet', 'name': 'Bob'}, timeout=3.0)
print("Response:", response)
except TimeoutError:
print("Request timed out")
finally:
client.close()
MQTT Streaming
MQTT uses a shared connection — create it once, pass it to any number of writers, readers, and RPC components.
Writer:
from luxai.magpie.transport import MqttConnection, MqttStreamWriter
conn = MqttConnection("mqtt://mqtt.example.com:1883")
conn.connect()
writer = MqttStreamWriter(conn)
writer.write({"sensor": "temp", "value": 22.5}, topic="sensors/temperature")
writer.close()
conn.disconnect()
Reader:
from luxai.magpie.transport import MqttConnection, MqttStreamReader
conn = MqttConnection("mqtt://mqtt.example.com:1883")
conn.connect()
reader = MqttStreamReader(conn, topic="sensors/temperature")
while True:
try:
data, topic = reader.read(timeout=5.0)
print(f"{topic}: {data}")
except KeyboardInterrupt:
reader.close()
break
conn.disconnect()
MQTT Request / Response RPC
Responder:
from luxai.magpie.transport import MqttConnection, MqttRpcResponder
conn = MqttConnection("mqtt://mqtt.example.com:1883")
conn.connect()
def handle(request):
return {"status": "ok", "echo": request}
server = MqttRpcResponder(conn, service_name="myservice/actions")
while True:
try:
server.respond(handler=handle, timeout=1.0)
except TimeoutError:
pass
except KeyboardInterrupt:
server.close()
break
conn.disconnect()
Requester:
from luxai.magpie.transport import MqttConnection, MqttRpcRequester
conn = MqttConnection("mqtt://mqtt.example.com:1883")
conn.connect()
client = MqttRpcRequester(conn, service_name="myservice/actions")
try:
response = client.call({"action": "move", "x": 1.0}, timeout=5.0)
print("Response:", response)
except TimeoutError:
print("Request timed out")
finally:
client.close()
conn.disconnect()
MQTT Advanced Options
from luxai.magpie.transport import (
MqttConnection, MqttOptions,
MqttAuthOptions, MqttTlsOptions, MqttWillOptions, MqttDefaultsOptions,
)
conn = MqttConnection(
"wss://broker.example.com:8884/mqtt",
client_id="node-01",
options=MqttOptions(
auth=MqttAuthOptions(mode="username_password", username="node", password="secret"),
tls=MqttTlsOptions(ca_file="/etc/ssl/certs/ca.pem", verify_peer=True),
will=MqttWillOptions(enabled=True, topic="nodes/node-01/status",
payload="offline", qos=1, retain=True),
defaults=MqttDefaultsOptions(publish_qos=1, subscribe_qos=1),
),
)
conn.connect()
WebRTC Streaming
WebRTC enables P2P communication over the internet — no broker in the data path after the initial signaling handshake. Signaling is exchanged via MQTT, ZMQ, or an HTTP relay.
One WebRTCConnection manages a separate WebRTC link to each remote peer. connect() returns when the first link is ready; later peers can join, and peer_ids lists the connected remotes. A stream writer publishes to all connected peers, while RPC ACKs and replies return to the requester. For a service with several clients, set role="host" on the service and role="client" on each client so clients do not connect to one another. The default role="mesh" connects all participants.
Video and audio frames are carried over native WebRTC RTP media tracks when topics are declared in WebRTCOptions; all other data flows over the data channel.
Writer (MQTT signaling):
from luxai.magpie.transport.webrtc import WebRTCConnection, WebRtcStreamWriter, WebRTCOptions
conn = WebRTCConnection.with_mqtt(
"mqtt://mqtt.example.com:1883", session_id="my-node",
role="host",
options=WebRTCOptions(video_topics=["/camera/color/image"]),
)
conn.connect()
writer = WebRtcStreamWriter(conn)
writer.write({"telemetry": [0.1, 0.2, 0.3]}, topic="service/state") # → data channel
writer.write(ImageFrameRaw(...), topic="/camera/color/image") # → RTP video track
writer.close()
conn.disconnect()
Reader:
from luxai.magpie.transport.webrtc import WebRTCConnection, WebRtcStreamReader, WebRTCOptions
conn = WebRTCConnection.with_mqtt(
"mqtt://mqtt.example.com:1883", session_id="my-node",
role="client",
options=WebRTCOptions(video_topics=["/camera/color/image"]),
)
conn.connect()
reader = WebRtcStreamReader(conn, topic="service/state")
vreader = WebRtcStreamReader(conn, topic="/camera/color/image")
data, _ = reader.read(timeout=5.0)
frame, _ = vreader.read(timeout=5.0) # ImageFrameRaw
reader.close()
vreader.close()
conn.disconnect()
LAN / localhost: replace
with_mqtt(...)withwith_zmq("tcp://127.0.0.1:5555", ..., bind=True/False)— no broker needed. For multiple clients, passmultiplex=Trueon every peer; the bound signaler then relays between connecting peers. The default ZMQ PAIR mode remains for existing two-peer setups.
WebRTC Request / Response RPC
No broker in the hot path — the data channel is bidirectional P2P, so no reply_to topic is needed.
Responder:
from luxai.magpie.transport.webrtc import WebRTCConnection, WebRTCRpcResponder
conn = WebRTCConnection.with_mqtt("mqtt://mqtt.example.com:1883", session_id="my-node-rpc", role="host")
conn.connect()
def handle(request):
return {"status": "ok", "echo": request}
server = WebRTCRpcResponder(conn, service_name="service/actions")
while True:
try:
server.respond(handler=handle, timeout=1.0)
except TimeoutError:
pass
except KeyboardInterrupt:
server.close()
break
conn.disconnect()
Requester:
from luxai.magpie.transport.webrtc import WebRTCConnection, WebRTCRpcRequester
conn = WebRTCConnection.with_mqtt("mqtt://mqtt.example.com:1883", session_id="my-node-rpc", role="client")
conn.connect()
client = WebRTCRpcRequester(conn, service_name="service/actions")
try:
response = client.call({"action": "move", "x": 1.0}, timeout=5.0)
print("Response:", response)
except TimeoutError:
print("Request timed out")
finally:
client.close()
conn.disconnect()
WebRTC Advanced Options
from luxai.magpie.transport.webrtc import WebRTCConnection, WebRTCOptions, WebRTCTurnServer
opts = WebRTCOptions(
stun_servers=["stun:stun.l.google.com:19302"],
turn_servers=[WebRTCTurnServer(url="turn:myturn.server:3478", username="u", credential="p")],
ice_transport_policy="all", # "all" or "relay" (force TURN only)
video_codec="H264", # "H264", "VP8", "VP9"
video_bitrate=2000, # kbps
video_topics=["/camera/color/image"],
audio_topics=["/mic/audio/stream"],
use_media_channels=True,
)
conn = WebRTCConnection.with_mqtt("mqtt://mqtt.example.com:1883", "my-node", options=opts)
conn.connect()
Auto-reconnect:
conn = WebRTCConnection.with_mqtt("mqtt://mqtt.example.com:1883",
session_id="my-node", reconnect=True)
WebRTC HTTP Signaling
HTTP signaling carries hello, SDP, and ICE messages for every peer in a session. With the Python example relay, each peer sends its initial hello in its registration PUT; the relay caches it for later peers and delivers existing peers' hellos to the newcomer. Peers long-poll for new messages and to keep their registration alive, with no repeated hello POSTs while waiting or connected. The relay forwards opaque bytes and does not import MAGPIE or parse SDP. Media, streams, and RPC still flow over pairwise WebRTC links after negotiation. Older relays without cached joins still work through periodic hello POSTs.
The server example needs FastAPI and Uvicorn, but does not need MAGPIE. Run it from the repository root:
pip install fastapi uvicorn
python examples/webrtc/http_signaling_server.py
The demo server accepts browser requests from localhost and 127.0.0.1 on any port. For a browser page hosted elsewhere, set MAGPIE_SIGNAL_ALLOWED_ORIGINS to its origin (or a comma-separated list of origins) before starting the server. Serve browser pages over HTTP or HTTPS; opening an HTML file directly has a different origin.
Install the WebRTC extra, which includes the HTTP client. In both examples/webrtc/webrtc_reader.py and examples/webrtc/webrtc_writer.py, comment out the active with_zmq(...) block and uncomment the with_http(...) block. Then run the peers in separate terminals:
pip install "luxai-magpie[webrtc]"
python examples/webrtc/webrtc_reader.py
python examples/webrtc/webrtc_writer.py
The audio, video, and multimedia WebRTC examples also include commented HTTP signaling options. Set the same signal URL and session ID on both peers. The example stun_servers=[] setting is for local peers; configure STUN or TURN as needed across networks.
The example relay accepts multiple participants per session. Use the same session ID and choose role="host" for a service and role="client" for its viewers or callers.
The WebRTC command-line tools expose the same topology with --role host or --role client. For multi-peer ZMQ signaling, pass --zmq-multiplex on the bound peer and every connecting peer.
For an authenticated application server, pass fixed headers and a provider for refreshed credentials. The provider runs before every HTTP request. An optional http_client can supply custom HTTP behavior; MAGPIE borrows it, so the caller closes it.
from luxai.magpie.transport.webrtc import WebRTCConnection, WebRTCOptions
conn = WebRTCConnection.with_http(
"https://example.com/webrtc/signal",
session_id="robot-session-42",
headers={"X-Tenant": "my-team"},
headers_provider=lambda: {"Authorization": f"Bearer {get_current_token()}"},
options=WebRTCOptions(video_topics=["/camera/color/image"]),
role="host",
reconnect=True,
)
conn.connect(timeout=30)
The server helper and wire contract can be copied into an existing ASGI or WSGI application without installing MAGPIE on the server. The included in-memory mailbox is for one process; a scaled deployment needs shared storage and the application's own authentication. For a complete public-demo setup, see the Azure HTTP signaling and Coturn reference deployment.
Schema-based RPC
JsonRpcSchema adds JSON-RPC 2.0 dispatch on top of any MAGPIE transport. Define your API once — shape, description, and types — then attach handlers and call methods by name. The same schema object works on both sides.
Responder — three ways to define methods:
from luxai.magpie.transport import ZMQRpcResponder
from luxai.magpie.schema import JsonRpcSchema
schema = JsonRpcSchema()
# Way A: decorator — shape and handler together (infers schema from type hints)
@schema.method()
def add(a: float, b: float) -> float:
"""Add two numbers."""
return a + b
# Way B: load from a standard JSON Schema file, attach handlers separately
schema2 = JsonRpcSchema.from_json_file("api.json")
@schema2.handler("convert")
def handle_convert(value, from_unit, to_unit):
return {"result": value, "unit": to_unit}
# Way C: explicit register — full control over schema
schema.register(
name="scale",
func=lambda value, factor: value * factor,
description="Scale a value",
input_schema={
"type": "object",
"properties": {
"value": {"type": "number"},
"factor": {"type": "number"},
},
"required": ["value", "factor"],
},
)
server = ZMQRpcResponder("tcp://*:5556", schema=schema)
while True:
try:
server.respond(timeout=1.0)
except TimeoutError:
pass
except KeyboardInterrupt:
server.close()
break
The JSON file (api.json) uses standard MCP/JSON Schema format. description and outputSchema are optional; inputSchema defaults to {} if omitted. outputSchema must describe an object ("type": "object") — scalar return types are expressed only in content[0].text, not as structured output.
[
{
"name": "convert",
"description": "Convert a value from one unit to another",
"inputSchema": {
"type": "object",
"properties": {
"value": {"type": "number"},
"from_unit": {"type": "string"},
"to_unit": {"type": "string"}
},
"required": ["value", "from_unit", "to_unit"]
}
},
{
"name": "get_status",
"description": "Return the current service status",
"inputSchema": {
"type": "object",
"properties": {
"service": {"type": "string"}
},
"required": ["service"]
},
"outputSchema": {
"type": "object",
"properties": {
"status": {"type": "string"},
"uptime": {"type": "number"}
}
}
}
]
Requester — proxy interface:
from luxai.magpie.transport import ZMQRpcRequester
from luxai.magpie.schema import JsonRpcSchema, JsonRpcError
# Define shape on the requester side (stub bodies are fine)
schema = JsonRpcSchema()
@schema.method()
def add(a: float, b: float) -> float: ...
client = ZMQRpcRequester("tcp://127.0.0.1:5556", schema=schema)
# Proxy style — method name as attribute
result = client.add(a=3, b=4) # → 7
# Base call style
result = client.call("add", a=3, b=4) # → 7
# With explicit transport timeout
result = client.call("add", a=3, b=4, _timeout=5.0)
try:
client.call("nonexistent")
except JsonRpcError as e:
print(e.code, e.message) # -32601 Method not found
client.close()
MCP Integration
MAGPIE has native MCP support on both sides of the connection — no separate MCP server process required.
Server side — McpSchema extends JsonRpcSchema with the full MCP handshake. Any registered method is automatically exposed as an MCP tool.
Agent / cloud side — McpTransport is a FastMCP ClientTransport that wraps any MAGPIE RpcRequester. The caller creates and owns the requester; McpTransport borrows it.
The key value proposition: a service behind NAT connects outbound to a broker; an LLM agent on the cloud connects to the same broker. No port forwarding, no VPN.
pip install "luxai-magpie[mcp]" # MCP + FastMCP (ZMQ always available)
pip install "luxai-magpie[mqtt,mcp]" # add MQTT transport
pip install "luxai-magpie[webrtc,mcp]" # add WebRTC transport
Server side — serve tools over any transport
from luxai.magpie.schema import McpSchema
schema = McpSchema(name="my-service", version="1.0.0")
@schema.method()
def translate(text: str, target_lang: str) -> dict:
"""Translate text into the target language."""
return {"translated": f"[{target_lang}] {text}", "lang": target_lang}
@schema.method()
def summarize(text: str, max_length: int) -> dict:
"""Summarize text to at most max_length characters."""
return {"summary": text[:max_length]}
Attach to any responder:
# ZMQ — no broker needed
from luxai.magpie.transport import ZMQRpcResponder
server = ZMQRpcResponder("tcp://*:5556", schema=schema)
# MQTT — service behind NAT
from luxai.magpie.transport.mqtt import MqttConnection
from luxai.magpie.transport import MqttRpcResponder
conn = MqttConnection("mqtt://mqtt.example.com:1883")
conn.connect()
server = MqttRpcResponder(conn, service_name="node-01", schema=schema)
# WebRTC — P2P, lowest latency
from luxai.magpie.transport.webrtc import WebRTCConnection, WebRTCRpcResponder
conn = WebRTCConnection.with_mqtt("mqtt://mqtt.example.com:1883", session_id="node-01")
conn.connect()
server = WebRTCRpcResponder(conn, service_name="node-01", schema=schema)
Serve loop is the same for all:
while True:
try:
server.respond(timeout=1.0)
except TimeoutError:
pass
except KeyboardInterrupt:
server.close()
break
Agent / cloud side — call tools with FastMCP Client
import asyncio
from fastmcp import Client
from fastmcp.exceptions import ToolError
from luxai.magpie.adapters.mcp import McpTransport
# ZMQ
from luxai.magpie.transport import ZMQRpcRequester
async def main():
req = ZMQRpcRequester("tcp://127.0.0.1:5556")
async with Client(McpTransport(req)) as client:
tools = await client.list_tools()
for tool in tools:
print(f" {tool.name}: {tool.description}")
result = await client.call_tool("translate", {"text": "Hello", "target_lang": "fr"})
print(result.content[0].text)
try:
await client.call_tool("translate", {"text": "Hello"}) # missing target_lang
except ToolError as e:
print(f"tool error: {e}")
req.close()
asyncio.run(main())
For MQTT or WebRTC, just swap the requester — McpTransport is identical:
# MQTT
from luxai.magpie.transport.mqtt import MqttConnection
from luxai.magpie.transport import MqttRpcRequester
conn = MqttConnection("mqtt://mqtt.example.com:1883")
conn.connect()
req = MqttRpcRequester(conn, service_name="node-01")
async with Client(McpTransport(req)) as client:
result = await client.call_tool("translate", {"text": "Hello", "target_lang": "fr"})
req.close()
conn.disconnect()
Loading tools from an MCP tool-list file
from luxai.magpie.schema import McpSchema
schema = McpSchema.from_json_file("tools.json") # MCP native format
@schema.handler("translate")
def handle_translate(text: str, target_lang: str) -> dict:
return {"translated": f"[{target_lang}] {text}", "lang": target_lang}
Network Discovery
from luxai.magpie.discovery import ZconfDiscovery
# Advertise a node
with ZconfDiscovery() as disc:
disc.advertise_node("my-node", port=5555, payload={"role": "service"})
input("Press Enter to stop advertising...")
# Discover nodes
with ZconfDiscovery() as disc:
info = disc.resolve_node("my-node", timeout=5.0)
if info:
ip = disc.pick_best_ip(info)
print(f"Found at tcp://{ip}:{info.port}")
CLI Tools
ZMQ Tools
pip install luxai-magpie
magpie-write — publish to a topic:
magpie-write tcp://127.0.0.1:5555 /mytopic '{"name": "Bob", "value": 42}'
magpie-write tcp://127.0.0.1:5555 /mytopic '{"x": 1}' --rate 10 --loop
magpie-write tcp://*:5555 /mytopic @payload.json --bind
magpie-read — subscribe and print:
magpie-read tcp://127.0.0.1:5555 /mytopic --pretty
magpie-read tcp://127.0.0.1:5555 /topic1 /topic2
magpie-request — send an RPC request:
magpie-request tcp://127.0.0.1:5556 '{"action": "greet", "name": "Bob"}' --pretty
magpie-request tcp://127.0.0.1:5556 '{"jsonrpc":"2.0","method":"add","params":{"a":3,"b":4},"id":1}' --pretty
magpie-discovery — mDNS node discovery:
magpie-discovery # scan continuously
magpie-discovery --advertise --port 5555 --id MY_NODE # advertise
Audio / Video tools (require [audio] / [video] extras):
magpie-video-capture tcp://*:5555 /camera --encoder jpeg
magpie-video-viewer tcp://127.0.0.1:5555 /camera
magpie-audio-capture tcp://*:5556 /audio --samplerate 16000
magpie-audio-player tcp://127.0.0.1:5556 /audio
MQTT Tools
pip install "luxai-magpie[mqtt]"
magpie-write-mqtt:
magpie-write-mqtt mqtt://mqtt.example.com:1883 /magpie/test '{"x": 1}' --rate 5 --loop
magpie-write-mqtt mqtt://mqtt.example.com:1883 /magpie/status '{"state": "ready"}' --retain
magpie-read-mqtt:
magpie-read-mqtt mqtt://mqtt.example.com:1883 /magpie/test --pretty
magpie-read-mqtt mqtt://mqtt.example.com:1883 "/magpie/+" --hz # wildcard + frequency
magpie-request-mqtt:
magpie-request-mqtt mqtt://mqtt.example.com:1883 myservice/actions '{"action": "run"}' --pretty
magpie-request-mqtt mqtt://mqtt.example.com:1883 myservice/actions @req.json --timeout 10
Advanced broker options (auth, TLS, QoS, LWT) can be passed via
--mqtt-params @params.json.
WebRTC Tools
pip install "luxai-magpie[webrtc,mqtt]"
Both peers use the same session_id. Use --signaling mqtt://..., --signaling http://... or https://... for an HTTP relay, or --signaling tcp://... for ZMQ (add --bind on one side). MQTT signaling needs the separate [mqtt] extra.
For an HTTP relay, pass its base URL, including the mounted /signal prefix. All seven WebRTC tools accept fixed authentication headers through --http-headers '{"Authorization":"Bearer TOKEN"}' or --http-headers @headers.json. See HTTP signaling for the relay setup.
magpie-write-webrtc / magpie-read-webrtc:
magpie-write-webrtc my-node /service/state '{"x": 1.0}' --signaling mqtt://mqtt.example.com:1883
magpie-read-webrtc my-node /service/state --signaling mqtt://mqtt.example.com:1883 --pretty
magpie-request-webrtc:
magpie-request-webrtc my-node service/actions '{"action": "run"}' \
--signaling mqtt://mqtt.example.com:1883 --pretty
Video / Audio over WebRTC:
magpie-video-capture-webrtc my-node /camera --signaling mqtt://mqtt.example.com:1883
magpie-video-viewer-webrtc my-node /camera --signaling mqtt://mqtt.example.com:1883
magpie-audio-capture-webrtc my-node /audio --signaling mqtt://mqtt.example.com:1883
magpie-audio-player-webrtc my-node /audio --signaling mqtt://mqtt.example.com:1883
SSH Tools
pip install "luxai-magpie[mqtt]"
SSH over MQTT — tunnel a full SSH session through any MQTT broker. No port forwarding or public IP required; the machine just needs outbound access to the broker.
magpie-ssh-server-mqtt — run on the remote machine:
magpie-ssh-server-mqtt mqtt://mqtt.example.com:1883 my-robot
magpie-ssh-server-mqtt mqtts://mqtt.example.com:8883 my-robot --mqtt-params @/etc/magpie/mqtt.json
magpie-ssh-mqtt — connect from any client:
magpie-ssh-mqtt mqtt://mqtt.example.com:1883 my-robot # interactive shell
magpie-ssh-mqtt mqtt://mqtt.example.com:1883 my-robot ls -l # run a command
magpie-ssh-mqtt mqtt://mqtt.example.com:1883 my-robot -l alice # specify user
For ProxyCommand mode, VS Code Remote SSH, TLS/auth options, cloud brokers (Ably), and more, see SSH over MQTT.
Architecture
MAGPIE is built around four abstract base classes — StreamWriter, StreamReader, RpcRequester, RpcResponder — that absorb all threading, queuing, and lifecycle complexity. Transport implementations fill in two or three pure transport methods; everything else is handled by the base classes. This makes adding a new transport a matter of minutes, not days, and keeps user code completely transport-agnostic.
For the full architecture diagram, layer-by-layer breakdown, schema and MCP adapter design, and guides for adding new transports, serializers, and frame types, see docs/architecture.md.
Related Projects
| Project | Language | Repository |
|---|---|---|
| MAGPIE | Python | this repo |
| MAGPIE C++ | C++ (libmagpie, libmagpie-mqtt) |
luxai-qtrobot/magpie-cpp |
| MAGPIE.js | TypeScript/JavaScript | luxai-qtrobot/magpie-js |
License
Licensed under the GNU General Public License v3 (GPLv3).
Metadata
Release files for luxai-magpie 0.9.7
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| luxai_magpie-0.9.7.tar.gz | 473.0 kB | Without provenance | Details for luxai_magpie-0.9.7.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| luxai_magpie-0.9.7-py3-none-any.whl | Python 3 | none | any | Details for luxai_magpie-0.9.7-py3-none-any.whl |
Total release size: 921.1 kB
Release files / luxai_magpie-0.9.7.tar.gz
| Download URL | luxai_magpie-0.9.7.tar.gz |
|---|---|
| Size | 473.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e5eb5db38d89ddded76568434c31c18b37e82aba0d70d3b4b5121276446acdb5
|
|
BLAKE2b-256 checksum How to use checksums |
9e4ae26b1c7d6e270c38222d9adc777e8ac1df59b622dd23f9601d7446c8dd95
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.3
|
Release files / luxai_magpie-0.9.7-py3-none-any.whl
| Download URL | luxai_magpie-0.9.7-py3-none-any.whl |
|---|---|
| Size | 448.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
342a5b07e4f0c7a2ff4e1e71184a3433d0e818057bdcdb33c03a04b2e3a04032
|
|
BLAKE2b-256 checksum How to use checksums |
452d0bb4aebc2fa77b0e6ace42902dcc8cd392656451468ad3a83c6485da8f60
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.3
|
Security for luxai-magpie 0.9.7
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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
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.