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
Copy file name to clipboardExpand all lines: docs/content/1.guide/15.agent-native.md
+20-2Lines changed: 20 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -96,7 +96,25 @@ ctx.agent.registerResource({
96
96
})
97
97
```
98
98
99
-
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.
99
+
Devframe assigns `devframe://resource/<encoded-id>` by default. Set `uri` to expose another URI. `read` runs for every MCP read.
100
+
101
+
## Publishing resource updates
102
+
103
+
Resource handles publish invalidations after their underlying value changes:
`notifyUpdated()` sends the resource URI as an invalidation. MCP 2026 callers receive it through `subscriptions/listen` when their `resourceSubscriptions` filter contains that URI, then call `resources/read` for the current value. MCP 2025 callers pull current values through `resources/list` and `resources/read`.
116
+
117
+
Every `ctx.rpc.sharedState` key is exposed as a `devframe://state/<encoded-key>` resource and via the **`devframe:state:read` tool** (wire `devframe_state_read`): no args → key list, `key` → its value. MCP 2026 subscriptions receive shared-state invalidations under the same encoded URI. `exposeSharedState: false` (or a filter) on `createMcpServer` opts out.
100
118
101
119
## Starting the MCP server
102
120
@@ -135,7 +153,7 @@ In `claude_desktop_config.json`:
135
153
}
136
154
```
137
155
138
-
Restart; tools appear in the drawer, resources as`devframe://resource/<id>`/ `devframe://state/<key>`URIs.
156
+
Restart; tools appear in the drawer. Resources use their declared URI, the generated`devframe://resource/<id>`URI, or `devframe://state/<key>`for implicit shared state.
0 commit comments