.cursor/skills/implementing-mcp-prompts/SKILL.md
Implement new MCP prompts in the deno-mcp-template project. Provides the exact file structure, type signatures, registration steps, and patterns for prompts with static arguments or dynamic completions. Use when adding a new prompt, creating MCP prompts, or asking how prompts work in this project.
npx skillsauth add phughesmcr/deno-mcp-template implementing-mcp-promptsInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Task Progress:
- [ ] Step 1: Create prompt file in src/mcp/prompts/
- [ ] Step 2: Define Zod schema, name, config, and callback
- [ ] Step 3: Export as default PromptPlugin
- [ ] Step 4: Register in src/mcp/prompts/mod.ts
- [ ] Step 5: Run `deno task ci` to verify
Every prompt follows this structure. Create a new file in src/mcp/prompts/.
import type { GetPromptResult } from "@modelcontextprotocol/sdk/types.js";
import { z } from "zod/v3";
import type { PromptPlugin } from "$/shared/types.ts";
// 1. Validation schema
const schema = z.object({
myArg: z.string().min(1, "Required"),
});
// 2. Prompt name (kebab-case)
const name = "my-prompt-name";
// 3. Config — choose one of the two argument styles below
const config = {
title: "Human-readable title",
description: "What this prompt does — shown to the LLM",
argsSchema: {
myArg: schema.shape.myArg,
},
};
// 4. Callback — returns GetPromptResult with messages array
async function callback(args: Record<string, unknown>): Promise<GetPromptResult> {
const { success, data, error } = schema.safeParse(args);
if (!success) throw new Error(error.message);
return {
messages: [{
role: "user",
content: {
type: "text",
text: `Do something with: ${data.myArg}`,
},
}],
};
}
// 5. Export as PromptPlugin tuple
const prompt: PromptPlugin = [name, config, callback];
export default prompt;
In src/mcp/prompts/mod.ts:
import myPrompt from "./myPrompt.ts";prompts array:export const prompts: PromptPlugin[] = [
// ... existing prompts
myPrompt,
];
The server registers each prompt via server.registerPrompt(...prompt).
From src/shared/types.ts:
export type PromptPlugin = Parameters<McpServer["registerPrompt"]>;
This is a tuple: [name, config, callback] matching McpServer.registerPrompt() parameters.
argsSchema (preferred)Uses Zod shapes directly. Supports completable() for dynamic suggestions.
import { completable } from "@modelcontextprotocol/sdk/server/completable.js";
const config = {
title: "My Prompt",
description: "...",
argsSchema: {
language: completable(schema.shape.language, (value) => {
const prefix = value.trim().toLowerCase();
return options.filter((o) => o.toLowerCase().startsWith(prefix)).slice(0, 5);
}),
goal: schema.shape.goal,
},
};
arguments array (legacy)Uses the Prompt type from the SDK. No dynamic completions.
import type { Prompt } from "@modelcontextprotocol/sdk/types.js";
const config: Prompt = {
name,
title: "My Prompt",
description: "...",
arguments: [
{ name: "code", description: "The code to review", required: true },
],
};
Callbacks return GetPromptResult — an object with a messages array:
async function callback(args: Record<string, unknown>): Promise<GetPromptResult> {
const { success, data, error } = schema.safeParse(args);
if (!success) throw new Error(error.message);
return {
messages: [
{
role: "user",
content: { type: "text", text: `Your prompt text with ${data.myArg}` },
},
],
};
}
Key differences from tool callbacks:
args: Record<string, unknown> (not any)GetPromptResult (not CallToolResult)McpServer parameter — prompts don't need server accessReturn multiple messages for system + user prompt patterns:
return {
messages: [
{
role: "assistant",
content: { type: "text", text: "You are a code reviewer..." },
},
{
role: "user",
content: { type: "text", text: `Review this code:\n\n${data.code}` },
},
],
};
tools
Implement new MCP tools in the deno-mcp-template project. Provides the exact file structure, type signatures, registration steps, and patterns for standard tools, sampling tools, form and URL elicitation, resource-backed tools, and notification tools. Use when adding a new tool, creating MCP tools, or asking how tools work in this project.
tools
Implement new MCP resources and resource templates in the deno-mcp-template project. Provides the exact file structure, type signatures, registration steps, and patterns for static resources, KV-backed resources, resource templates with URI patterns, and subscription-based updates. Use when adding a new resource, creating MCP resources, or asking how resources work in this project.
tools
Use when work should span one or more detached tasks but still behave like one job with a single owner context. TaskFlow is the durable flow substrate under authoring layers like Lobster, ACPX, plugins, or plain code. Keep conditional logic in the caller; use TaskFlow for flow identity, child-task linkage, waiting state, revision-checked mutations, and user-facing emergence.
tools
# Lobster Lobster executes multi-step workflows with approval checkpoints. Use it when: - User wants a repeatable automation (triage, monitor, sync) - Actions need human approval before executing (send, post, delete) - Multiple tool calls should run as one deterministic operation ## When to use Lobster | User intent | Use Lobster? | | ------------------------------------------------------ | --------------------------