| name | add-prompt |
| description | Scaffold a new MCP prompt template. Use when the user asks to add a prompt, create a reusable message template, or define a prompt for LLM interactions.
|
| metadata | {"author":"cyanheads","version":"1.0","audience":"external","type":"reference"} |
Context
Prompts use the prompt() builder from @cyanheads/mcp-ts-core. Each prompt lives in src/mcp-server/prompts/definitions/ with a .prompt.ts suffix and is registered in the barrel index.ts.
Prompts are pure message templates — no Context, no auth, no side effects.
For the full prompt() API, read:
node_modules/@cyanheads/mcp-ts-core/CLAUDE.md
Steps
- Ask the user for the prompt's name, purpose, and arguments
- Create the file at
src/mcp-server/prompts/definitions/{{prompt-name}}.prompt.ts
- Register the prompt in
src/mcp-server/prompts/definitions/index.ts
- Run
bun run devcheck to verify
Template
import { prompt, z } from '@cyanheads/mcp-ts-core';
export const {{PROMPT_EXPORT}} = prompt('{{prompt_name}}', {
description: '{{PROMPT_DESCRIPTION}}',
args: z.object({
}),
generate: (args) => [
{
role: 'user',
content: {
type: 'text',
text: `{{PROMPT_TEMPLATE_TEXT}}`,
},
},
],
});
Multi-message prompt
generate: (args) => [
{
role: 'user',
content: {
type: 'text',
text: `Here is the ${args.type} to review:\n\n${args.content}`,
},
},
{
role: 'assistant',
content: {
type: 'text',
text: 'I will analyze this carefully. Let me start with...',
},
},
],
Barrel registration
import { {{PROMPT_EXPORT}} } from './{{prompt-name}}.prompt.js';
export const allPromptDefinitions = [
{{PROMPT_EXPORT}},
];
Checklist