MCP · Lesson 41 of 120
Prompts
Reusable templates.
Prompts are ready made templates that a server offers to the user. In many hosts they appear as slash commands. Pick one, fill in a value, and a well written prompt is sent to the model.

- Ready-made templates
- Slash commands
- Picked by the user
A support reply prompt
The prompt decorator turns a function into a prompt. It returns the text to send. The client lists prompts, then gets one with an argument. Run it. The finished prompt text is ready for the model.
prompt.pypython
import asyncio
from mcp import Client
from mcp.server.mcpserver import MCPServer
mcp = MCPServer("northwind")
@mcp.prompt()
def support_reply(question: str) -> str:
"""Draft a polite reply to a customer."""
return f"Write a short, polite reply to this Northwind customer: {question}"
async def main():
async with Client(mcp) as client:
print([p.name for p in (await client.list_prompts()).prompts])
result = await client.get_prompt("support_reply", {"question": "Where is my order?"})
print(result.messages[0].role, "|", result.messages[0].content.text)
asyncio.run(main())Output
['support_reply'] user | Write a short, polite reply to this Northwind customer: Where is my order?
Why prompts
Prompts capture expert wording once, so every user gets a good result. They're chosen by the user, not the model. And they can take arguments, and include resources.
| key | value |
|---|---|
| Captures | expert wording |
| Chosen by | the user |
| Arguments | fill the blanks |
| Hosts | slash commands |
Summary
Prompts are reusable templates, chosen by the user, and fetched with get prompt. Next, prompt arguments.
Key takeaways- @mcp.prompt
- get_prompt
- Slash commands
Next up: Prompt Arguments — fill in the blanks