TsgcWSAPIClient_MCP › Methods › SubscribeResource
Subscribes to change notifications for a specific resource (resources/subscribe).
procedure SubscribeResource(const aUri: string);
| Name | Type | Description |
|---|---|---|
aUri | const string | URI of the resource to watch. Must match one of the URIs advertised by the server in its resources/list catalogue. |
Sends the JSON-RPC resources/subscribe request. When the server detects that the resource has changed it dispatches a notifications/resources/updated notification which the component surfaces through the OnMCPResourcesUpdated handler. Call RequestResource inside the notification to pull the fresh payload. The server must advertise the resources.subscribe capability during initialize; otherwise the request fails with a JSON-RPC error.
MCP.SubscribeResource('file:///project/config.yaml');