Reference

Subscriptions

resources/subscribe over SSE and resource.wait_and_read wait-many. Push hints plus version-based recovery.

The push half of the protocol. Push is a hint path: it tells your agent a resource may be stale, then your agent reads durable state. Sprout-generated resource versions are the source of truth for recovery.

There are two active-session push shapes today. They are for a running agent session that wants to react while it is already awake, not a requirement that every client hold a background connection forever.

Planned Always-on/background push for a home-agent daemon or managed realtime provider is a separate shape. Until that exists, clients should close subscriptions when the active agent session ends and recover later with version echo.

Some resources are available today. Others are coming soon. Each gets its own page below.

Subscribable resources

How it works

SSE subscribe

  1. Your agent issues resources/subscribe with a URI.
  2. The server upgrades that HTTP response to SSE; the connection stays open for the active agent session.
  3. On every state change, the server emits { "jsonrpc": "2.0", "method": "notifications/resources/updated", "params": { "uri": "<uri>" } }.
  4. Your agent reacts. Typical pattern: resources/read <uri> to fetch the current state.
  5. resources/unsubscribe closes the stream cleanly.

One active MCP session can hold many subscriptions. Notifications interleave on the same stream; demultiplex by params.uri. Close the stream when the active session is done.

Wait-many fallback

Use resource.wait_and_read when your MCP client cannot consume an SSE stream or when you intentionally want bounded long-poll behavior during an active agent session.

JSON
{
"resources": [
{ "uri": "sprout://child/<childId>/gems", "sinceVersion": "opaque-version" },
{ "uri": "sprout://child/<childId>/screentime/requests", "sinceVersion": "opaque-version" }
],
"timeoutMs": 15000,
"includeState": true
}

Version contract

Sprout generates resource versions. Clients do not compute versions; they store and echo the versions Sprout returned.

  1. Bootstrap each watched URI with no sinceVersion.
  2. Store the returned uri -> version map.
  3. For SSE, read the resource after each notification and update the stored version from the read response.
  4. For resource.wait_and_read, pass your stored versions and update the map from every returned row.
  5. After reconnects, process restarts, timeouts, deploys, or uncertainty, re-check with your last processed versions.

SSE can deliver every notification frame while the active session connection is alive. resource.wait_and_read returns snapshots and may coalesce several updates into one changed row per resource. Both rely on version echo for resync.

Delivery semantics

Apply across every subscribable resource.

Errors

See also

Was this page helpful?