TsgcWSAPIClient_MCP › Properties › MCPOptions
Centralises every runtime option for the MCP client (endpoint URL, TLS, authentication, client identity, heartbeat, transport, protocol era, multi round-trip requests, tasks, authorization).
property MCPOptions: TsgcAI_MCP_Client_Options read FMCPOptions write SetMCPOptions;
—
Aggregates every configuration sub-object the client needs to reach and negotiate with an MCP server. Populate HttpOptions.URL with the target endpoint (for example https://localhost:5001/mcp) and customise HttpOptions.TLSOptions and HttpOptions.LogOptions when required. Use ClientInfo to advertise the application Name, Title and Version during the initialize handshake. Enable HeartBeat to schedule automatic ping calls. Use AuthenticationOptions for API keys or custom HTTP headers, and pick Transport (aimcptrHttp, aimcptrHttpStreamable or aimcptrStdio) to switch between classic JSON-RPC, streamable HTTP/SSE or a local stdio subprocess. When Transport is aimcptrStdio, configure StdioOptions (Command, Arguments, WorkingDir, Environment) with the server executable to launch instead of HttpOptions.URL; the client spawns that process and exchanges JSON-RPC over its standard input/output.
Options of the protocol version 2026-07-28:
aimcpeAuto (default) probes the server with server/discover and falls back to the legacy initialize handshake; aimcpeModern and aimcpeLegacy force one era. See Protocol Versions.MaxRounds (default 10) limits the rounds of a Multi Round-Trip Request; Elicitation, Sampling and Roots (default False) declare the client capabilities when the inputs are answered only from OnMCPInputRequired. See Multi Round-Trip Requests.Enabled (default False) declares the io.modelcontextprotocol/tasks extension; AutoPoll (default True) polls tasks/get in a background thread until the task finishes. See Tasks.Enabled, ClientId, ClientSecret, Issuer, ClientMetadataURL, AllowDynamicRegistration, ClientName, RedirectURL, Timeout and the read only AccessToken configure the automatic OAuth authorization of the MCP specification. Available only when the library is compiled with OAuth2 support (define SGC_OAUTH). See Authorization.MCP.MCPOptions.HttpOptions.URL := 'https://localhost:5001/mcp';
MCP.MCPOptions.ClientInfo.Name := 'DemoClient';
MCP.MCPOptions.ClientInfo.Title := 'Operations assistant';
MCP.MCPOptions.ClientInfo.Version := '1.0.0';
MCP.MCPOptions.HeartBeat.Enabled := True;
MCP.MCPOptions.HeartBeat.Interval := 30;
MCP.MCPOptions.AuthenticationOptions.ApiKey.Enabled := True;
MCP.MCPOptions.AuthenticationOptions.ApiKey.Value := 'super-secret-token';
MCP.MCPOptions.Transport := aimcptrHttpStreamable;
MCP.MCPOptions.Transport := aimcptrStdio;
MCP.MCPOptions.StdioOptions.Command := 'C:\MyServer\MyDelphiServer.exe';
MCP.MCPOptions.StdioOptions.Arguments := '--stdio';
MCP.MCPOptions.ClientInfo.Name := 'DemoClient';
MCP.MCPOptions.ClientInfo.Version := '1.0.0';
MCP.MCPOptions.HttpOptions.URL := 'https://localhost:5001/mcp';
MCP.MCPOptions.ProtocolEra := aimcpeAuto;
MCP.MCPOptions.MRTR.Elicitation := True;
MCP.MCPOptions.MRTR.MaxRounds := 5;
MCP.MCPOptions.Tasks.Enabled := True;
MCP.MCPOptions.Authorization.Enabled := True;
MCP.MCPOptions.Authorization.ClientName := 'DemoClient';