AWPGitHub ↗
PROVIDER QUICKSTART

Add the return path to your backend

Expose an authenticated AWP WebSocket beside MCP. The user's client connects outward—you never connect to their laptop.

View canonical source on GitHub ↗

What you are building

REQUEST PATHhttps://your-product.example/mcp
EVENT PATHwss://your-product.example/awp

Your connection service authenticates clients and binds opaque sessions. Your existing application creates, persists, and targets events.

01

Authenticate the socket

Accept WebSocket upgrades over TLS. Credentials belong in the HTTP authorization header, never in a query string.

GET /awp HTTP/1.1
Upgrade: websocket
Authorization: Bearer <provider-token>
02

Handshake and bind

Validate client.hello, return server.welcome, then authorize every session.bind against the authenticated tenant and device.

Runtime identity stays local

An AWP session ID is an opaque routing ID. Never request or store a Codex or Claude runtime session ID.

03

Persist before delivery

Create durable event and delivery records before sending. Offline publication should remain pending and resume after reconnect.

publisher event
  → persist event + delivery
  → resolve active device connection
  → send event.deliver
  → process event.ack

Production checklist

  • Tenant-safe authorization on every lookup and transition.
  • Stable IDs, idempotent publication, and bounded retries.
  • Durable offline queue and dead-letter policy.
  • Heartbeat, reconnect, backpressure, and payload limits.
  • Metrics for pending age, completion latency, and failures.
Open the production backend guide ↗