Skip to content

Commit 613e027

Browse files
hifi-philPhil Whittakerclaude
authored
Release v16.0.0 (#45)
* Add .env file support for MCP server configuration - Centralize configuration management in new config.ts module - Load environment variables from .env file (default) or custom path via --env flag - Support CLI argument overrides for all configuration options (--umbraco-*) - Track configuration sources (CLI vs ENV) for transparency - Add comprehensive validation and error reporting for missing credentials - Update documentation with .env usage examples and .mcp.json configuration - Refactor tests to use centralized config system - Remove deprecated env.ts helper - Improve multi-culture document test with proper setup and cleanup 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]> * Improve copy-document tool with flattened schema and clearer workflow (#30) - Flatten tool parameter schema for better LLM usability - Replace nested `id` + `data` structure with top-level parameters - Use `idToCopy` instead of `id` for clarity - Move `relateToOriginal` and `includeDescendants` to top level - Make `parentId` optional (omit for root, provide for specific parent) - Add comprehensive tool description with workflow examples - Document the empty string return value behavior - Provide clear copy-only vs copy-and-update workflow patterns - Explain search-document requirement for post-copy operations - Update e2e test to use update-document instead of search - Simplify workflow: copy → update → publish → delete - Remove unnecessary search-document and document-type lookups - Update allowed tools list to match actual workflow - Pin mcp-server-tester to version 1.4.0 for consistency - Update copy-document unit tests to match new schema 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Phil Whittaker <[email protected]> Co-authored-by: Claude <[email protected]> * Add universal media upload tools with URL and base64 support (#31) * Update create-temporary-file to accept base64 encoded data - Changed schema from ReadStream to base64 string input for MCP compatibility - Converts base64 → Buffer → temp file → ReadStream for Umbraco API - Uses os.tmpdir() for temporary file storage - Automatic cleanup of temp files in finally block - Updated tests to use base64 encoding - All tests passing (11/11) This makes the tool compatible with LLM/MCP usage where files are provided as base64 strings rather than file system streams. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]> * Add editorAlias and entityType to media value objects - Updated media-builder to include editorAlias and entityType in image values - Fixed focalPoint to use correct properties (left, top) - Changed temporaryFileId property name (was temporaryFilId) - Added documentation to create-media tool with complete example - Documented API quirk in docs/comments.md - Added experimental test-file-format tool for testing file upload formats These fields are required by the Umbraco API but not documented in the OpenAPI spec. Without them, media items are created but files are not properly uploaded/attached. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]> * Add universal media upload tools with URL and base64 support - Add create-media tool supporting filePath, URL, and base64 sources - Add create-media-multiple tool for batch uploads (max 20 files) - Implement automatic MIME type detection using mime-types library - Add comprehensive media upload helpers with proper error handling - Fix extension handling: only add to temp files, not media item names - Add test infrastructure including builders and helpers - Add integration tests with snapshot testing - Support all media types: Image, File, Video, Audio, SVG, etc. Technical improvements: - Use mime-types library for robust MIME type to extension mapping - Proper temp file cleanup after uploads - SVG media type auto-correction (Image → Vector Graphic) - Continue-on-error strategy for batch uploads - Comprehensive test coverage with proper cleanup 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]> * Remove obsolete TEST_FILE_FORMAT_README.md 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]> * Remove obsolete test-file-format.ts 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]> --------- Co-authored-by: Phil Whittaker <[email protected]> Co-authored-by: Claude <[email protected]> * Pull back from main to dev (#35) * Release/16.0.0 beta.2 (#32) * Add .env file support for MCP server configuration - Centralize configuration management in new config.ts module - Load environment variables from .env file (default) or custom path via --env flag - Support CLI argument overrides for all configuration options (--umbraco-*) - Track configuration sources (CLI vs ENV) for transparency - Add comprehensive validation and error reporting for missing credentials - Update documentation with .env usage examples and .mcp.json configuration - Refactor tests to use centralized config system - Remove deprecated env.ts helper - Improve multi-culture document test with proper setup and cleanup 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]> * Improve copy-document tool with flattened schema and clearer workflow (#30) - Flatten tool parameter schema for better LLM usability - Replace nested `id` + `data` structure with top-level parameters - Use `idToCopy` instead of `id` for clarity - Move `relateToOriginal` and `includeDescendants` to top level - Make `parentId` optional (omit for root, provide for specific parent) - Add comprehensive tool description with workflow examples - Document the empty string return value behavior - Provide clear copy-only vs copy-and-update workflow patterns - Explain search-document requirement for post-copy operations - Update e2e test to use update-document instead of search - Simplify workflow: copy → update → publish → delete - Remove unnecessary search-document and document-type lookups - Update allowed tools list to match actual workflow - Pin mcp-server-tester to version 1.4.0 for consistency - Update copy-document unit tests to match new schema 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Phil Whittaker <[email protected]> Co-authored-by: Claude <[email protected]> * Add universal media upload tools with URL and base64 support (#31) * Update create-temporary-file to accept base64 encoded data - Changed schema from ReadStream to base64 string input for MCP compatibility - Converts base64 → Buffer → temp file → ReadStream for Umbraco API - Uses os.tmpdir() for temporary file storage - Automatic cleanup of temp files in finally block - Updated tests to use base64 encoding - All tests passing (11/11) This makes the tool compatible with LLM/MCP usage where files are provided as base64 strings rather than file system streams. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]> * Add editorAlias and entityType to media value objects - Updated media-builder to include editorAlias and entityType in image values - Fixed focalPoint to use correct properties (left, top) - Changed temporaryFileId property name (was temporaryFilId) - Added documentation to create-media tool with complete example - Documented API quirk in docs/comments.md - Added experimental test-file-format tool for testing file upload formats These fields are required by the Umbraco API but not documented in the OpenAPI spec. Without them, media items are created but files are not properly uploaded/attached. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]> * Add universal media upload tools with URL and base64 support - Add create-media tool supporting filePath, URL, and base64 sources - Add create-media-multiple tool for batch uploads (max 20 files) - Implement automatic MIME type detection using mime-types library - Add comprehensive media upload helpers with proper error handling - Fix extension handling: only add to temp files, not media item names - Add test infrastructure including builders and helpers - Add integration tests with snapshot testing - Support all media types: Image, File, Video, Audio, SVG, etc. Technical improvements: - Use mime-types library for robust MIME type to extension mapping - Proper temp file cleanup after uploads - SVG media type auto-correction (Image → Vector Graphic) - Continue-on-error strategy for batch uploads - Comprehensive test coverage with proper cleanup 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]> * Remove obsolete TEST_FILE_FORMAT_README.md 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]> * Remove obsolete test-file-format.ts 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]> --------- Co-authored-by: Phil Whittaker <[email protected]> Co-authored-by: Claude <[email protected]> --------- Co-authored-by: Phil Whittaker <[email protected]> Co-authored-by: Claude <[email protected]> * Release/16.0.0 beta.2 (#34) * Add .env file support for MCP server configuration - Centralize configuration management in new config.ts module - Load environment variables from .env file (default) or custom path via --env flag - Support CLI argument overrides for all configuration options (--umbraco-*) - Track configuration sources (CLI vs ENV) for transparency - Add comprehensive validation and error reporting for missing credentials - Update documentation with .env usage examples and .mcp.json configuration - Refactor tests to use centralized config system - Remove deprecated env.ts helper - Improve multi-culture document test with proper setup and cleanup 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]> * Improve copy-document tool with flattened schema and clearer workflow (#30) - Flatten tool parameter schema for better LLM usability - Replace nested `id` + `data` structure with top-level parameters - Use `idToCopy` instead of `id` for clarity - Move `relateToOriginal` and `includeDescendants` to top level - Make `parentId` optional (omit for root, provide for specific parent) - Add comprehensive tool description with workflow examples - Document the empty string return value behavior - Provide clear copy-only vs copy-and-update workflow patterns - Explain search-document requirement for post-copy operations - Update e2e test to use update-document instead of search - Simplify workflow: copy → update → publish → delete - Remove unnecessary search-document and document-type lookups - Update allowed tools list to match actual workflow - Pin mcp-server-tester to version 1.4.0 for consistency - Update copy-document unit tests to match new schema 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Phil Whittaker <[email protected]> Co-authored-by: Claude <[email protected]> * Add universal media upload tools with URL and base64 support (#31) * Update create-temporary-file to accept base64 encoded data - Changed schema from ReadStream to base64 string input for MCP compatibility - Converts base64 → Buffer → temp file → ReadStream for Umbraco API - Uses os.tmpdir() for temporary file storage - Automatic cleanup of temp files in finally block - Updated tests to use base64 encoding - All tests passing (11/11) This makes the tool compatible with LLM/MCP usage where files are provided as base64 strings rather than file system streams. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]> * Add editorAlias and entityType to media value objects - Updated media-builder to include editorAlias and entityType in image values - Fixed focalPoint to use correct properties (left, top) - Changed temporaryFileId property name (was temporaryFilId) - Added documentation to create-media tool with complete example - Documented API quirk in docs/comments.md - Added experimental test-file-format tool for testing file upload formats These fields are required by the Umbraco API but not documented in the OpenAPI spec. Without them, media items are created but files are not properly uploaded/attached. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]> * Add universal media upload tools with URL and base64 support - Add create-media tool supporting filePath, URL, and base64 sources - Add create-media-multiple tool for batch uploads (max 20 files) - Implement automatic MIME type detection using mime-types library - Add comprehensive media upload helpers with proper error handling - Fix extension handling: only add to temp files, not media item names - Add test infrastructure including builders and helpers - Add integration tests with snapshot testing - Support all media types: Image, File, Video, Audio, SVG, etc. Technical improvements: - Use mime-types library for robust MIME type to extension mapping - Proper temp file cleanup after uploads - SVG media type auto-correction (Image → Vector Graphic) - Continue-on-error strategy for batch uploads - Comprehensive test coverage with proper cleanup 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]> * Remove obsolete TEST_FILE_FORMAT_README.md 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]> * Remove obsolete test-file-format.ts 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]> --------- Co-authored-by: Phil Whittaker <[email protected]> Co-authored-by: Claude <[email protected]> * Update package.json --------- Co-authored-by: Phil Whittaker <[email protected]> Co-authored-by: Claude <[email protected]> --------- Co-authored-by: Phil Whittaker <[email protected]> Co-authored-by: Claude <[email protected]> * Security improvements and performance optimisation for media uploads (#36) * Optimize media type lookups with hardcoded GUIDs - Add constants for all 7 standard Umbraco media type GUIDs - Add media type name constants for consistency - Create STANDARD_MEDIA_TYPES mapping for O(1) lookups - Update fetchMediaTypeId() to use hardcoded GUIDs for standard types - Eliminate API calls for 95% of media uploads (standard types only) - Update all helper functions to use constants instead of magic strings - Update tool schemas to reference constants - Add comprehensive unit tests (14 new tests, all passing) - Maintain backward compatibility with custom media types via API fallback Performance: Eliminates 7+ API calls per upload for standard media types 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]> * Add security whitelisting for media file path uploads Implements path validation with UMBRACO_ALLOWED_MEDIA_PATHS environment variable to prevent arbitrary file system access. Resolves HIGH SEVERITY security vulnerability where file path uploads could read any file on the server. Security Features: - Path whitelisting via comma-delimited environment variable - Prevention of path traversal attacks (../) - Symlink target validation - Secure-by-default (disabled when not configured) - Cross-platform support (macOS /private/tmp handling) Implementation: - Added UMBRACO_ALLOWED_MEDIA_PATHS config to src/config.ts - Created validate-file-path.ts helper with security validation - Updated media-upload-helpers.ts to validate all file paths - Added security warnings to create-media tools - 12 comprehensive security tests (all passing) - Updated README.md with security configuration docs Breaking Change: File path uploads now require explicit UMBRACO_ALLOWED_MEDIA_PATHS configuration. URL and base64 uploads continue to work without config. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]> --------- Co-authored-by: Phil Whittaker <[email protected]> Co-authored-by: Claude <[email protected]> * Fix Jest configuration for media security tests (#38) - Add @/config.js module mapper to jest.config.ts - Set UMBRACO_ALLOWED_MEDIA_PATHS in jest.setup.ts to allow test files - Update validate-file-path.test.ts to isolate environment variables - Update snapshots for changed error messages (path validation runs first) All 52 media test suites now pass (178 tests total). 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Phil Whittaker <[email protected]> Co-authored-by: Claude <[email protected]> * Schema flattening for parent parameters and Document Blueprint improvements (#39) * Implement schema flattening pattern for parent parameters This change addresses an LLM bug where nested parent objects like `parent: { id: "uuid" }` are sometimes incorrectly stringified to `"parent": "{\"id\": \"uuid\"}"`, causing API validation failures. Changes: - Flattened schemas: Replace nested parent objects with flat parameters - Path-based: `path` parameter for Stylesheets - ID-based: `parentId` parameter for Dictionary, Data Type, Document Blueprint - Transform logic: Convert flat parameters to nested API structure - Updated builders: Renamed methods (withParent → withParentId/withPath) - Enhanced test helpers: Normalize both item and parent IDs in snapshots - Added parent folder tests: Verify flattened schema works correctly Benefits: - Prevents LLM JSON stringification errors - Maintains API compatibility through transformation layer - Simpler, more intuitive tool interfaces for LLMs Affected endpoints: - create-stylesheet (path-based) - create-dictionary-item (ID-based) - create-data-type (ID-based) - create-document-blueprint (ID-based) Test coverage: - All existing tests updated and passing - New tests for parent folder scenarios - Stylesheet: 47/47 tests passing - Dictionary: Tests updated with parent functionality - Data Type: 68/68 tests passing - Document Blueprint: 64/64 tests passing 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]> * Add schema flattening for Media Type and Document Type Extends the schema flattening pattern to Media Type and Document Type to prevent LLM JSON stringification issues when creating items in folders. Changes: - Media Type: Added flattened parentId parameter with transformation logic - Document Type: Added flattened parentId parameter with transformation logic - Updated all builders: withParent() → withParentId() for consistency - Added tests for creating items with parent folders - Added snapshot testing for parent folder scenarios Technical details: - Transforms parentId: string → parent: { id: string } in tool handlers - Updated tool descriptions to reflect folder creation capability - Normalized parent IDs in snapshot tests for consistency - Document Type: 104 tests passing - Media Type: Builder and test updates complete 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]> * Add missing Document Blueprint tools and document API limitation Added 6 missing tools that were implemented but not exposed: - get-document-blueprint-by-id-array: Get multiple blueprints by IDs - move-document-blueprint: Move blueprint to different folder - create-document-blueprint-folder: Create new folder - get-document-blueprint-folder: Get folder by ID - update-document-blueprint-folder: Update folder name - delete-document-blueprint-folder: Delete empty folder Documented create-document-blueprint-from-document API limitation: - Removed parentId parameter (Umbraco API doesn't respect it) - Added note explaining blueprints are always created at root - Suggested using move-document-blueprint tool to relocate after creation - Removed test for parent parameter that doesn't work - All 3 remaining tests passing Organized tools in logical groups (CRUD, queries, tree, folders) for better maintainability. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]> * Compress schema flattening rule documentation Reduced file from 254 to 89 lines (65% reduction) while maintaining all essential information: - Problem statement with clear examples - Both solution patterns (path-based and ID-based) - When to apply the rule - Testing requirements - Reference implementations - Quick checklist Removed verbose explanations and redundant examples for better readability. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]> --------- Co-authored-by: Phil Whittaker <[email protected]> Co-authored-by: Claude <[email protected]> * Add Umbraco version compatibility checking (#40) This commit introduces automatic version checking between the MCP server and the connected Umbraco instance to prevent compatibility issues. Features: - Checks Umbraco version on server startup via Management API - Compares major version numbers (e.g., 16.x vs 15.x) - Blocks tool execution on version mismatch until user acknowledges - Silent operation when versions match - Non-blocking warnings for API errors Implementation: - New version-check helper module with blocking state management - Integration into create-umbraco-tool wrapper - Comprehensive Jest unit tests (6 tests covering all scenarios) - Uses existing package.json version field - Simple string splitting for version extraction Behavior: - Version match: No message, normal operation - Version mismatch: First tool call fails with error, retry to proceed - API error: Warning displayed but doesn't block execution 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Phil Whittaker <[email protected]> Co-authored-by: Claude <[email protected]> * Update VS Code installation button to beta version with SSL support (#41) - Update install button from @umbraco-mcp/umbraco-mcp-cms@alpha to @umbraco-cms/mcp-dev@beta - Add NODE_TLS_REJECT_UNAUTHORIZED environment variable to button URL and manual config - Ensure consistency with Claude Desktop configuration pattern 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Phil Whittaker <[email protected]> Co-authored-by: Claude <[email protected]> * Add JSON fragment templates and refactor property handling (#43) * Add get-property-editor-template tool and refactor create-data-type - Created new get-property-editor-template tool to retrieve property editor configuration templates - Extracted 30+ property editor templates from create-data-type tool description into TypeScript file - Updated create-data-type tool description to reference get-property-editor-template instead of embedding examples - Reduced create-data-type description by ~150 lines Features: - TypeScript file (property-editor-templates.ts) with type-safe template definitions - get-property-editor-template tool lists all available editors or returns specific template - Comprehensive test suite for get-property-editor-template (6 tests, all passing) - All TypeScript compilation and tests passing E2E Testing: - Added block list data type test with element type creation - Split e2e tests into separate files (text-box and block-list) - Updated test config to include document-type tools for element type creation Benefits: - Better maintainability: property editor templates in dedicated file - Improved LLM workflow: explicit tool call to discover available editors - Type safety: TypeScript interface for property editor templates - No file system path issues: direct import instead of runtime file reading 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]> * Add document property value templates and rename tools for clarity Token Optimization: - Extracted 30+ property value examples from create-document tool (~580 lines) - Reduced create-document.ts from 686 to 129 lines (81% reduction) - Created get-document-property-value-template tool for on-demand template loading - Estimated token savings: ~3,500 tokens per tool list Tool Naming Improvements: - Renamed get-property-editor-template → get-data-type-property-editor-template - Renamed get-property-value-template → get-document-property-value-template - Entity type now explicitly in tool names for clarity Files Created: - property-value-templates.ts: 30+ property value templates (editorAlias + value only) - get-document-property-value-template.ts: MCP tool for template retrieval - get-document-property-value-template.test.ts: Comprehensive test suite (10 tests) - E2E test validating template discovery → document creation workflow Files Updated: - create-document.ts: References new template tool - create-data-type.ts: References renamed template tool - document/index.ts: Exports new tool - data-type/index.ts: Exports renamed tool Template Design: - Templates contain only editorAlias and value (plus optional _notes) - Document-specific properties (culture, segment, alias) added by LLM at creation time - Follows exact pattern from get-property-editor-template Testing: - All 10 document template tests passing - All 6 data type template tests passing - TypeScript compilation successful - E2E test created for full workflow validation 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]> * Fix document integration tests with minimal changes - Add createSnapshotResult helper for proper ID normalization in snapshots - Change date normalization from "<normalized>" to "NORMALIZED_DATE" for consistency - Update snapshots to include new tools (get-document-property-value-template, restore-document-from-recycle-bin) - Preserve all original test structure, comments, and console.log statements - All 111 document tests passing with 88 snapshots 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]> * Rename create-blog-post eval test to create-document-copy - Rename test files from create-blog-post to create-document-copy - Update package.json script name to eval-mcp:create-document-copy - Better reflects the actual functionality being tested 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]> * Return created IDs from create-data-type, create-document-type, and create-element-type - Add client-side UUID generation for create-data-type - Use returnFullResponse to check status codes - Return structured JSON: {message, id} on success (201) - Return error details: {message, status, error} on failure - Update all integration tests to handle new response format - Extract IDs for proper snapshot normalization - All 9 tests passing with 16 valid snapshots - Add implementation and testing plan documents 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]> * Fix property container validation and group deduplication bugs This commit fixes two critical bugs in document/element type creation: 1. Properties without tab/group validation: - Added Zod .refine() validation requiring properties to specify either 'tab' OR 'group' - Properties without containers are invisible in Umbraco UI - Updated tool descriptions to reflect mandatory container requirement 2. Group deduplication bug: - Implemented composite key pattern (tab::group) in create-container-hierarchy - Allows same group name in different tabs without conflicts - Groups without tabs use 'NO_TAB::groupName' pattern - Composite keys are internal only - Umbraco receives normal group names with UUID references Changes: - create-document-type.ts: Added validation, explicit parsing, composite key lookups - create-element-type.ts: Same validation and composite key implementation - create-container-hierarchy.ts: Refactored to use Map with composite keys - document-type-test-helper.ts: Added getFullDocumentType and normaliseFullDocumentType - create-container-hierarchy.test.ts: Updated tests to use composite key lookups - create-document-type.test.ts: Added validation test and separate groups test - create-element-type.test.ts: Added validation test and separate groups test All 108 tests passing across 24 test suites. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]> * Fix npm audit security vulnerabilities Updated package-lock.json to address security issues. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]> --------- Co-authored-by: Phil Whittaker <[email protected]> Co-authored-by: Claude <[email protected]> * Simplify README and direct users to official documentation (#44) * Simplify README and fix test snapshots README changes: - Streamlined from 850+ lines to ~70 lines - Replaced detailed multi-client installation with simple Claude Desktop quick start - Added prominent link to official Umbraco MCP documentation - Retained contributing section with rulesync instructions - Removed extensive tool listings, configuration details, and version compatibility info Test fixes: - Updated snapshots for data-type, document, and indexer tests - Fixed test files for indexer tools - Updated e2e test configurations All detailed documentation now available at: https://docs.umbraco.com/umbraco-cms/reference/developer-mcp 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]> * Improve README wording and clarity --------- Co-authored-by: Phil Whittaker <[email protected]> Co-authored-by: Claude <[email protected]> * Release version 16.0.0 Remove beta tag from installation instructions and bump package version to 16.0.0 for stable release. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]> --------- Co-authored-by: Phil Whittaker <[email protected]> Co-authored-by: Claude <[email protected]>
1 parent 347c701 commit 613e027

File tree

108 files changed

+4148
-1893
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

108 files changed

+4148
-1893
lines changed
Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
# Schema Flattening Rule for CLAUDE.md
2+
3+
> **Copy this section into `/Users/philw/Projects/umbraco-mcp/CLAUDE.md`**
4+
5+
---
6+
7+
## MCP Tool Schema Design: Flatten Nested Parent Objects
8+
9+
### Problem
10+
LLMs stringify nested `parent` objects, breaking API validation:
11+
12+
```typescript
13+
// ❌ LLM Bug: Stringifies nested objects
14+
{ "name": "Item", "parent": "{\"id\": \"uuid\"}" }
15+
{ "name": "File.js", "parent": "{\"path\": \"/Scripts\"}" }
16+
17+
// ✅ Expected by API
18+
{ "name": "Item", "parent": { "id": "uuid" } }
19+
{ "name": "File.js", "parent": { "path": "/Scripts" } }
20+
```
21+
22+
### Solution: Flatten parent parameters
23+
24+
**Path-based (files):**
25+
```typescript
26+
// ✅ Flat path parameter
27+
const schema = z.object({
28+
name: z.string(),
29+
path: z.string().optional() // NOT parent: { path }
30+
});
31+
32+
// Transform for API
33+
const payload = {
34+
name: model.name,
35+
parent: model.path ? { path: model.path } : undefined
36+
};
37+
```
38+
39+
**ID-based (content):**
40+
```typescript
41+
// ✅ Flat parentId parameter
42+
const schema = z.object({
43+
name: z.string(),
44+
parentId: z.string().uuid().optional() // NOT parent: { id }
45+
});
46+
47+
// Transform for API
48+
const payload = {
49+
name: model.name,
50+
parent: model.parentId ? { id: model.parentId } : undefined
51+
};
52+
```
53+
54+
### When to Apply
55+
**✅ ALWAYS flatten for high-frequency content:**
56+
- **Path-based**: Scripts, Partial Views, Stylesheets
57+
- **ID-based**: Documents, Media, Dictionary, Data Types, Document Types, Document Blueprints
58+
59+
**❌ NOT needed for:**
60+
- Folder creation tools (administrative, infrequent)
61+
- Type definitions (schema setup)
62+
63+
### Testing Requirement
64+
**ALWAYS test with parent parameter** to catch stringification bugs:
65+
66+
```typescript
67+
it("should create item with parent", async () => {
68+
const result = await CreateTool().handler({
69+
name: "Child",
70+
parentId: parentId // or path: "/folder"
71+
}, { signal: new AbortController().signal });
72+
expect(result).toMatchSnapshot();
73+
});
74+
```
75+
76+
### Reference Implementations
77+
- **Path-based**: `script/post/create-script.ts`, `partial-view/post/create-partial-view.ts`
78+
- **ID-based**: `document/post/create-document.ts`, `dictionary/post/create-dictionary.ts`
79+
80+
### Quick Checklist
81+
- [ ] Schema uses flat `path` or `parentId` (NOT nested `parent` object)
82+
- [ ] Handler transforms flat param → `parent: { path/id }` for API
83+
- [ ] Test exists for parent/folder scenario
84+
- [ ] Tool description documents the parent parameter
85+
86+
---
87+
88+
**Why:** LLMs treat paths/IDs as simple parameters, not nested objects. Flattening prevents JSON stringification bugs in high-frequency workflows.

0 commit comments

Comments
 (0)