Back to course

Working with Prompts (Templates)

Model Context Protocol (MCP) Server Engineering

Understanding MCP Prompts

Prompts are reusable templates. They help users start a conversation with the right context.

Implementation

typescript server.setRequestHandler(ListPromptsRequestSchema, async () => ({ prompts: [{ name: "code-review", description: "Review a piece of code for security issues" }] }));

Assignment: Create a prompt template called sql-helper that sets the persona of the AI to a DBA.