TTMSMCPCloudAI talks to a cloud language model directly — no MCP server, no transport, no protocol handshake. You set an API key, pick a service, put your prompt in Context, and call Execute. Everything a modern chat API offers is reachable from the same component: system and assistant roles, model and generation settings per provider, function calling through a Tools collection your own code answers, file context (images, PDF, spreadsheets, Word documents, plain text, URLs), the OpenAI assistants and threads API for retrieval over uploaded documents, speech generation, and audio transcription or translation. Local model servers — Ollama and llama.cpp — and the OpenRouter aggregator use exactly the same surface as the hosted services.
The HTTP transport ancestor: requests, logging, progress, and cancellation.
Minimal example
procedure TForm1.FormCreate(Sender: TObject);
begin
{ AI is a TTMSMCPCloudAI dropped on the form. Keys were saved earlier with
AI.APIKeys.SaveToFile, so nothing secret lives in the source. }
AI.APIKeys.LoadFromFile('aikeys.cfg', KeyStorePassword);
AI.Service := aiOpenAI;
AI.Settings.OpenAIModel := 'gpt-5.2';
AI.OnExecuted := AIExecuted;
end;
procedure TForm1.btnAskClick(Sender: TObject);
begin
if AI.Busy then
Exit;
AI.SystemRole.Text := 'You are a concise Delphi assistant.';
AI.Context.Text := memoPrompt.Lines.Text;
AI.Execute;
end;
procedure TForm1.AIExecuted(Sender: TObject; AResponse: TTMSMCPCloudAIResponse;
AHttpStatusCode: Integer; AHttpResult: string);
begin
if Assigned(AResponse) then
memoAnswer.Lines.Text := AResponse.Content.Text
else
memoAnswer.Lines.Text := Format('Request failed (%d): %s',
[AHttpStatusCode, AHttpResult]);
end;
Provider selection, API keys, the three prompt roles, per-service models, generation settings, Claude prompt caching, local servers, and reading the response and usage.
Sending PDF, Office, image, text, and URL context; uploading and managing stored files; assistants and threads; text-to-speech; transcription and translation.
See Also
Cloud AI Tool Sets — ready-made tool sets for logging, the file system, datasets, and email
Cloud Image AI — image generation against the same kind of cloud services
MCP Client — reach a model through an MCP server instead of calling it directly