TsgcWSAPIClient_MCP › Properties › MCPOptions
Centralises every runtime option for the MCP client (endpoint URL, TLS, authentication, client identity, heartbeat, transport).
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.
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';