Version 2025.10.0 of sgcWebSockets expands the AI integration toolkit with a commercial-grade MCP Client implementation that keeps your Delphi applications in lockstep with the Model Context Protocol 2025-06-18 specification. Deliver curated context, orchestrate tool calls and serve resource-aware assistants, all from a single component.
The Model Context Protocol (MCP) standardizes how assistants negotiate capabilities and exchange structured context. By adding MCP Client support, sgcWebSockets enables:
- Enterprise-grade interoperability with any MCP-compliant assistant, ensuring consistent initialization and capability discovery workflows.
- Faster time to market for AI-augmented experiences in existing VCL, FMX or WebBroker projects thanks to a drop-in Delphi component.
- Operational visibility across every JSON-RPC exchange through built-in HTTP logging and TLS 1.3 transport hardening.
Highlights of TsgcAI_MCP_Client
Turnkey MCP Handshake
Execute the protocol negotiation from a single Initialize call. The client advertises your product name, title and semantic version while honoring the session identifier returned by the server.
Rich Capability Surface
Issue ready-made method calls including Ping, ToolsList, ToolsCall, PromptsList, PromptsGet, ResourcesList and ResourcesRead. Every response type is strongly typed, making downstream processing effortless.
Event-driven Customization
Hook into granular events—initialization, ping, tool discovery, prompt retrieval and resource streaming—to trace and personalize every exchange before it reaches your business layer.
The component automatically increments JSON-RPC request identifiers, persists MCP session identifiers between calls, and raises typed exceptions when a remote error is returned. HTTP connectivity is encapsulated inside the specialized client that logs traffic and negotiates TLS 1.3 with OpenSSL 3.0 APIs.
Configuration Overview
- Client Profile: Configure
MCPOptions.ClientInfoto present your assistant-integrated solution with name, title and version metadata. - Server Endpoint: Set
MCPOptions.ServerOptions.URLto the MCP-compatible HTTPS endpoint you want to reach. - HTTP Stack: Built on
TsgcAI_MCP_HTTP_Client, the transport layer is tuned for JSON content types, automatic session headers and secure TLS defaults. - Observability Hooks: Subscribe to event handlers such as
OnMCPToolsCallorOnMCPResourcesReadto audit and enrich every protocol transition.
Delphi Integration Example
The snippet below illustrates how to drop the MCP Client onto a data module, initialize it during startup and serve a tool call response as soon as the remote assistant requests it.