Device Connect

Open-source framework for connecting devices, robots, and AI agents
arm/device-connect
Sensor Robot Camera Device Connect Claude Agent Strands Agent LangGraph Agent
Devices talk to agents. Zero infrastructure to start. Production security built in.
Executive View
Technical View
AI / Orchestration
AI Agents
Any AI agent can discover and control physical devices through natural language.
Claude
Anthropic
Strands
AWS
LangGraph
LangChain
Native Agent
Plain Python
Agent SDK
Connect any AI agent to the physical device mesh with four core capabilities.
Find devices
See what's connected to the network
discover_devices()
Call device functions
Run any command on any device
invoke_device()
Check device status
Read health, identity, availability
get_device_status()
Listen to events
Subscribe to real-time device data
subscribe()
Works with MCP — Exposes devices as MCP tools so any MCP-compatible client can discover and invoke them.
Messaging Mesh
Pub/Sub Transport
Devices and agents talk over a shared message bus. Pick the backend that fits your deployment.
Default · Core dependency
Start here. Works peer-to-peer on a LAN with zero setup, or add a router to bridge networks.
Optional
Choose when you need per-device identity with JWT/NKey auth, or cloud-native clustering.
Optional
Choose when integrating with existing IoT infrastructure that already speaks MQTT.
Edge / Device
The Python SDK that runs on each physical device. Developers write a driver class and use decorators to expose capabilities to the network.
@rpc
Remote procedure call. Other devices and agents can call this function over the network.
@emit
Broadcast an event to all listeners. Think alerts, status changes, new data.
@periodic
Run automatically on a timer. Poll a sensor every 10 seconds, send a heartbeat.
@on
React to events from other devices. A robot starts moving when a sensor trips.
Sensors
Temp, humidity, pressure
@rpc@emit@periodic
@rpcread on demand
@emitalert on thresholds
@periodicpoll every N seconds
Robots
Arms, AMRs, cleaning
@rpc@emit@on
@rpcremote commands
@emitstatus updates
@onreact to sensor alerts
Cameras
Surveillance, inspection
@rpc@emit
@rpccapture, pan/tilt
@emitmotion detected
Actuators
Valves, motors, locks
@rpc@emit
@rpcopen, close, set
@emitstate changed
Server Services
Add when you outgrow D2D: 50+ devices, multi-network, persistent state, or auth required.
DEVICES S R C Pub/Sub Mesh Registry Catalog of all devices + capabilities Security TLS encryption, JWT identity, ACLs State (etcd) Persistent KV store across reboots DOCKER INFRA :8080 registry :7447 zenoh :4222 nats :2379 etcd CLI TOOLS $ devctl list $ devctl commission $ statectl get $ statectl watch AI Agent
See It In Action
A sensor on a Raspberry Pi and an AI agent talking through Device Connect
On the Device (Raspberry Pi)
# sensor.py — runs on the Pi

class SensorDriver(DeviceDriver):
    device_type = "sensor"

    @rpc()
    async def get_reading(self) -> dict:
        """Return current temperature."""
        return {"temp": 22.5, "humidity": 45}

    @emit()
    async def alert(self, level, message):
        """Broadcast an alert event."""
        pass

    @periodic(interval=10)
    async def poll(self):
        reading = await self.get_reading()
        if reading["temp"] > 30:
            await self.alert("warning", "Hot!")
rpc call
response
event
Your AI Agent
# agent.py — runs anywhere

from device_connect_agent_tools import (
    connect, discover_devices, invoke_device
)

connect()

# Find what's on the network
devices = discover_devices(device_type="sensor")

# Call the @rpc function remotely
result = invoke_device("sensor-001", "get_reading")
# → {"temp": 22.5, "humidity": 45}

# Listen for @emit events
subscribe("*.event.alert", on_alert)

Security Architecture

Device Connect provides encryption in transit, per-device identity, device onboarding (commissioning), and fine-grained access control. Which features you use depends on your messaging backend.
Encryption in Transit
All messages encrypted via TLS so they can't be intercepted on the network.
Need: any deployment beyond a trusted lab network.
Device Identity
Every device gets its own cryptographic identity (certificate or JWT), so the system knows exactly who is connecting.
Need: when you must verify a device is who it claims.
Commissioning
Secure onboarding for new devices. Admin provisions credentials, delivers them via PIN-based handshake.
Need: when shipping devices to remote sites.
Access Control (ACLs)
Per-device rules about what each device can see and do. A camera can't command a robot unless allowed.
Need: multi-tenant or multi-team deployments.
Audit Logging
Full history of every action persisted to MongoDB. Who invoked what, on which device, when.
Need: compliance, post-incident forensics.
Telemetry
OpenTelemetry traces and metrics exported to any OTEL-compatible collector.
Need: monitoring at scale, performance debugging.

