Defining prompts
Prompts let a server author ship curated starting points alongside its tools. They are user-controlled, so they show up as things a person picks.
What a prompt is #
A prompt is a named, parameterized template that expands into one or more messages. A client typically surfaces prompts as slash commands or menu items. The user picks one, fills in any arguments, and the expanded messages start the conversation.
python@mcp.prompt()
def review_pr(repo: str, number: int) -> str:
"""Review a pull request."""
return f"Review PR #{number} in {repo}. Check for bugs, then summarize."
When to use a prompt #
Use a prompt when there is a repeatable workflow your users will run often: "summarize this incident," "open a release checklist," "review this PR." It packages the right instructions and the right tools into one click, so users do not have to remember the phrasing.
Prompts are not tools #
A prompt does not act on its own; it seeds a conversation the model then carries out (often by calling the server's tools). Keep the split clear: prompts start work, tools do work.
Resources & further reading
- MCP specification MCPThe authoritative protocol spec: messages, capabilities, transports, and lifecycle.