eSeGeCe
software
The 2025.10.0 release of sgcWebSockets elevates Model Context Protocol (MCP) connectivity with a hardened authentication layer for both client and server components. This article highlights how the new capabilities combine enterprise-grade access control with the rapid development workflow Delphi teams expect from sgcWebSockets.
What is new
The MCP client exposes all security knobs through the MCPOptions.AuthenticationOptions property. Enable API key or custom header flows independently to satisfy zero-trust or tenant-based policies, and the component injects the required headers during each HTTP POST and SSE upgrade.
X-Tenant or X-Region).Authorization: Bearer header, ensuring compatibility with gateways and API management layers.aimcptrHttpStreamable, the client spins up an SSE thread that preserves the same authenticated headers.Together with heartbeats, client metadata, and HTTP/TLS customization, you can align MCP conversations with your organization's compliance checklist without sacrificing developer velocity.
The server mirrors the client controls with dedicated endpoint, transport, and MCP configuration objects. As requests arrive, the component validates every incoming header and raises a descriptive error when a credential is missing or incorrect. Because validation happens before the request enters your business logic, you stop misuse early and keep your code focused on domain value.
Authorization header used by the client.The following snippet shows how a single configuration routine can enable MCP Authentication for both a client and a server in Delphi. Adapt the credential values to your environment.
procedure SetupMCPInfrastructure;
var
MCPClient: TsgcWSAPIClient_MCP;
MCPServer: TsgcWSServer_API_MCP;
begin
MCPClient := TsgcWSAPIClient_MCP.Create(nil);
MCPServer := TsgcWSServer_API_MCP.Create(nil);
try
// Client configuration
MCPClient.MCPOptions.HttpOptions.URL := 'https://mcp.example.com/api';
MCPClient.MCPOptions.AuthenticationOptions.ApiKey.Enabled := True;
MCPClient.MCPOptions.AuthenticationOptions.ApiKey.Value := 'YOUR_API_KEY';
MCPClient.MCPOptions.AuthenticationOptions.CustomHeader.Enabled := True;
MCPClient.MCPOptions.AuthenticationOptions.CustomHeader.Header := 'X-Tenant';
MCPClient.MCPOptions.AuthenticationOptions.CustomHeader.Value := 'Retail';
MCPClient.MCPOptions.ClientInfo.Name := 'RetailAgent';
MCPClient.MCPOptions.ClientInfo.Version := '2025.10.0';
MCPClient.MCPOptions.HeartBeat.Enabled := True;
MCPClient.MCPOptions.HeartBeat.Interval := 30;
MCPClient.OnMCPInitialize := HandleMCPInitialize;
MCPClient.OnMCPListTools := HandleMCPTools;
MCPClient.Initialize;
MCPClient.ListTools;
// Server configuration
MCPServer.EndpointOptions.Endpoint := '/mcp';
MCPServer.MCPOptions.AuthenticationOptions.ApiKey.Enabled := True;
MCPServer.MCPOptions.AuthenticationOptions.ApiKey.Value := 'YOUR_API_KEY';
MCPServer.MCPOptions.AuthenticationOptions.CustomHeader.Enabled := True;
MCPServer.MCPOptions.AuthenticationOptions.CustomHeader.Header := 'X-Tenant';
MCPServer.MCPOptions.AuthenticationOptions.CustomHeader.Value := 'Retail';
MCPServer.OnMCPInitialize := HandleServerInitialize;
MCPServer.OnMCPRequestTool := HandleToolRequest;
MCPServer.Active := True;
finally
MCPClient.Free;
MCPServer.Free;
end;
end;
When you subscribe to the blog, we will send you an e-mail when there are new updates on the site so you wouldn't miss them.