Skip to main content
Prompts package repeatable model instructions. Use a prompt when a client should request model-ready messages; use a tool when the server should perform work.

Register a prompt

Prompt schemas are Standard Schema-compatible. Zod is one option:
Prefer the raw { 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:
Use an enum when only a fixed set is valid. Use completable(z.string(), ...) when other strings remain acceptable.

Use verified authentication context

Configure OAuth before reading ctx.auth. The authenticated callback type then contains the provider’s mapped user:
Use app-owned configuration validation in production rather than a non-null assertion. Client-reported metadata is not an authentication substitute.

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:
Active subscription listeners can then request prompts/list again. The server registry itself is not designed for late prompt registration after startup.

Test prompts

Run mcp-use dev, open the built-in inspector, and verify listing, argument validation, completions, and the exact generated messages.