By Admin on Thursday, 16 October 2025
Category: All

Delphi MCP Server Resources (4/4)

In MCP, resources represent addressable data objects that the server exposes such as files, database records, generated documents, or dynamic API outputs.

They are client-controlled, meaning the client can decide which resource to request and how to interpret the content.

The two main methods involved are:

Additionally, if the server sets resources.listChanged = true in its declared capabilities, it may send notifications like notifications/resources/list_changed when the resource catalog updates.

Resources List

The server keeps an in-memory catalogue of resources in TsgcAI_MCP_ResourcesList. Resources are guaranteed to be unique by uri, expose descriptions and provide a JSON Schema like input uri that is emitted in the response to the specification's resources.list method. When a client invokes resources.list, TsgcWSAPIServer_MCP loads the request, serializes the current catalogue and sends it back with a 200 HTTP status code.

Example code that publishes a file resource: 

Resources Request

When a client issues a resource.read JSON-RPC request, TsgcWSAPIServer_MCP hydrates the strongly-typed request object (including uri resource, name and the provided arguments) before raising the OnMCPRequestResource event. Your handler populates the response payload which is then serialized back to the client, alongside a success HTTP status code.

A typical handler looks like this: 

​Learn More

For in-depth documentation and component reference, visit:


sgcWebSockets MCP Prompts Resources Guide 

Find below a Delphi MCP Server Demo for windows: