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.tsxAbout
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_issuelinearSummarise an issue and its comments.
2 arguments · 1 required
weekly_digestlinearEverything that moved this week, grouped by project.
No arguments
review_diffgitReview a diff for correctness and style.
3 arguments · 2 required
<McpPromptList
prompts={prompts}
onSelect={insertIntoComposer}
/>Examples
Prompts from two servers
<McpPromptList prompts={prompts} onSelect={use} />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'>.
| Prop | Type | Default | Description |
|---|---|---|---|
| prompts | McpPrompt[] | 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. |
| selectLabel | string | 'Use' | — |
| requiredLabel | string | 'required' | — |
| noArgumentsLabel | string | 'No arguments' | — |
| emptyLabel | string | 'This server offers no prompts.' | — |
| showServer | boolean | true | — |
| summary | always 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.
| Field | Type | Description |
|---|---|---|
| name | string | — |
| description? | ReactNode | — |
| server? | string | Which server offered it. |
| arguments? | { name: string; description?: string; required?: boolean }[] | — |