MCP Client
Connect to Model Context Protocol (MCP) servers from Delphi. Discover and invoke tools, fetch resources, and use prompts.
Connect to Model Context Protocol (MCP) servers from Delphi. Discover and invoke tools, fetch resources, and use prompts.
Client side of the Model Context Protocol. Talks JSON-RPC over HTTP or HTTP Streamable to any MCP server (Claude Desktop, Cursor, Anthropic MCP servers, your own).
TsgcWSAPIClient_MCP
Model Context Protocol JSON-RPC
Windows, macOS, Linux, iOS, Android
Enterprise (AI add-on)
Configure URL + auth, Initialize, then list catalogues and call tools / prompts / resources.
uses
sgcAI_MCP_Client, sgcAI_MCP_Classes;
var
MCP: TsgcWSAPIClient_MCP;
begin
MCP := TsgcWSAPIClient_MCP.Create(nil);
MCP.MCPOptions.HttpOptions.URL := 'https://mcp.example.com/';
MCP.MCPOptions.ClientInfo.Name := 'sgc-mcp-client';
MCP.MCPOptions.ClientInfo.Title := 'sgc MCP demo';
MCP.MCPOptions.ClientInfo.Version := '1.0.0';
MCP.MCPOptions.AuthenticationOptions.ApiKey.Enabled := True;
MCP.MCPOptions.AuthenticationOptions.ApiKey.Value := 'sk-mcp-...';
MCP.OnMCPInitialize := MCPInit;
MCP.OnMCPListPrompts := MCPListPrompts;
MCP.OnMCPListTools := MCPListTools;
MCP.OnMCPResponseTool := MCPToolResponse;
MCP.Initialize;
MCP.ListPrompts;
MCP.ListResources;
MCP.ListTools;
MCP.RequestTool('GetTemperature', '{"city":"Madrid"}');
end;
2 published properties, 12 methods, 12 events — pulled from the component reference.
Published properties: MCPOptions.
Published properties: Version.
Methods: Initialize, Ping.
Methods: ListTools, RequestTool.
Methods: ListPrompts, RequestPrompt.
Methods: ListResources, RequestResource, ListResourceTemplates.
Authoritative sources for the protocols this component implements.
Deep-link to the component reference, grab the ready-to-run demo project, and download the trial.
| Demo Project — Demos\AI\MCP\Client Ready-to-run example project. Ships inside the sgcWebSockets package — download the trial below. | Open | |
| Technical Document (PDF) Features, quick start, code samples for Delphi & C++ Builder and primary-source references — this component only. | Open | |
| User Manual (PDF) Comprehensive manual covering every component in the library. | Open |