By Admin on Wednesday, 15 October 2025
Category: All

Delphi MCP Server Prompts (3/4)

With sgcWebSockets 2025.9.0, the Model Context Protocol (MCP) server now supports Prompt Requests, enabling AI clients to query and render dynamic prompt templates. This capability makes it possible to expose reusable AI prompts (like "summarize text" or "review code") directly through WebSockets using the MCP standard.

What Are MCP Prompt Requests?

In MCP, Prompts are structured templates that clients can discover and use to generate model inputs consistently.
Each MCP server exposes:

  1. prompts/list — to enumerate available prompts.
  2. prompts/get — to render a specific prompt with given arguments.
  3. notifications/prompts/list_changed — to notify clients when the prompt catalog changes.

This allows large language models or agents to retrieve available templates and render them dynamically with context.

Listing Prompts

When a client calls prompts/list, your server should return an array of prompt definitions, including each prompt's name, description, and argument schema.

Example code that publishes a code review prompt: 

Prompt Request

When a client issues a prompts.call JSON-RPC request, TsgcWSAPIServer_MCP hydrates the strongly-typed request object (including tool name and the provided arguments) before raising the OnMCPRequestPrompt event. Your handler populates the response payload which is then serialized back to the client, alongside a success HTTP status code.

A typical handler looks like this: 

With MCP Prompts now integrated into sgcWebSockets 2025.9.0, developers can create AI-aware WebSocket servers that expose structured, discoverable, and dynamic prompts — bridging the gap between LLMs and real-time application data. 

Learn More

For in-depth documentation and component reference, visit:

sgcWebSockets MCP Prompts Server Guide 

Find below a Delphi MCP Server Demo for Windows