with one click
mcp-patterns
// Load MCP development patterns and best practices for building tools with the @umbraco-cms/mcp-server-sdk. Use when starting tool development or needing pattern reference.
// Load MCP development patterns and best practices for building tools with the @umbraco-cms/mcp-server-sdk. Use when starting tool development or needing pattern reference.
Guide for configuring and running Umbraco MCP servers via the CLI. Use when the user wants to set up an MCP server for Claude Code, configure auth, filtering, dry-run, readonly mode, or use introspection commands to understand available tools.
Add or update an LLM eval test for a specific tool or collection. Creates a new eval scenario or updates an existing one to cover new tools. Use when adding eval coverage for new or modified tools.
Add an integration test for a specific tool in an existing collection. Creates a test file following the collection's established patterns. Use when adding tests for new or modified tools, or re-creating deleted tests.
Add a new tool to an existing MCP collection. Creates the tool file, updates the collection index, optionally adds integration tests and eval tests. Use when adding new API endpoints to collections already created by '/build-tools'.
Build LLM eval tests for MCP tool collections. Reads .discover.json and creates eval setup and scenario test files per collection. Use after running '/build-tools'.
Build MCP tool collections from discovered API groups. Reads .discover.json and generates tools and collection registrations. Use after running 'npx @umbraco-cms/create-umbraco-mcp-server discover'.
| name | mcp-patterns |
| description | Load MCP development patterns and best practices for building tools with the @umbraco-cms/mcp-server-sdk. Use when starting tool development or needing pattern reference. |
This skill loads comprehensive patterns for building MCP tools using the @umbraco-cms/mcp-server-sdk.
Use this skill when:
All tools follow this structure:
import {
withStandardDecorators,
executeGetApiCall,
executeVoidApiCall,
createToolResult,
CAPTURE_RAW_HTTP_RESPONSE,
ToolDefinition,
} from "@umbraco-cms/mcp-server-sdk";
const MyTool = {
name: "tool-name",
description: "What the tool does",
inputSchema: zodSchema.shape,
outputSchema: responseSchema, // For GET operations
slices: ["read"], // Categorization
annotations: {
readOnlyHint: true, // For GET
destructiveHint: true, // For DELETE
idempotentHint: true, // For PUT
},
handler: async (params) => {
// Implementation
},
} satisfies ToolDefinition<...>;
export default withStandardDecorators(MyTool);
Configure once at server startup:
import { configureApiClient } from "@umbraco-cms/mcp-server-sdk";
import { getMyAPI } from "./api/generated/myApi.js";
configureApiClient(() => getMyAPI());
For GET operations that return data:
return executeGetApiCall<ReturnType<Client["method"]>, Client>(
(client) => client.method(params, CAPTURE_RAW_HTTP_RESPONSE)
);
For DELETE/PUT operations that return void:
return executeVoidApiCall<Client>(
(client) => client.deleteItem(id, CAPTURE_RAW_HTTP_RESPONSE)
);
For custom responses (typically CREATE operations):
if (response.status === 201) {
return createToolResult({ success: true, id: extractedId });
} else {
return createToolResultError(response.data);
}
Tools are categorized by operation type:
read - GET operationscreate - POST create operationsupdate - PUT operationsdelete - DELETE operationssearch - Search/filter operations| Operation | readOnlyHint | destructiveHint | idempotentHint |
|---|---|---|---|
| GET | ā | ā | ā |
| DELETE | ā | ā | ā |
| POST | ā | ā | ā |
| PUT | ā | ā | ā |
Important: DELETE is NOT idempotent (2nd call returns 404).
src/
āāā api/
ā āāā client.ts # API client with mock support
ā āāā openapi.yaml # OpenAPI spec
ā āāā generated/ # Orval-generated client + Zod schemas
āāā tools/
ā āāā {entity}/
ā āāā get/
ā āāā post/
ā āāā put/
ā āāā delete/
ā āāā index.ts # Collection export
āāā index.ts # MCP server entry
Generate client and Zod schemas from OpenAPI:
npm run generate
Configuration in orval.config.ts:
client option){action}-{entity} patternwithStandardDecorators handles errors automatically