Register a prompt
Prompt schemas are Standard Schema-compatible. Zod is one option:{ messages: [...] } result. Each message has a role and one
MCP content block.
Add argument suggestions
completable() supplies suggestions to clients. It does not constrain valid
values; the wrapped schema still decides what input is valid.
Apply descriptions, defaults, and refinements before wrapping the field:
completable(z.string(), ...)
when other strings remain acceptable.
Use verified authentication context
Configure OAuth before readingctx.auth. The authenticated callback type then
contains the provider’s mapped user:
Notify prompt-list listeners
Register prompts while constructing the server, before it starts handling requests. When application state changes what clients should consider available, publish a prompt-list invalidation:prompts/list again. The
server registry itself is not designed for late prompt registration after
startup.
Test prompts
Runmcp-use dev, open the built-in inspector, and verify listing, argument
validation, completions, and the exact generated messages.