Primitives

Prompts: reusable workflows

Prompts are reusable message templates. The server packages its best workflows, and the user runs one by name.

Define it in the server

server.pypython
@mcp.prompt(title="Explain a sum")def explain(expression: str) -> str:    """Work out a sum step by step."""    return f"Add {expression} with the add tool."

← in prompts/list

 

 

← what prompts/get returns

Handy for

  • Workflows you run often: reviews, triage, reports
  • Expert prompts written once, shipped with the server
  • Live context, by embedding resources

Run it in Claude Code

> ↵

Claude Code names each prompt /mcp__server__prompt, so prompts from different servers, and its own commands, never clash. Arguments follow, separated by spaces.

Prompts are user-controlled: they run only when the user picks one. The host sends the returned messages to the model as if the user had typed them.

12 / 28