Table of Contents

Resources

A resource is readable content an MCP server publishes at a URI. Where a tool does something and a prompt asks something, a resource simply is something a client can list and fetch: a settings document, a customer record, a log, the file currently open in the editor. TTMSMCPResource covers the whole surface: direct resources at a fixed URI, template resources that cover a whole family of URIs, text and base64 binary content, per-instance MIME types, display titles and icons, runtime listing, list-changed notifications, and per-URI subscriptions that tell a client its copy is stale.

Documentation

Start here Use when
Getting started You want a readable resource on a server quickly.
User guide You want task-oriented chapters grouped by feature area.
API reference You want exact class, property, method, and event contracts.
Release notes You want the version history for this component.

Key classes

Class Role
TTMSMCPResource A single resource: name, URI or URI template, MIME type, title, icons, and the reader that produces its content.
TTMSMCPResources The collection of resources owned by a server. Register, add, and look up resources here.
TTMSMCPResourceContent What a reader returns: a URI, a MIME type, and either text or a base64 blob.
TTMSMCPResourceBuilder Fluent builder for declaring a resource in a single expression.

Minimal example

procedure TForm1.RegisterSettingsResource;
begin
  { Server is a TTMSMCPServer dropped on the form. }
  Server.Resources.RegisterDirectResource(
    'app_settings',
    'config://application/settings',
    'Current application settings',
    'application/json',
    function(const URI: string): TTMSMCPResourceContent
    begin
      { Create a fresh content object per read. The framework serializes
        it and frees it - do not free it here and do not cache it. }
      Result := TTMSMCPResourceContent.FromText(URI, 'application/json',
        SettingsAsJSON);
    end);
end;

API map

Role Types
Resource and collection TTMSMCPResource, TTMSMCPResources
Content TTMSMCPResourceContent
Fluent construction TTMSMCPResourceBuilder
Reader callbacks TTMSMCPResourceMethod, TTMSMCPResourceMethodEvent
Server integration TTMSMCPResourceListEvent
Shared base TTMSMCPBase

Guides

Guide Covers
Declaring resources Direct resources, URI templates and how they are matched, the fluent builder, titles and icons, and runtime listing.
Resource content and updates Text and binary content, MIME types, reader ownership, error reporting, subscriptions, and change notifications.

See Also