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
+67-2Lines changed: 67 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -96,7 +96,72 @@ 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 and may receive the requested `URL`.
100
+
101
+
## Registering resource templates
102
+
103
+
Templates describe resources whose URI contains variables. Devframe uses the MCP SDK's URI-template parser and passes the parsed variables to `read`.
`notifyUpdated()` sends no content. MCP 2026 callers receive the invalidation through `subscriptions/listen` when its `resourceSubscriptions` filter contains the URI, then call `resources/read` for the current value. Legacy MCP callers use `resources/list`, `resources/templates/list`, and `resources/read` to pull current values.
143
+
144
+
## Deriving resources from other state
145
+
146
+
Resource providers are queried when Devframe lists, resolves, or reads resources. Use them when another registry already owns the definitions.
resources.notifyUpdated('dataset://builds/active') // resources/updated through MCP 2026 subscriptions/listen
160
+
```
161
+
162
+
Direct registrations win over providers. Earlier providers win over later providers, and exact resource URIs win over templates.
163
+
164
+
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
165
101
166
## Starting the MCP server
102
167
@@ -135,7 +200,7 @@ In `claude_desktop_config.json`:
135
200
}
136
201
```
137
202
138
-
Restart; tools appear in the drawer, resources as`devframe://resource/<id>`/ `devframe://state/<key>`URIs.
203
+
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.
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 provider handle `notifyUpdated`| concrete URI |
0 commit comments