Skip to main content

What are Prompts?

Prompts in MCP enable servers to define reusable prompt templates and workflows that clients can easily surface to users and LLMs. They provide a powerful way to standardize and share common LLM interactions. Prompts are pre-written templates that can include:
  • Instructions for specific tasks
  • Context for the LLM
  • Structured workflows
  • Dynamic content based on arguments

Basic Usage

Add a prompt to your server using the addPrompt method:

Prompt Arguments

Define arguments that customize the prompt:

Required Arguments

Optional Arguments

Return Formats

Simple String

Return a plain string for simple prompts:

Message Format

Return a structured message format for more control:

Argument Auto-completion

Provide auto-completion suggestions for prompt arguments:

Basic Completion

Using Enum for Completion

For fixed sets of values, use the enum property:
When you provide an enum array, FastMCP automatically provides completions for the argument.

Advanced Completion

Provide more detailed completion information:

Authentication Context

Prompts can access authentication context to personalize content:

Multiple Arguments with Completion

Complete Examples

Code Review Prompt

Documentation Generator

Interactive Tutorial

API Reference

Prompt Type

PromptArgument Type

PromptResult Type

Completion Type