import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
export function registerPrompts(server: McpServer) {
// Example Prompt 1: Analysis prompt
server.registerPrompt(
'analyze',
{
title: 'Analysis Prompt',
description: 'Analyze data or text',
},
async () => {
return {
messages: [
{
role: 'user' as const,
content: {
type: 'text' as const,
text: 'Please analyze the following data and provide insights.',
},
},
],
};
}
);
// Example Prompt 2: Code review prompt
server.registerPrompt(
'code-review',
{
title: 'Code Review Prompt',
description: 'Request a code review',
},
async () => {
return {
messages: [
{
role: 'user' as const,
content: {
type: 'text' as const,
text: 'Please review the following code for:\n1. Best practices\n2. Potential bugs\n3. Performance issues\n4. Security concerns',
},
},
],
};
}
);
// Example Prompt 3: Summarization prompt
server.registerPrompt(
'summarize',
{
title: 'Summarization Prompt',
description: 'Summarize content',
},
async () => {
return {
messages: [
{
role: 'user' as const,
content: {
type: 'text' as const,
text: 'Please provide a concise summary of the key points.',
},
},
],
};
}
);
}