Zenoh Path — mTLS

Uses certificate-based identity. Each device gets a client cert signed by your CA. Best when you control the PKI.
1Generate CA + router cert
2Generate a client cert per device
3Router validates certs on connect
4All traffic encrypted TLS 1.3

NATS Path — JWT / NKey

Uses token-based identity. Each device gets a JWT + NKey pair. Better for dynamic fleets where devices come and go.
1Create Operator + Account
2Generate system-role credentials
3Generate per-device JWT
4Commission device via PIN handshake

Messaging Topic Namespace

device-connect.{tenant}.{device_id}.{verb}.{name}

Examples:
device-connect.default.cam-001.rpc.req.get_status
device-connect.default.sensor-003.event.temperature_alert
device-connect.production.robot-007.presence
device-connect.default.*.heartbeat

Verbs: rpc.req · rpc.res · event · presence · heartbeat

Core vs Optional Components

Core (Always Required)

  • device-connect-sdk
  • DeviceRuntime + DeviceDriver
  • @rpc, @emit, @periodic, @on, @before_emit
  • Zenoh adapter (default messaging)
  • D2D multicast discovery
  • JSON-RPC protocol
  • NATS adapter (bundled)

Optional — Add as Needed

  • agent-tools — AI agent integration
  •   [strands] Strands Agents adapter
  •   [langchain] LangChain adapter
  •   [mcp] FastMCP bridge
  • server — Production infrastructure
  •   [security] Commissioning + ACLs
  •   [state] etcd distributed KV
  •   [logging] MongoDB audit
  •   [telemetry] OpenTelemetry
  •   [mqtt] MQTT backend
  • Infra — Docker services
  •   Zenoh Router :7447
  •   NATS Server :4222
  •   etcd :2379 · Registry :8080

D2D vs Full Infrastructure

Device Connect supports two deployment modes. D2D mode uses only device-connect-sdk with Zenoh's built-in peer discovery — no servers, no Docker, no configuration. Full infrastructure adds device-connect-server for a persistent registry, security, distributed state, and CLI management tooling.

D2D Mode (Zero Infra)

pip install device-connect-sdk → run
Choose this when: you're prototyping, running a demo, building on a single LAN, or have a small fleet of devices that don't need centralized management. No Docker or servers required.
Packagedevice-connect-sdk
InfrastructureNone
DiscoveryLAN multicast (Zenoh)
Scale~50–100 devices
StateEphemeral (in-memory)
NetworkSame LAN only
AuthNone

Full Infrastructure

+ device-connect-server → docker compose up
Choose this when: devices are on different networks, you need to remember device state across restarts, you need security (who can control what), or you're running more than ~50 devices in production.
Packagessdk + server
InfrastructureZenoh + etcd + Registry
DiscoveryRegistry service (HTTP)
Scale1000s of devices
StatePersistent (etcd)
NetworkCross-network
AuthmTLS / JWT + ACLs

Source Module Map

device_connect_sdk/
device.py (67K)
discovery.py (11K)
types.py · errors.py
drivers/
  base.py (39K)
  decorators.py (30K)
  transport.py
messaging/
  zenoh_adapter (29K)
  nats_adapter (18K)
  mqtt_adapter (17K)
  base.py · config.py
telemetry/
device_connect_server/
registry/
  service/main.py (15K)
  client.py (11K)
security/
  acl.py (10K)
  commissioning.py (10K)
  credentials.py (9.5K)
state/
  etcd_store.py (13K)
devctl/ · statectl/
logging/ · telemetry/
device_connect_agent_tools/
connection.py (24K)
tools.py (7K)
agent.py (7.5K)
adapters/
  strands.py
  langchain.py
mcp/ (87K total)
  bridge.py (10K)
  device_tools.py (31K)
  device_connect_mcp.py (16K)
  discovery.py · router.py
  schema.py · config.py

Package Dependency Graph

device-connect-sdk v0.1.1 · CORE

eclipse-zenoh ≥1.0.0
nats-py ≥2.5.0
pydantic ≥2.7.1
nkeys ≥0.2.0
pyyaml ≥6.0
opt: [telemetry] → OpenTelemetry SDK + OTLP

device-connect-server v0.1.1

[security] bcrypt, aiohttp, zeroconf, qrcode
[state] etcd3gw
[logging] pymongo
[telemetry] OTEL exporters
[mqtt] aiomqtt
CLIs: devctl · statectl

device-connect-agent-tools v0.1.1

[strands] strands-agents ≥1.0
[langchain] langchain-core ≥0.2
[mcp] fastmcp ≥1.0
MCP bridge: bridge · router · discovery · schema · device_tools