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
+42-2Lines changed: 42 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -96,7 +96,47 @@ 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
+
## Registering a resource template
102
+
103
+
RFC 6570 templates describe resources whose URI contains variables. Devframe passes the concrete URI and parsed variables to `read`.
MCP exposes dynamic templates through `resources/templates/list`. Callers read a concrete matching URI through `resources/read`; dynamic entries stay out of `resources/list`.
122
+
123
+
## Publishing resource updates
124
+
125
+
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`, `resources/templates/list`, and `resources/read`.
138
+
139
+
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. Configure the exposed keys with `createMcpServer`'s `exposeSharedState` option.
100
140
101
141
## Starting the MCP server
102
142
@@ -135,7 +175,7 @@ In `claude_desktop_config.json`:
135
175
}
136
176
```
137
177
138
-
Restart; tools appear in the drawer, resources as `devframe://resource/<id>`/ `devframe://state/<key>`URIs.
178
+
Restart; tools appear in the drawer. Resources use their declared URI, an RFC 6570 URI template, the generated `devframe://resource/<id>`URI, or `devframe://state/<key>`for implicit shared state.
Copy file name to clipboardExpand all lines: docs/content/8.references/3.events.md
+2-1Lines changed: 2 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -68,7 +68,8 @@ Emitted on `ctx.agent.events`; adapters (e.g. the MCP server) re-publish their m
68
68
|---|---|---|
69
69
|`agent:manifest:changed`| any tool/resource/provider change | — |
70
70
|`agent:tool:registered` / `agent:tool:unregistered`|`registerTool` / `unregisterTool`|`AgentTool` / id |
71
-
|`agent:resource:registered` / `agent:resource:unregistered`|`registerResource` / `unregisterResource`|`AgentResource` / id |
71
+
|`agent:resource:registered` / `agent:resource:unregistered`|`registerResource` / `unregisterResource`|`AgentResource` or `AgentResourceTemplate` / id |
72
+
|`agent:resource:updated`| resource or template handle `notifyUpdated`| concrete resource URI |
0 commit comments