← Back to Dashboard
1. Prompt Templates2. Dynamic Arguments3. Context Assembly
Prompt Templates
What are Prompts inside MCP?
Prompts are predefined, reusable message templates that a user can trigger in the UI. Think of them as complex "slash commands" that inject dense system instructions into the LLM.
server.prompt(
"senior_code_reviewer",
{ language: z.string().optional() },
({ language }) => ({
messages: [{
role: "user",
content: {
type: "text",
text: `Act as a Principal ${language || 'Software'} Engineer. Review the following code for memory leaks.`
}
}]
})
);
💡 Key Insight: MCP Prompts are meant for the Host UI to expose to the user (e.g., clicking a button to load a complex workflow), not for the LLM to call autonomously.
🧪 Knowledge Check
Press 1-4 to select1 of 3
What is the main use-case for an MCP Prompt?
To force the LLM to generate faster tokens.
To provide a reusable template that users can quickly invoke via the UI.
To act as an automated testing script.
To cache data on the server.