Articles in this section

Add prompts to an MCP server

MCP prompts are reusable prompt templates defined by the server and surfaced to users by an agent. On selection of a prompt, the required inputs are provided, and a structured set of messages are generated for the LLM to perform a specific task. Prompts can accept dynamic arguments, include context from resources and chain multiple interactions. They enable servers to standardise common LLM interactions so they are consistent and reusable across any connected agent.

How agents use prompts

Agents typically follow this sequence:

  • Use prompt/list to discover available prompts

  • Use prompts/get to retrieve a specific prompt with resolved arguments

The prompts/get call returns the final set of message that an agent uses during execution.

Add prompts to an MCP server

While creating an MCP server, on the right side, in the Capabilities section click Add. The Add capabilities page is displayed.

add_capabilities_mcp_server.jpg

On the top of the page, click Prompts. If you don’t have any existing prompts click Create prompt.

prompt_tab_create_prompt.jpg

If you have previously created a prompt, click + Create prompt on the upper right side of the page.

In the Create prompt page, enter the details in the following sections.

create_prompt_page.jpg
General
  • Name: Provide an unique identifier for the prompt to be referenced easily.

    Note

    Use only alphanumeric characters, hyphens (-), underscores (_), and dots (.). spaces and other special characters are not allowed.

  • Title (optional): Provide a user friendly label that appears in the UI.

  • Description (optional): Explain what the prompt does and when to use it.

Prompts

This section allows you to define one or more message templates used during a conversation.  In MCP, each prompt represents a message with a specific role such as User and Assistant.

Prompt_section.jpg

To add a message template:

  1. Select either User or Assistant as a role.

  2. Enter the message for the prompt template.

  3. Click + to add another message template.

Each prompt template you add becomes part of the final sequence of messages used.

Template syntax

Prompt message templates support Handlebars syntax, allowing you to use placeholders such as {{accountId}}, {{timeRange}}. When the prompt runs, these placeholders are replaced with the corresponding values from input arguments.

Arguments

Arguments are the inputs used to replace placeholders (Handlebars syntax) in your prompt messages. For example, a placeholder like {{accountId}} is replaced with the value provided for that argument when the prompt runs.

To add an argument:

  1. Enter the argument name. This must match the placeholder used in your prompt (for example, accountId).

  2. (Optional) Add a description to help users understand what value to provide.

For each prompt you have options to:

  • Click + to add a new argument.

  • Click the trash icon to delete an argument.

  • Click the gear icon to add or edit the argument description.

Note

These arguments act as input parameters that are passed when the prompt is executed (for example, during a prompts/get request).

Test the prompt

In the Create prompt page, the left side is for configuring the prompt and the right side for execution and performance preview. To see how import requests will look click within the Input tab. You can directly edit the input field to modify the prompt if you haven't yet configured your prompt.

You can test your prompt before saving or using it:

Prompt_preview_test.jpg
  1. In the Preview tab, click Test to validate if your prompt is created properly or not.This renders the message templates with your provided argument values so you can verify the final resolved messages.

  2. Click Save&close.

  3. A new entry is added in the Prompts tab.

In the Prompts tab, you can view the details related to each prompt such as Name, Description, Arguments, and Actions. For each prompt, click (...) in the Actions column, to select the options to Edit or Delete a prompt.

promptstab.jpg