MCP Prompt List

The prompts a server offers, with the arguments each one takes. How much has to be filled in is visible without expanding, because that is what decides which prompt you pick.

src/components/ui/mcp-prompt-list.tsx

About

From the component's own source, where it was written.

The prompts an MCP server offers, with the arguments each one takes.

MCP prompts are user-invoked templates — the slash-command surface of a server. Unlike tools, nobody calls them by accident, so the useful thing to show is not risk but **shape**: what has to be filled in before this can run.

Required arguments are visible without expanding. A prompt that needs three inputs and one that needs none are chosen differently, and hiding that behind a disclosure makes the list unusable for picking.

Install

npx astralyx-ui add mcp-prompt-list

Usage

import { McpPromptList } from '@/components/ui/mcp-prompt-list'

<McpPromptList prompts={prompts} onSelect={(p) => insertIntoComposer(p)} />

Composer

Change the props and the source below follows.

  • summarise_issuelinear

    Summarise an issue and its comments.

    2 arguments · 1 required

  • weekly_digestlinear

    Everything that moved this week, grouped by project.

    No arguments

  • review_diffgit

    Review a diff for correctness and style.

    3 arguments · 2 required

Props
tsx
<McpPromptList
  prompts={prompts}
  onSelect={insertIntoComposer}
/>

Examples

Prompts from two servers

API

Generated from the source, so it cannot fall behind the code. One table per exported component, then hooks, functions and types.

McpPromptList

Extends Omit<ComponentProps<'ul'>, 'onSelect'>.

PropTypeDefaultDescription
promptsMcpPrompt[]required{ name, description?, server?, arguments? } where each argument is { name, description?, required? }.
onSelect(prompt: McpPrompt) => void—Usually inserts the prompt into a composer. Omit to render the list read-only.
selectLabelstring'Use'—
requiredLabelstring'required'—
noArgumentsLabelstring'No arguments'—
emptyLabelstring'This server offers no prompts.'—
showServerbooleantrue—
summaryalways visible—Count and required-count sit on the collapsed row. A prompt needing three inputs and one needing none are chosen differently.

Types

McpPrompt

The prompts an MCP server offers, with the arguments each one takes.

FieldTypeDescription
namestring—
description?ReactNode—
server?stringWhich server offered it.
arguments?{ name: string; description?: string; required?: boolean }[]—