TsgcWSAPIServer_MCPProperties › MCPOptions

MCPOptions Property

Core MCP server settings: ServerInfo, SessionTimeout and authentication policies.

Syntax

property MCPOptions: TsgcAI_MCP_Server_Options read FMCPOptions write SetMCPOptions;

Default Value

Remarks

Aggregates the runtime configuration consumed by the underlying TsgcAI_MCP_Server engine. Use ServerInfo to set the name, version, title, website URL and icons advertised during the MCP handshake, SessionTimeout to control how long an idle session survives before it is deleted (and OnMCPSessionEnd fires), TasksSupported to advertise the tasks capability when your tools declare a TaskSupport hint, and AuthenticationOptions to enforce CustomHeader and/or ApiKey (Authorization: Bearer <value>) validation on every HTTP round-trip. Changes take effect on subsequent requests; existing sessions keep the previously negotiated capabilities.

ServerInfo.Icons expects a raw JSON array of MCP icon descriptors. Per the MCP icon schema, each icon's sizes must be a JSON array of strings (for example ["48x48"]), even for a single size; a bare string is rejected by MCP client SDKs.

When AuthenticationOptions.ApiKey is enabled, the MCP server automatically exposes an OAuth 2.1 authorization flow on the same HTTP server, including /.well-known/oauth-authorization-server (RFC 8414), /.well-known/oauth-protected-resource (RFC 9728), /oauth/register (RFC 7591 dynamic client registration), /oauth/authorize (renders an HTML consent form) and /oauth/token (PKCE S256, authorization-code and refresh-token grants). The value configured in ApiKey.Value is reused as the password the user must enter on the consent form to approve a connector. Once approved, the bearer token issued by /oauth/token is accepted on subsequent /mcp calls in addition to the static ApiKey.Value. OAuth clients, codes and tokens are stored in memory and are lost when the server restarts. See the component overview page for the full list of built-in HTTP endpoints.

Example

MCPServer.MCPOptions.ServerInfo.Name := 'sgc-mcp-server';
MCPServer.MCPOptions.ServerInfo.Version := '1.0.0';
MCPServer.MCPOptions.ServerInfo.Title := 'My MCP Server';
MCPServer.MCPOptions.ServerInfo.WebsiteUrl := 'https://example.com';
MCPServer.MCPOptions.TasksSupported := True;
MCPServer.MCPOptions.SessionTimeout := 60000;
MCPServer.MCPOptions.AuthenticationOptions.ApiKey.Enabled := True;
MCPServer.MCPOptions.AuthenticationOptions.ApiKey.Value := 'super-secret-token';

Back to Properties