Attributes User Guide
These guides cover declaring an MCP surface with RTTI attributes and hosting the server that generates it. Start with Getting started if you have not exposed a class yet.
Guides
| Guide | Scope | API starting points |
|---|---|---|
| Declaring tools with attributes | The [TTMSMCPToolAttribute] marker, protocol names and titles, descriptions, the four behaviour hints, icons, return types, output schemas, and task support. |
TTMSMCPToolAttribute, TTMSMCPNameAttribute, TTMSMCPTaskSupportAttribute |
| Parameters and schema | How each parameter becomes an input property, the Delphi-to-schema type mapping, type overrides, optional parameters with defaults, string coercion, and argument errors. | TTMSMCPOptionalAttribute, TTMSMCPStringAttribute, TTMSMCPRttiToolProperty |
| Hosting attributed servers | Registering class and instance targets, ownership, the server factory, when the reflection pass runs, server awareness, and the resource and prompt metadata attributes. | TTMSMCPAttributedServer, TTMSMCPTargets, TTMSMCPServerFactory |
Related components
- Tools is what the attributes generate. Everything a
hand-built
TTMSMCPToolcan express — property types, hints, output schemas, task support — has an attribute counterpart, and the two approaches can be mixed on the same application. - MCP Server is the base of
TTMSMCPAttributedServer, so capabilities, sessions, notifications, and transports work exactly as they do on a hand-built server. - Resources and Prompts also carry attribute markers, which the reflection pass reads to fill in names, URIs, MIME types, and prompt arguments.