You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Notify subscribed MCP clients after the content changes.
98
-
sessionResource.notifyUpdated()
99
95
```
100
96
101
-
Without `uri`, Devframe assigns `devframe://resource/<encoded-id>`. `read` runs for every MCP read and receives the requested URI. A zero-argument reader remains valid.
97
+
Devframe assigns `devframe://resource/<encoded-id>` by default. Set `uri` to expose another URI. `read` runs for every MCP read and may receive the requested `URL`.
MCP exposes templates through `resources/templates/list`. When `list` is present, its concrete entries also appear in `resources/list`.
129
125
130
-
## Resource subscriptions
126
+
## Updating a subscribed resource
131
127
132
128
`subscribe` and `unsubscribe` follow the MCP resource lifecycle. Devframe calls them once per URI and MCP connection, and releases active subscriptions when the connection, registration, or provider goes away.
The callbacks manage the producer listener. They do not send content. Call the registration handle's `notifyUpdated()`method after a change; subscribed clients receive `resources/updated` and can read the current value.
140
+
The producer owns its listener and any reference counting across MCP connections. `notifyUpdated()`sends no content. It tells subscribed clients to read the current value.
resources.notifyUpdated('dataset://builds/active') // resources/updated for subscribers
162
158
```
163
159
164
-
Direct registrations win over providers. Earlier providers win over later providers, and exact fixed URIs win over templates.
160
+
Direct registrations win over providers. Earlier providers win over later providers, and exact resource URIs win over templates.
165
161
166
162
Every `ctx.rpc.sharedState` key is exposed as a `devframe://state/<key>` resource and via the **`devframe:state:read` tool** (wire `devframe_state_read`): no args → key list, `key` → its value. `exposeSharedState: false` (or a filter) on `createMcpServer` opts out.
0 commit comments