Prompts Overview
Prompts are reusable message templates that you can attach to your MCP servers. They allow you to define structured conversations with arguments (variables) that get filled in at runtime.
What are Prompts?
MCP Prompts provide a standardized way to expose prompt templates to AI clients. When an MCP client (like Claude, Cursor, or Windsurf) connects to your server, it can discover available prompts and let users invoke them.
Key Features
- Reusable Templates: Create prompts once, use them across multiple servers
- Variable Arguments: Define placeholders like
{{code}}that get filled in when the prompt is used - Multiple Message Types: Include text, resources, or images in your prompt messages
- Role-based Messages: Structure conversations with user and assistant messages
Creating a Prompt
- Navigate to Prompts in the sidebar
- Click New Prompt
- Fill in the basic information:
- Name: A unique identifier (letters, numbers, underscores only)
- Title: Human-readable display name
- Description: What the prompt does
Adding Arguments
Arguments are variables that users provide when invoking the prompt. For example, a code review prompt might have a code argument.
- In the Arguments section, click Add Argument
- Enter the argument name (e.g.,
code) - Add an optional description
- Check "Required" if the argument must be provided
Adding Messages
Messages define the actual prompt content. Each message has a role (user or assistant) and content.
- In the Messages section, click Add Message
- Select the role (User or Assistant)
- Choose the content type:
- Text: Plain text with optional variable placeholders
- Resource: Reference to an existing resource
- Image: Upload an image file
Using Variables in Text
Reference arguments in your text using double curly braces:
Please review this code:
{{code}}
Focus on:
- Code quality
- Potential bugs
- Performance improvements
Message Content Types
Text Messages
The most common type. Enter plain text and use {{argument_name}} to insert variable values.
Resource Messages
Reference existing resources (files, text, or connected services). You can choose to:
- Embed content: Include the full resource content in the prompt
- Link only: Send just a reference to the resource
Image Messages
Include images in your prompts. Supported formats:
- PNG
- JPEG
- GIF
- WebP
Maximum file size: 100 MB
See Image Messages for more details.
Linking Prompts to Servers
After creating a prompt, you can link it to one or more servers:
- Open the prompt details
- In the Linked Servers section, click Add to Servers
- Select the servers you want to add the prompt to
- The prompt will now be available when MCP clients connect to those servers
How MCP Clients Use Prompts
When an MCP client connects to your server:
- It calls
prompts/listto discover available prompts - The user can see prompts with their titles, descriptions, and required arguments
- When a prompt is selected, the client calls
prompts/getwith any required arguments - Your server returns the interpolated messages with variables replaced
Example: Code Review Prompt
Name: code_review
Title: Request Code Review
Description: Asks the LLM to analyze code quality and suggest improvements
Arguments:
| Name | Description | Required |
|---|---|---|
| code | The code to review | Yes |
| language | Programming language | No |
Messages:
- User message (text):
Please review the following {{language}} code:
{{code}}
Provide feedback on:
- Code quality and style
- Potential bugs or issues
- Performance considerations
- Suggestions for improvement
When invoked with code="def hello(): print('world')" and language="Python", the message becomes:
Please review the following Python code:
def hello(): print('world')
Provide feedback on:
- Code quality and style
- Potential bugs or issues
- Performance considerations
- Suggestions for improvement