@elementor/elementor-kit-mcp 4.2.0-841 → 4.2.0-843
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +53 -25
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +53 -25
- package/dist/index.mjs.map +1 -1
- package/package.json +4 -4
- package/src/elementor-kit-mcp-server.ts +14 -26
- package/src/mcp-description-resource.ts +42 -0
package/dist/index.js
CHANGED
|
@@ -29,6 +29,48 @@ module.exports = __toCommonJS(index_exports);
|
|
|
29
29
|
var import_editor_mcp = require("@elementor/editor-mcp");
|
|
30
30
|
var import_elementor_mcp_common = require("@elementor/elementor-mcp-common");
|
|
31
31
|
var import_schema = require("@elementor/schema");
|
|
32
|
+
|
|
33
|
+
// src/mcp-description-resource.ts
|
|
34
|
+
var KIT_DESCRIPTION_URI = "elementor://kit/server-description";
|
|
35
|
+
var KIT_DESCRIPTION = `## Elementor Kit Settings Management
|
|
36
|
+
|
|
37
|
+
### Capabilities:
|
|
38
|
+
**Global Design System:**
|
|
39
|
+
- Create, update, name, and delete global colors (both system and custom)
|
|
40
|
+
- Create, update, name, and delete global fonts (both system and custom)
|
|
41
|
+
|
|
42
|
+
**Site Identity:**
|
|
43
|
+
- Insert site logo
|
|
44
|
+
- Set site favicon
|
|
45
|
+
- Update site name
|
|
46
|
+
- Modify site description
|
|
47
|
+
|
|
48
|
+
### Limitations:
|
|
49
|
+
**Theme Style Settings:**
|
|
50
|
+
- Cannot set or update Elementor Theme Style settings including typography, buttons, images, form fields, Hello Theme header, or Hello Theme footer that affect the entire website appearance
|
|
51
|
+
|
|
52
|
+
**Site-Wide Settings:**
|
|
53
|
+
- Cannot set site-wide background (color or image)
|
|
54
|
+
- Cannot configure mobile browser background
|
|
55
|
+
- Cannot modify global layout settings such as content width, container padding, and widget gaps (the default space between widgets)
|
|
56
|
+
|
|
57
|
+
**Note**: Angie can adjust all of these layout properties at the container or page level - just not site-wide.`;
|
|
58
|
+
function addKitDescriptionResource(server) {
|
|
59
|
+
server.registerResource(
|
|
60
|
+
"elementor-kit-server-description",
|
|
61
|
+
KIT_DESCRIPTION_URI,
|
|
62
|
+
{
|
|
63
|
+
title: "Elementor Kit Server Description",
|
|
64
|
+
description: "Elementor Kit capabilities and limitations",
|
|
65
|
+
mimeType: "text/plain"
|
|
66
|
+
},
|
|
67
|
+
async (uri) => ({
|
|
68
|
+
contents: [{ uri: uri.href, mimeType: "text/plain", text: KIT_DESCRIPTION }]
|
|
69
|
+
})
|
|
70
|
+
);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
// src/elementor-kit-mcp-server.ts
|
|
32
74
|
var RESOURCE_NAME_KIT_FONTS = "elementor-kit-fonts";
|
|
33
75
|
var RESOURCE_URI_KIT_FONTS = "elementor://kit/fonts";
|
|
34
76
|
var RESOURCE_NAME_KIT_SCHEMA = "elementor-kit-schema";
|
|
@@ -122,29 +164,6 @@ var customTypographySchema = import_schema.z.array(customTypographyItemSchema);
|
|
|
122
164
|
var generalPatchSchema = import_schema.z.record(import_schema.z.unknown()).describe(
|
|
123
165
|
"General patch object for any other Elementor kit settings like spacing, buttons, forms, layout settings, etc."
|
|
124
166
|
);
|
|
125
|
-
var SERVER_INSTRUCTIONS = `## Elementor Kit Settings Management
|
|
126
|
-
|
|
127
|
-
### Capabilities:
|
|
128
|
-
**Global Design System:**
|
|
129
|
-
- Create, update, name, and delete global colors (both system and custom)
|
|
130
|
-
- Create, update, name, and delete global fonts (both system and custom)
|
|
131
|
-
|
|
132
|
-
**Site Identity:**
|
|
133
|
-
- Insert site logo
|
|
134
|
-
- Set site favicon
|
|
135
|
-
- Update site name
|
|
136
|
-
- Modify site description
|
|
137
|
-
|
|
138
|
-
### Limitations:
|
|
139
|
-
**Theme Style Settings:**
|
|
140
|
-
- Cannot set or update Elementor Theme Style settings including typography, buttons, images, form fields, Hello Theme header, or Hello Theme footer that affect the entire website appearance
|
|
141
|
-
|
|
142
|
-
**Site-Wide Settings:**
|
|
143
|
-
- Cannot set site-wide background (color or image)
|
|
144
|
-
- Cannot configure mobile browser background
|
|
145
|
-
- Cannot modify global layout settings such as content width, container padding, and widget gaps (the default space between widgets)
|
|
146
|
-
|
|
147
|
-
**Note**: Angie can adjust all of these layout properties at the container or page level - just not site-wide.`;
|
|
148
167
|
async function createElementorKitServer() {
|
|
149
168
|
await (0, import_elementor_mcp_common.waitForElementorEditor)();
|
|
150
169
|
const server = new import_editor_mcp.McpServer(
|
|
@@ -154,7 +173,7 @@ async function createElementorKitServer() {
|
|
|
154
173
|
title: "Elementor Kit"
|
|
155
174
|
},
|
|
156
175
|
{
|
|
157
|
-
instructions:
|
|
176
|
+
instructions: "Manages Elementor global design system: colors, typography, and site identity.",
|
|
158
177
|
capabilities: {
|
|
159
178
|
resources: {
|
|
160
179
|
subscribe: true
|
|
@@ -162,6 +181,7 @@ async function createElementorKitServer() {
|
|
|
162
181
|
}
|
|
163
182
|
}
|
|
164
183
|
);
|
|
184
|
+
addKitDescriptionResource(server);
|
|
165
185
|
const getAvailableTabs = async () => {
|
|
166
186
|
const kitSchema = await fetchKitSchema();
|
|
167
187
|
return Object.keys(kitSchema.data || {});
|
|
@@ -280,6 +300,14 @@ The tool will permanently update the site's global design settings and return a
|
|
|
280
300
|
annotations: {
|
|
281
301
|
title: "Update Elementor Kit Settings",
|
|
282
302
|
destructiveHint: true
|
|
303
|
+
},
|
|
304
|
+
_meta: {
|
|
305
|
+
"angie/requiredResources": [
|
|
306
|
+
{
|
|
307
|
+
uri: KIT_DESCRIPTION_URI,
|
|
308
|
+
whenToUse: "Read first for kit capabilities and limitations"
|
|
309
|
+
}
|
|
310
|
+
]
|
|
283
311
|
}
|
|
284
312
|
},
|
|
285
313
|
async ({
|
|
@@ -332,7 +360,7 @@ The tool will permanently update the site's global design settings and return a
|
|
|
332
360
|
sdk.registerLocalServer({
|
|
333
361
|
server,
|
|
334
362
|
version: VERSION,
|
|
335
|
-
description:
|
|
363
|
+
description: KIT_DESCRIPTION,
|
|
336
364
|
name: "elementor-kit-server"
|
|
337
365
|
});
|
|
338
366
|
return server;
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts","../src/elementor-kit-mcp-server.ts","../src/init.ts"],"sourcesContent":["export { createElementorKitServer } from './elementor-kit-mcp-server';\nexport { init } from './init';\n","import { getAngieSdk, McpServer, ResourceTemplate } from '@elementor/editor-mcp';\nimport { callWpApi, requireConfirmationMessage, waitForElementorEditor } from '@elementor/elementor-mcp-common';\nimport { z } from '@elementor/schema';\n\nconst RESOURCE_NAME_KIT_FONTS = 'elementor-kit-fonts';\nconst RESOURCE_URI_KIT_FONTS = 'elementor://kit/fonts';\nconst RESOURCE_NAME_KIT_SCHEMA = 'elementor-kit-schema';\nconst RESOURCE_URI_KIT_SCHEMA_TEMPLATE = 'elementor://kit/schema/{tab}';\nconst RESOURCE_NAME_KIT_SETTINGS = 'elementor-kit-settings';\nconst RESOURCE_URI_KIT_SETTINGS = 'elementor://kit/settings';\n\ntype KitFontsResponse = {\n\tfonts: Record< string, unknown >;\n};\n\ntype KitSchemaResponse = Record< string, unknown >;\n\nconst VERSION = '2.0.0';\nasync function fetchKitFonts() {\n\treturn callWpApi< KitFontsResponse >( `/angie/v1/elementor-kit/fonts`, 'GET' );\n}\n\nasync function fetchKitSchema() {\n\treturn callWpApi< KitSchemaResponse >( `/angie/v1/elementor-kit/schema`, 'GET' );\n}\n\nasync function fetchKitSettings() {\n\treturn callWpApi( `/angie/v1/elementor-kit`, 'GET' );\n}\n\ntype TypographyItem = {\n\ttypography_font_family?: string;\n};\n\nasync function validateFonts(\n\tsystemTypography: TypographyItem[] | null | undefined,\n\tcustomTypography: TypographyItem[] | null | undefined\n) {\n\tconst fontsResponse = await fetchKitFonts();\n\tconst availableFonts = Object.keys( fontsResponse.data.fonts || {} );\n\tconst invalidFonts: string[] = [];\n\n\t[ systemTypography, customTypography ].forEach( ( typography ) => {\n\t\tif ( typography ) {\n\t\t\ttypography.forEach( ( item ) => {\n\t\t\t\tif ( item.typography_font_family && ! availableFonts.includes( item.typography_font_family ) ) {\n\t\t\t\t\tinvalidFonts.push( item.typography_font_family );\n\t\t\t\t}\n\t\t\t} );\n\t\t}\n\t} );\n\n\tif ( invalidFonts.length > 0 ) {\n\t\treturn `Please use available fonts only. Invalid fonts: ${ invalidFonts.join(\n\t\t\t', '\n\t\t) }. Available fonts: ${ availableFonts.join( ', ' ) }`;\n\t}\n\n\treturn '';\n}\n\nfunction sanitizeMediaFields( obj: Record< string, unknown > ): Record< string, unknown > {\n\tconst mediaFields = [ 'site_logo', 'site_icon' ];\n\tconst sanitized = { ...obj };\n\n\tfor ( const field of mediaFields ) {\n\t\tif ( field in sanitized && sanitized[ field ] === '' ) {\n\t\t\tsanitized[ field ] = 0;\n\t\t}\n\t}\n\n\treturn sanitized;\n}\n\nconst baseColorSchema = z.object( {\n\ttitle: z.string(),\n\tcolor: z.string(),\n} );\n\nconst baseTypographySchema = z\n\t.object( {\n\t\ttitle: z.string(),\n\t\ttypography_typography: z.string(),\n\t\ttypography_font_family: z\n\t\t\t.string()\n\t\t\t.describe(\n\t\t\t\t'Font family name that must be from the available Elementor fonts list. Use the get-fonts endpoint (/angie/v1/elementor-kit/fonts) to get the complete list of available fonts. Only use fonts that exist in this list to avoid validation errors.'\n\t\t\t),\n\t\ttypography_font_weight: z.string(),\n\t\ttypography_font_size: z\n\t\t\t.object( {\n\t\t\t\tunit: z.string(),\n\t\t\t\tsize: z.number(),\n\t\t\t} )\n\t\t\t.optional(),\n\t\ttypography_font_size_tablet: z\n\t\t\t.object( {\n\t\t\t\tunit: z.string(),\n\t\t\t\tsize: z.number(),\n\t\t\t} )\n\t\t\t.optional(),\n\t\ttypography_font_size_mobile: z\n\t\t\t.object( {\n\t\t\t\tunit: z.string(),\n\t\t\t\tsize: z.number(),\n\t\t\t} )\n\t\t\t.optional(),\n\t\ttypography_line_height: z\n\t\t\t.object( {\n\t\t\t\tunit: z.string(),\n\t\t\t\tsize: z.number(),\n\t\t\t} )\n\t\t\t.optional(),\n\t} )\n\t.passthrough();\n\nconst systemColorItemSchema = baseColorSchema.extend( {\n\t_id: z.enum( [ 'primary', 'secondary', 'text', 'accent' ] ),\n} );\n\nconst systemTypographyItemSchema = baseTypographySchema.extend( {\n\t_id: z.enum( [ 'primary', 'secondary', 'text', 'accent' ] ),\n} );\n\nconst customColorItemSchema = baseColorSchema.extend( {\n\t_id: z.string(),\n} );\n\nconst customTypographyItemSchema = baseTypographySchema.extend( {\n\t_id: z.string(),\n} );\n\nconst systemColorsSchema = z.array( systemColorItemSchema ).length( 4 );\nconst systemTypographySchema = z.array( systemTypographyItemSchema ).length( 4 );\nconst customColorsSchema = z.array( customColorItemSchema );\nconst customTypographySchema = z.array( customTypographyItemSchema );\n\nconst generalPatchSchema = z\n\t.record( z.unknown() )\n\t.describe(\n\t\t'General patch object for any other Elementor kit settings like spacing, buttons, forms, layout settings, etc.'\n\t);\n\nconst SERVER_INSTRUCTIONS = `## Elementor Kit Settings Management\n\n### Capabilities:\n**Global Design System:**\n- Create, update, name, and delete global colors (both system and custom)\n- Create, update, name, and delete global fonts (both system and custom)\n\n**Site Identity:**\n- Insert site logo\n- Set site favicon\n- Update site name\n- Modify site description\n\n### Limitations:\n**Theme Style Settings:**\n- Cannot set or update Elementor Theme Style settings including typography, buttons, images, form fields, Hello Theme header, or Hello Theme footer that affect the entire website appearance\n\n**Site-Wide Settings:**\n- Cannot set site-wide background (color or image)\n- Cannot configure mobile browser background\n- Cannot modify global layout settings such as content width, container padding, and widget gaps (the default space between widgets)\n\n**Note**: Angie can adjust all of these layout properties at the container or page level - just not site-wide.`;\n\nexport async function createElementorKitServer(): Promise< McpServer > {\n\tawait waitForElementorEditor();\n\tconst server = new McpServer(\n\t\t{\n\t\t\tname: 'elementor-kit-server',\n\t\t\tversion: VERSION,\n\t\t\ttitle: 'Elementor Kit',\n\t\t},\n\t\t{\n\t\t\tinstructions: SERVER_INSTRUCTIONS,\n\t\t\tcapabilities: {\n\t\t\t\tresources: {\n\t\t\t\t\tsubscribe: true,\n\t\t\t\t},\n\t\t\t},\n\t\t}\n\t);\n\n\tconst getAvailableTabs = async (): Promise< string[] > => {\n\t\tconst kitSchema = await fetchKitSchema();\n\t\treturn Object.keys( kitSchema.data || {} );\n\t};\n\n\tserver.registerResource(\n\t\tRESOURCE_NAME_KIT_FONTS,\n\t\tRESOURCE_URI_KIT_FONTS,\n\t\t{\n\t\t\ttitle: 'Elementor Kit Available Fonts',\n\t\t\tdescription:\n\t\t\t\t'Complete list of all available font families that can be used in Elementor, including system fonts, Google fonts, and custom uploaded fonts',\n\t\t},\n\t\tasync ( uri ) => {\n\t\t\tconst fontsResponse = await fetchKitFonts();\n\t\t\treturn {\n\t\t\t\tcontents: [\n\t\t\t\t\t{\n\t\t\t\t\t\turi: uri.href,\n\t\t\t\t\t\tmimeType: 'application/json',\n\t\t\t\t\t\ttext: JSON.stringify( fontsResponse, null, 2 ),\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t};\n\t\t}\n\t);\n\n\tserver.registerResource(\n\t\tRESOURCE_NAME_KIT_SETTINGS,\n\t\tRESOURCE_URI_KIT_SETTINGS,\n\t\t{\n\t\t\ttitle: 'Elementor Kit Current Settings',\n\t\t\tdescription:\n\t\t\t\t'Complete current Elementor global kit configuration including all system and custom colors, typography settings, spacing, buttons, forms, and other site-wide design settings',\n\t\t},\n\t\tasync ( uri ) => {\n\t\t\tconst currentSettings = await fetchKitSettings();\n\t\t\treturn {\n\t\t\t\tcontents: [\n\t\t\t\t\t{\n\t\t\t\t\t\turi: uri.href,\n\t\t\t\t\t\tmimeType: 'application/json',\n\t\t\t\t\t\ttext: JSON.stringify( currentSettings, null, 2 ),\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t};\n\t\t}\n\t);\n\n\tconst availableTabs = await getAvailableTabs();\n\n\tserver.registerResource(\n\t\tRESOURCE_NAME_KIT_SCHEMA,\n\t\tnew ResourceTemplate( RESOURCE_URI_KIT_SCHEMA_TEMPLATE, {\n\t\t\tlist: async () => {\n\t\t\t\treturn {\n\t\t\t\t\tresources: availableTabs.map( ( tab ) => {\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\turi: `elementor://kit/schema/${ tab }`,\n\t\t\t\t\t\t\tname: `${ RESOURCE_NAME_KIT_SCHEMA }-${ tab }`,\n\t\t\t\t\t\t\ttitle: `Elementor Kit Schema - ${ tab }`,\n\t\t\t\t\t\t\tdescription: `Schema definition for Elementor kit ${ tab } settings tab`,\n\t\t\t\t\t\t\tmimeType: 'application/json',\n\t\t\t\t\t\t};\n\t\t\t\t\t} ),\n\t\t\t\t};\n\t\t\t},\n\t\t} ),\n\t\t{\n\t\t\ttitle: 'Elementor Kit Schema',\n\t\t\tdescription:\n\t\t\t\t'Complete schema definition for a specific Elementor kit settings tab, showing all available fields, their types, valid values, and configuration options',\n\t\t},\n\t\tasync ( uri, variables ) => {\n\t\t\tconst tab = Array.isArray( variables.tab ) ? variables.tab[ 0 ] : variables.tab;\n\n\t\t\tif ( ! tab ) {\n\t\t\t\tthrow new Error( 'Tab parameter is required' );\n\t\t\t}\n\n\t\t\tconst kitSchema = await fetchKitSchema();\n\t\t\tconst tabSchema = kitSchema.data?.[ tab ];\n\n\t\t\tif ( ! tabSchema ) {\n\t\t\t\tthrow new Error(\n\t\t\t\t\t`No schema found for tab '${ tab }'. Available tabs: ${ Object.keys( kitSchema.data ).join(\n\t\t\t\t\t\t', '\n\t\t\t\t\t) }`\n\t\t\t\t);\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\tcontents: [\n\t\t\t\t\t{\n\t\t\t\t\t\turi: uri.toString(),\n\t\t\t\t\t\tmimeType: 'application/json',\n\t\t\t\t\t\ttext: JSON.stringify( tabSchema, null, 2 ),\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t};\n\t\t}\n\t);\n\n\tserver.registerTool(\n\t\t'update-elementor-kit-settings-colors-and-fonts',\n\t\t{\n\t\t\tdescription: `This tool applies configuration changes to Elementor global kit settings that control site-wide design elements. Use this when you need to modify global colors, typography, spacing, buttons, form fields, or other theme-wide settings that affect the entire website appearance.\n\nThe tool will permanently update the site's global design settings and return a success confirmation with the updated configuration data.`,\n\t\t\tinputSchema: {\n\t\t\t\tsystemColors: systemColorsSchema\n\t\t\t\t\t.optional()\n\t\t\t\t\t.nullable()\n\t\t\t\t\t.describe(\n\t\t\t\t\t\t'System colors array with exactly 4 items having IDs: primary, secondary, text, accent'\n\t\t\t\t\t),\n\t\t\t\tsystemTypography: systemTypographySchema\n\t\t\t\t\t.optional()\n\t\t\t\t\t.nullable()\n\t\t\t\t\t.describe(\n\t\t\t\t\t\t'System typography array with exactly 4 items having IDs: primary, secondary, text, accent'\n\t\t\t\t\t),\n\t\t\t\tcustomColors: customColorsSchema\n\t\t\t\t\t.optional()\n\t\t\t\t\t.nullable()\n\t\t\t\t\t.describe( 'Custom colors array - flexible structure for additional color definitions' ),\n\t\t\t\tcustomTypography: customTypographySchema\n\t\t\t\t\t.optional()\n\t\t\t\t\t.nullable()\n\t\t\t\t\t.describe(\n\t\t\t\t\t\t'Custom typography array - flexible structure for additional font definitions (no color field needed)'\n\t\t\t\t\t),\n\t\t\t\tpatchObject: generalPatchSchema\n\t\t\t\t\t.optional()\n\t\t\t\t\t.nullable()\n\t\t\t\t\t.describe(\n\t\t\t\t\t\t'General patch object for any other Elementor kit settings like spacing, buttons, forms, layout settings, etc.'\n\t\t\t\t\t),\n\t\t\t\tconfirmationMessage: z\n\t\t\t\t\t.string()\n\t\t\t\t\t.describe(\n\t\t\t\t\t\t'REQUIRED: Provide a clear explanation in **markdown format** of what Elementor kit settings will be changed and their potential impact on the site\\'s global design. This message will be shown to the user before proceeding. Be specific about which design elements are being modified (colors, typography, spacing, etc.) and how they will affect the entire website. Examples: \"You\\'re about to update the global **primary color** from `blue` to `green`. This will change **buttons**, **links**, and **accent colors** throughout your entire site.\" or \"You\\'re about to change the **primary font** from `Roboto` to `Open Sans`. This will affect **headings** across all pages.\"'\n\t\t\t\t\t),\n\t\t\t},\n\t\t\tannotations: {\n\t\t\t\ttitle: 'Update Elementor Kit Settings',\n\t\t\t\tdestructiveHint: true,\n\t\t\t},\n\t\t},\n\t\tasync ( {\n\t\t\tsystemColors,\n\t\t\tsystemTypography,\n\t\t\tcustomColors,\n\t\t\tcustomTypography,\n\t\t\tpatchObject,\n\t\t\tconfirmationMessage,\n\t\t} ) => {\n\t\t\trequireConfirmationMessage( confirmationMessage, 'Elementor kit settings' );\n\n\t\t\tconst invalidFonts = await validateFonts( systemTypography, customTypography );\n\t\t\tif ( invalidFonts ) {\n\t\t\t\tthrow new Error( invalidFonts );\n\t\t\t}\n\n\t\t\tconst completePatchObject = {\n\t\t\t\t...( systemColors && { system_colors: systemColors } ),\n\t\t\t\t...( systemTypography && { system_typography: systemTypography } ),\n\t\t\t\t...( customColors && { custom_colors: customColors } ),\n\t\t\t\t...( customTypography && { custom_typography: customTypography } ),\n\t\t\t\t...sanitizeMediaFields( patchObject || {} ),\n\t\t\t};\n\n\t\t\tif ( Object.keys( completePatchObject ).length === 0 ) {\n\t\t\t\tthrow new Error(\n\t\t\t\t\t'At least one update must be provided (systemColors, systemTypography, customColors, customTypography, or patchObject)'\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tconst response = await callWpApi( `/angie/v1/elementor-kit`, 'POST', completePatchObject );\n\n\t\t\treturn {\n\t\t\t\tcontent: [\n\t\t\t\t\t{\n\t\t\t\t\t\ttype: 'text' as const,\n\t\t\t\t\t\ttext: JSON.stringify(\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tsuccess: true,\n\t\t\t\t\t\t\t\tmessage: 'Settings updated successfully',\n\t\t\t\t\t\t\t\tdata: response,\n\t\t\t\t\t\t\t\tappliedSettings: completePatchObject,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tnull,\n\t\t\t\t\t\t\t2\n\t\t\t\t\t\t),\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t};\n\t\t}\n\t);\n\n\tconst sdk = getAngieSdk();\n\tawait sdk.waitForReady();\n\tsdk.registerLocalServer( {\n\t\tserver,\n\t\tversion: VERSION,\n\t\tdescription: SERVER_INSTRUCTIONS,\n\t\tname: 'elementor-kit-server',\n\t} );\n\treturn server;\n}\n","import { createElementorKitServer } from './elementor-kit-mcp-server';\n\nexport function init() {\n\tcreateElementorKitServer();\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,wBAAyD;AACzD,kCAA8E;AAC9E,oBAAkB;AAElB,IAAM,0BAA0B;AAChC,IAAM,yBAAyB;AAC/B,IAAM,2BAA2B;AACjC,IAAM,mCAAmC;AACzC,IAAM,6BAA6B;AACnC,IAAM,4BAA4B;AAQlC,IAAM,UAAU;AAChB,eAAe,gBAAgB;AAC9B,aAAO,uCAA+B,iCAAiC,KAAM;AAC9E;AAEA,eAAe,iBAAiB;AAC/B,aAAO,uCAAgC,kCAAkC,KAAM;AAChF;AAEA,eAAe,mBAAmB;AACjC,aAAO,uCAAW,2BAA2B,KAAM;AACpD;AAMA,eAAe,cACd,kBACA,kBACC;AACD,QAAM,gBAAgB,MAAM,cAAc;AAC1C,QAAM,iBAAiB,OAAO,KAAM,cAAc,KAAK,SAAS,CAAC,CAAE;AACnE,QAAM,eAAyB,CAAC;AAEhC,GAAE,kBAAkB,gBAAiB,EAAE,QAAS,CAAE,eAAgB;AACjE,QAAK,YAAa;AACjB,iBAAW,QAAS,CAAE,SAAU;AAC/B,YAAK,KAAK,0BAA0B,CAAE,eAAe,SAAU,KAAK,sBAAuB,GAAI;AAC9F,uBAAa,KAAM,KAAK,sBAAuB;AAAA,QAChD;AAAA,MACD,CAAE;AAAA,IACH;AAAA,EACD,CAAE;AAEF,MAAK,aAAa,SAAS,GAAI;AAC9B,WAAO,mDAAoD,aAAa;AAAA,MACvE;AAAA,IACD,CAAE,sBAAuB,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nD,GAAK,oBAAoB,EAAE,mBAAmB,iBAAiB;AAAA,QAC/D,GAAK,gBAAgB,EAAE,eAAe,aAAa;AAAA,QACnD,GAAK,oBAAoB,EAAE,mBAAmB,iBAAiB;AAAA,QAC/D,GAAG,oBAAqB,eAAe,CAAC,CAAE;AAAA,MAC3C;AAEA,UAAK,OAAO,KAAM,mBAAoB,EAAE,WAAW,GAAI;AACtD,cAAM,IAAI;AAAA,UACT;AAAA,QACD;AAAA,MACD;AAEA,YAAM,WAAW,UAAM,uCAAW,2BAA2B,QAAQ,mBAAoB;AAEzF,aAAO;AAAA,QACN,SAAS;AAAA,UACR;AAAA,YACC,MAAM;AAAA,YACN,MAAM,KAAK;AAAA,cACV;AAAA,gBACC,SAAS;AAAA,gBACT,SAAS;AAAA,gBACT,MAAM;AAAA,gBACN,iBAAiB;AAAA,cAClB;AAAA,cACA;AAAA,cACA;AAAA,YACD;AAAA,UACD;AAAA,QACD;AAAA,MACD;AAAA,IACD;AAAA,EACD;AAEA,QAAM,UAAM,+BAAY;AACxB,QAAM,IAAI,aAAa;AACvB,MAAI,oBAAqB;AAAA,IACxB;AAAA,IACA,SAAS;AAAA,IACT,aAAa;AAAA,IACb,MAAM;AAAA,EACP,CAAE;AACF,SAAO;AACR;;;ACxYO,SAAS,OAAO;AACtB,2BAAyB;AAC1B;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../src/index.ts","../src/elementor-kit-mcp-server.ts","../src/mcp-description-resource.ts","../src/init.ts"],"sourcesContent":["export { createElementorKitServer } from './elementor-kit-mcp-server';\nexport { init } from './init';\n","import { getAngieSdk, McpServer, ResourceTemplate } from '@elementor/editor-mcp';\nimport { callWpApi, requireConfirmationMessage, waitForElementorEditor } from '@elementor/elementor-mcp-common';\nimport { z } from '@elementor/schema';\n\nimport { addKitDescriptionResource, KIT_DESCRIPTION, KIT_DESCRIPTION_URI } from './mcp-description-resource';\n\nconst RESOURCE_NAME_KIT_FONTS = 'elementor-kit-fonts';\nconst RESOURCE_URI_KIT_FONTS = 'elementor://kit/fonts';\nconst RESOURCE_NAME_KIT_SCHEMA = 'elementor-kit-schema';\nconst RESOURCE_URI_KIT_SCHEMA_TEMPLATE = 'elementor://kit/schema/{tab}';\nconst RESOURCE_NAME_KIT_SETTINGS = 'elementor-kit-settings';\nconst RESOURCE_URI_KIT_SETTINGS = 'elementor://kit/settings';\n\ntype KitFontsResponse = {\n\tfonts: Record< string, unknown >;\n};\n\ntype KitSchemaResponse = Record< string, unknown >;\n\nconst VERSION = '2.0.0';\nasync function fetchKitFonts() {\n\treturn callWpApi< KitFontsResponse >( `/angie/v1/elementor-kit/fonts`, 'GET' );\n}\n\nasync function fetchKitSchema() {\n\treturn callWpApi< KitSchemaResponse >( `/angie/v1/elementor-kit/schema`, 'GET' );\n}\n\nasync function fetchKitSettings() {\n\treturn callWpApi( `/angie/v1/elementor-kit`, 'GET' );\n}\n\ntype TypographyItem = {\n\ttypography_font_family?: string;\n};\n\nasync function validateFonts(\n\tsystemTypography: TypographyItem[] | null | undefined,\n\tcustomTypography: TypographyItem[] | null | undefined\n) {\n\tconst fontsResponse = await fetchKitFonts();\n\tconst availableFonts = Object.keys( fontsResponse.data.fonts || {} );\n\tconst invalidFonts: string[] = [];\n\n\t[ systemTypography, customTypography ].forEach( ( typography ) => {\n\t\tif ( typography ) {\n\t\t\ttypography.forEach( ( item ) => {\n\t\t\t\tif ( item.typography_font_family && ! availableFonts.includes( item.typography_font_family ) ) {\n\t\t\t\t\tinvalidFonts.push( item.typography_font_family );\n\t\t\t\t}\n\t\t\t} );\n\t\t}\n\t} );\n\n\tif ( invalidFonts.length > 0 ) {\n\t\treturn `Please use available fonts only. Invalid fonts: ${ invalidFonts.join(\n\t\t\t', '\n\t\t) }. Available fonts: ${ availableFonts.join( ', ' ) }`;\n\t}\n\n\treturn '';\n}\n\nfunction sanitizeMediaFields( obj: Record< string, unknown > ): Record< string, unknown > {\n\tconst mediaFields = [ 'site_logo', 'site_icon' ];\n\tconst sanitized = { ...obj };\n\n\tfor ( const field of mediaFields ) {\n\t\tif ( field in sanitized && sanitized[ field ] === '' ) {\n\t\t\tsanitized[ field ] = 0;\n\t\t}\n\t}\n\n\treturn sanitized;\n}\n\nconst baseColorSchema = z.object( {\n\ttitle: z.string(),\n\tcolor: z.string(),\n} );\n\nconst baseTypographySchema = z\n\t.object( {\n\t\ttitle: z.string(),\n\t\ttypography_typography: z.string(),\n\t\ttypography_font_family: z\n\t\t\t.string()\n\t\t\t.describe(\n\t\t\t\t'Font family name that must be from the available Elementor fonts list. Use the get-fonts endpoint (/angie/v1/elementor-kit/fonts) to get the complete list of available fonts. Only use fonts that exist in this list to avoid validation errors.'\n\t\t\t),\n\t\ttypography_font_weight: z.string(),\n\t\ttypography_font_size: z\n\t\t\t.object( {\n\t\t\t\tunit: z.string(),\n\t\t\t\tsize: z.number(),\n\t\t\t} )\n\t\t\t.optional(),\n\t\ttypography_font_size_tablet: z\n\t\t\t.object( {\n\t\t\t\tunit: z.string(),\n\t\t\t\tsize: z.number(),\n\t\t\t} )\n\t\t\t.optional(),\n\t\ttypography_font_size_mobile: z\n\t\t\t.object( {\n\t\t\t\tunit: z.string(),\n\t\t\t\tsize: z.number(),\n\t\t\t} )\n\t\t\t.optional(),\n\t\ttypography_line_height: z\n\t\t\t.object( {\n\t\t\t\tunit: z.string(),\n\t\t\t\tsize: z.number(),\n\t\t\t} )\n\t\t\t.optional(),\n\t} )\n\t.passthrough();\n\nconst systemColorItemSchema = baseColorSchema.extend( {\n\t_id: z.enum( [ 'primary', 'secondary', 'text', 'accent' ] ),\n} );\n\nconst systemTypographyItemSchema = baseTypographySchema.extend( {\n\t_id: z.enum( [ 'primary', 'secondary', 'text', 'accent' ] ),\n} );\n\nconst customColorItemSchema = baseColorSchema.extend( {\n\t_id: z.string(),\n} );\n\nconst customTypographyItemSchema = baseTypographySchema.extend( {\n\t_id: z.string(),\n} );\n\nconst systemColorsSchema = z.array( systemColorItemSchema ).length( 4 );\nconst systemTypographySchema = z.array( systemTypographyItemSchema ).length( 4 );\nconst customColorsSchema = z.array( customColorItemSchema );\nconst customTypographySchema = z.array( customTypographyItemSchema );\n\nconst generalPatchSchema = z\n\t.record( z.unknown() )\n\t.describe(\n\t\t'General patch object for any other Elementor kit settings like spacing, buttons, forms, layout settings, etc.'\n\t);\n\nexport async function createElementorKitServer(): Promise< McpServer > {\n\tawait waitForElementorEditor();\n\tconst server = new McpServer(\n\t\t{\n\t\t\tname: 'elementor-kit-server',\n\t\t\tversion: VERSION,\n\t\t\ttitle: 'Elementor Kit',\n\t\t},\n\t\t{\n\t\t\tinstructions: 'Manages Elementor global design system: colors, typography, and site identity.',\n\t\t\tcapabilities: {\n\t\t\t\tresources: {\n\t\t\t\t\tsubscribe: true,\n\t\t\t\t},\n\t\t\t},\n\t\t}\n\t);\n\n\taddKitDescriptionResource( server );\n\n\tconst getAvailableTabs = async (): Promise< string[] > => {\n\t\tconst kitSchema = await fetchKitSchema();\n\t\treturn Object.keys( kitSchema.data || {} );\n\t};\n\n\tserver.registerResource(\n\t\tRESOURCE_NAME_KIT_FONTS,\n\t\tRESOURCE_URI_KIT_FONTS,\n\t\t{\n\t\t\ttitle: 'Elementor Kit Available Fonts',\n\t\t\tdescription:\n\t\t\t\t'Complete list of all available font families that can be used in Elementor, including system fonts, Google fonts, and custom uploaded fonts',\n\t\t},\n\t\tasync ( uri ) => {\n\t\t\tconst fontsResponse = await fetchKitFonts();\n\t\t\treturn {\n\t\t\t\tcontents: [\n\t\t\t\t\t{\n\t\t\t\t\t\turi: uri.href,\n\t\t\t\t\t\tmimeType: 'application/json',\n\t\t\t\t\t\ttext: JSON.stringify( fontsResponse, null, 2 ),\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t};\n\t\t}\n\t);\n\n\tserver.registerResource(\n\t\tRESOURCE_NAME_KIT_SETTINGS,\n\t\tRESOURCE_URI_KIT_SETTINGS,\n\t\t{\n\t\t\ttitle: 'Elementor Kit Current Settings',\n\t\t\tdescription:\n\t\t\t\t'Complete current Elementor global kit configuration including all system and custom colors, typography settings, spacing, buttons, forms, and other site-wide design settings',\n\t\t},\n\t\tasync ( uri ) => {\n\t\t\tconst currentSettings = await fetchKitSettings();\n\t\t\treturn {\n\t\t\t\tcontents: [\n\t\t\t\t\t{\n\t\t\t\t\t\turi: uri.href,\n\t\t\t\t\t\tmimeType: 'application/json',\n\t\t\t\t\t\ttext: JSON.stringify( currentSettings, null, 2 ),\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t};\n\t\t}\n\t);\n\n\tconst availableTabs = await getAvailableTabs();\n\n\tserver.registerResource(\n\t\tRESOURCE_NAME_KIT_SCHEMA,\n\t\tnew ResourceTemplate( RESOURCE_URI_KIT_SCHEMA_TEMPLATE, {\n\t\t\tlist: async () => {\n\t\t\t\treturn {\n\t\t\t\t\tresources: availableTabs.map( ( tab ) => {\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\turi: `elementor://kit/schema/${ tab }`,\n\t\t\t\t\t\t\tname: `${ RESOURCE_NAME_KIT_SCHEMA }-${ tab }`,\n\t\t\t\t\t\t\ttitle: `Elementor Kit Schema - ${ tab }`,\n\t\t\t\t\t\t\tdescription: `Schema definition for Elementor kit ${ tab } settings tab`,\n\t\t\t\t\t\t\tmimeType: 'application/json',\n\t\t\t\t\t\t};\n\t\t\t\t\t} ),\n\t\t\t\t};\n\t\t\t},\n\t\t} ),\n\t\t{\n\t\t\ttitle: 'Elementor Kit Schema',\n\t\t\tdescription:\n\t\t\t\t'Complete schema definition for a specific Elementor kit settings tab, showing all available fields, their types, valid values, and configuration options',\n\t\t},\n\t\tasync ( uri, variables ) => {\n\t\t\tconst tab = Array.isArray( variables.tab ) ? variables.tab[ 0 ] : variables.tab;\n\n\t\t\tif ( ! tab ) {\n\t\t\t\tthrow new Error( 'Tab parameter is required' );\n\t\t\t}\n\n\t\t\tconst kitSchema = await fetchKitSchema();\n\t\t\tconst tabSchema = kitSchema.data?.[ tab ];\n\n\t\t\tif ( ! tabSchema ) {\n\t\t\t\tthrow new Error(\n\t\t\t\t\t`No schema found for tab '${ tab }'. Available tabs: ${ Object.keys( kitSchema.data ).join(\n\t\t\t\t\t\t', '\n\t\t\t\t\t) }`\n\t\t\t\t);\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\tcontents: [\n\t\t\t\t\t{\n\t\t\t\t\t\turi: uri.toString(),\n\t\t\t\t\t\tmimeType: 'application/json',\n\t\t\t\t\t\ttext: JSON.stringify( tabSchema, null, 2 ),\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t};\n\t\t}\n\t);\n\n\tserver.registerTool(\n\t\t'update-elementor-kit-settings-colors-and-fonts',\n\t\t{\n\t\t\tdescription: `This tool applies configuration changes to Elementor global kit settings that control site-wide design elements. Use this when you need to modify global colors, typography, spacing, buttons, form fields, or other theme-wide settings that affect the entire website appearance.\n\nThe tool will permanently update the site's global design settings and return a success confirmation with the updated configuration data.`,\n\t\t\tinputSchema: {\n\t\t\t\tsystemColors: systemColorsSchema\n\t\t\t\t\t.optional()\n\t\t\t\t\t.nullable()\n\t\t\t\t\t.describe(\n\t\t\t\t\t\t'System colors array with exactly 4 items having IDs: primary, secondary, text, accent'\n\t\t\t\t\t),\n\t\t\t\tsystemTypography: systemTypographySchema\n\t\t\t\t\t.optional()\n\t\t\t\t\t.nullable()\n\t\t\t\t\t.describe(\n\t\t\t\t\t\t'System typography array with exactly 4 items having IDs: primary, secondary, text, accent'\n\t\t\t\t\t),\n\t\t\t\tcustomColors: customColorsSchema\n\t\t\t\t\t.optional()\n\t\t\t\t\t.nullable()\n\t\t\t\t\t.describe( 'Custom colors array - flexible structure for additional color definitions' ),\n\t\t\t\tcustomTypography: customTypographySchema\n\t\t\t\t\t.optional()\n\t\t\t\t\t.nullable()\n\t\t\t\t\t.describe(\n\t\t\t\t\t\t'Custom typography array - flexible structure for additional font definitions (no color field needed)'\n\t\t\t\t\t),\n\t\t\t\tpatchObject: generalPatchSchema\n\t\t\t\t\t.optional()\n\t\t\t\t\t.nullable()\n\t\t\t\t\t.describe(\n\t\t\t\t\t\t'General patch object for any other Elementor kit settings like spacing, buttons, forms, layout settings, etc.'\n\t\t\t\t\t),\n\t\t\t\tconfirmationMessage: z\n\t\t\t\t\t.string()\n\t\t\t\t\t.describe(\n\t\t\t\t\t\t'REQUIRED: Provide a clear explanation in **markdown format** of what Elementor kit settings will be changed and their potential impact on the site\\'s global design. This message will be shown to the user before proceeding. Be specific about which design elements are being modified (colors, typography, spacing, etc.) and how they will affect the entire website. Examples: \"You\\'re about to update the global **primary color** from `blue` to `green`. This will change **buttons**, **links**, and **accent colors** throughout your entire site.\" or \"You\\'re about to change the **primary font** from `Roboto` to `Open Sans`. This will affect **headings** across all pages.\"'\n\t\t\t\t\t),\n\t\t\t},\n\t\t\tannotations: {\n\t\t\t\ttitle: 'Update Elementor Kit Settings',\n\t\t\t\tdestructiveHint: true,\n\t\t\t},\n\t\t\t_meta: {\n\t\t\t\t'angie/requiredResources': [\n\t\t\t\t\t{\n\t\t\t\t\t\turi: KIT_DESCRIPTION_URI,\n\t\t\t\t\t\twhenToUse: 'Read first for kit capabilities and limitations',\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t},\n\t\t},\n\t\tasync ( {\n\t\t\tsystemColors,\n\t\t\tsystemTypography,\n\t\t\tcustomColors,\n\t\t\tcustomTypography,\n\t\t\tpatchObject,\n\t\t\tconfirmationMessage,\n\t\t} ) => {\n\t\t\trequireConfirmationMessage( confirmationMessage, 'Elementor kit settings' );\n\n\t\t\tconst invalidFonts = await validateFonts( systemTypography, customTypography );\n\t\t\tif ( invalidFonts ) {\n\t\t\t\tthrow new Error( invalidFonts );\n\t\t\t}\n\n\t\t\tconst completePatchObject = {\n\t\t\t\t...( systemColors && { system_colors: systemColors } ),\n\t\t\t\t...( systemTypography && { system_typography: systemTypography } ),\n\t\t\t\t...( customColors && { custom_colors: customColors } ),\n\t\t\t\t...( customTypography && { custom_typography: customTypography } ),\n\t\t\t\t...sanitizeMediaFields( patchObject || {} ),\n\t\t\t};\n\n\t\t\tif ( Object.keys( completePatchObject ).length === 0 ) {\n\t\t\t\tthrow new Error(\n\t\t\t\t\t'At least one update must be provided (systemColors, systemTypography, customColors, customTypography, or patchObject)'\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tconst response = await callWpApi( `/angie/v1/elementor-kit`, 'POST', completePatchObject );\n\n\t\t\treturn {\n\t\t\t\tcontent: [\n\t\t\t\t\t{\n\t\t\t\t\t\ttype: 'text' as const,\n\t\t\t\t\t\ttext: JSON.stringify(\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tsuccess: true,\n\t\t\t\t\t\t\t\tmessage: 'Settings updated successfully',\n\t\t\t\t\t\t\t\tdata: response,\n\t\t\t\t\t\t\t\tappliedSettings: completePatchObject,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tnull,\n\t\t\t\t\t\t\t2\n\t\t\t\t\t\t),\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t};\n\t\t}\n\t);\n\n\tconst sdk = getAngieSdk();\n\tawait sdk.waitForReady();\n\tsdk.registerLocalServer( {\n\t\tserver,\n\t\tversion: VERSION,\n\t\tdescription: KIT_DESCRIPTION,\n\t\tname: 'elementor-kit-server',\n\t} );\n\treturn server;\n}\n","import { type McpServer } from '@elementor/editor-mcp';\n\nexport const KIT_DESCRIPTION_URI = 'elementor://kit/server-description';\n\nexport const KIT_DESCRIPTION = `## Elementor Kit Settings Management\n\n### Capabilities:\n**Global Design System:**\n- Create, update, name, and delete global colors (both system and custom)\n- Create, update, name, and delete global fonts (both system and custom)\n\n**Site Identity:**\n- Insert site logo\n- Set site favicon\n- Update site name\n- Modify site description\n\n### Limitations:\n**Theme Style Settings:**\n- Cannot set or update Elementor Theme Style settings including typography, buttons, images, form fields, Hello Theme header, or Hello Theme footer that affect the entire website appearance\n\n**Site-Wide Settings:**\n- Cannot set site-wide background (color or image)\n- Cannot configure mobile browser background\n- Cannot modify global layout settings such as content width, container padding, and widget gaps (the default space between widgets)\n\n**Note**: Angie can adjust all of these layout properties at the container or page level - just not site-wide.`;\n\nexport function addKitDescriptionResource( server: McpServer ) {\n\tserver.registerResource(\n\t\t'elementor-kit-server-description',\n\t\tKIT_DESCRIPTION_URI,\n\t\t{\n\t\t\ttitle: 'Elementor Kit Server Description',\n\t\t\tdescription: 'Elementor Kit capabilities and limitations',\n\t\t\tmimeType: 'text/plain',\n\t\t},\n\t\tasync ( uri ) => ( {\n\t\t\tcontents: [ { uri: uri.href, mimeType: 'text/plain', text: KIT_DESCRIPTION } ],\n\t\t} )\n\t);\n}\n","import { createElementorKitServer } from './elementor-kit-mcp-server';\n\nexport function init() {\n\tcreateElementorKitServer();\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,wBAAyD;AACzD,kCAA8E;AAC9E,oBAAkB;;;ACAX,IAAM,sBAAsB;AAE5B,IAAM,kBAAkB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAwBxB,SAAS,0BAA2B,QAAoB;AAC9D,SAAO;AAAA,IACN;AAAA,IACA;AAAA,IACA;AAAA,MACC,OAAO;AAAA,MACP,aAAa;AAAA,MACb,UAAU;AAAA,IACX;AAAA,IACA,OAAQ,SAAW;AAAA,MAClB,UAAU,CAAE,EAAE,KAAK,IAAI,MAAM,UAAU,cAAc,MAAM,gBAAgB,CAAE;AAAA,IAC9E;AAAA,EACD;AACD;;;ADnCA,IAAM,0BAA0B;AAChC,IAAM,yBAAyB;AAC/B,IAAM,2BAA2B;AACjC,IAAM,mCAAmC;AACzC,IAAM,6BAA6B;AACnC,IAAM,4BAA4B;AAQlC,IAAM,UAAU;AAChB,eAAe,gBAAgB;AAC9B,aAAO,uCAA+B,iCAAiC,KAAM;AAC9E;AAEA,eAAe,iBA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AAY;AACxB,QAAM,IAAI,aAAa;AACvB,MAAI,oBAAqB;AAAA,IACxB;AAAA,IACA,SAAS;AAAA,IACT,aAAa;AAAA,IACb,MAAM;AAAA,EACP,CAAE;AACF,SAAO;AACR;;;AE5XO,SAAS,OAAO;AACtB,2BAAyB;AAC1B;","names":[]}
|
package/dist/index.mjs
CHANGED
|
@@ -2,6 +2,48 @@
|
|
|
2
2
|
import { getAngieSdk, McpServer, ResourceTemplate } from "@elementor/editor-mcp";
|
|
3
3
|
import { callWpApi, requireConfirmationMessage, waitForElementorEditor } from "@elementor/elementor-mcp-common";
|
|
4
4
|
import { z } from "@elementor/schema";
|
|
5
|
+
|
|
6
|
+
// src/mcp-description-resource.ts
|
|
7
|
+
var KIT_DESCRIPTION_URI = "elementor://kit/server-description";
|
|
8
|
+
var KIT_DESCRIPTION = `## Elementor Kit Settings Management
|
|
9
|
+
|
|
10
|
+
### Capabilities:
|
|
11
|
+
**Global Design System:**
|
|
12
|
+
- Create, update, name, and delete global colors (both system and custom)
|
|
13
|
+
- Create, update, name, and delete global fonts (both system and custom)
|
|
14
|
+
|
|
15
|
+
**Site Identity:**
|
|
16
|
+
- Insert site logo
|
|
17
|
+
- Set site favicon
|
|
18
|
+
- Update site name
|
|
19
|
+
- Modify site description
|
|
20
|
+
|
|
21
|
+
### Limitations:
|
|
22
|
+
**Theme Style Settings:**
|
|
23
|
+
- Cannot set or update Elementor Theme Style settings including typography, buttons, images, form fields, Hello Theme header, or Hello Theme footer that affect the entire website appearance
|
|
24
|
+
|
|
25
|
+
**Site-Wide Settings:**
|
|
26
|
+
- Cannot set site-wide background (color or image)
|
|
27
|
+
- Cannot configure mobile browser background
|
|
28
|
+
- Cannot modify global layout settings such as content width, container padding, and widget gaps (the default space between widgets)
|
|
29
|
+
|
|
30
|
+
**Note**: Angie can adjust all of these layout properties at the container or page level - just not site-wide.`;
|
|
31
|
+
function addKitDescriptionResource(server) {
|
|
32
|
+
server.registerResource(
|
|
33
|
+
"elementor-kit-server-description",
|
|
34
|
+
KIT_DESCRIPTION_URI,
|
|
35
|
+
{
|
|
36
|
+
title: "Elementor Kit Server Description",
|
|
37
|
+
description: "Elementor Kit capabilities and limitations",
|
|
38
|
+
mimeType: "text/plain"
|
|
39
|
+
},
|
|
40
|
+
async (uri) => ({
|
|
41
|
+
contents: [{ uri: uri.href, mimeType: "text/plain", text: KIT_DESCRIPTION }]
|
|
42
|
+
})
|
|
43
|
+
);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
// src/elementor-kit-mcp-server.ts
|
|
5
47
|
var RESOURCE_NAME_KIT_FONTS = "elementor-kit-fonts";
|
|
6
48
|
var RESOURCE_URI_KIT_FONTS = "elementor://kit/fonts";
|
|
7
49
|
var RESOURCE_NAME_KIT_SCHEMA = "elementor-kit-schema";
|
|
@@ -95,29 +137,6 @@ var customTypographySchema = z.array(customTypographyItemSchema);
|
|
|
95
137
|
var generalPatchSchema = z.record(z.unknown()).describe(
|
|
96
138
|
"General patch object for any other Elementor kit settings like spacing, buttons, forms, layout settings, etc."
|
|
97
139
|
);
|
|
98
|
-
var SERVER_INSTRUCTIONS = `## Elementor Kit Settings Management
|
|
99
|
-
|
|
100
|
-
### Capabilities:
|
|
101
|
-
**Global Design System:**
|
|
102
|
-
- Create, update, name, and delete global colors (both system and custom)
|
|
103
|
-
- Create, update, name, and delete global fonts (both system and custom)
|
|
104
|
-
|
|
105
|
-
**Site Identity:**
|
|
106
|
-
- Insert site logo
|
|
107
|
-
- Set site favicon
|
|
108
|
-
- Update site name
|
|
109
|
-
- Modify site description
|
|
110
|
-
|
|
111
|
-
### Limitations:
|
|
112
|
-
**Theme Style Settings:**
|
|
113
|
-
- Cannot set or update Elementor Theme Style settings including typography, buttons, images, form fields, Hello Theme header, or Hello Theme footer that affect the entire website appearance
|
|
114
|
-
|
|
115
|
-
**Site-Wide Settings:**
|
|
116
|
-
- Cannot set site-wide background (color or image)
|
|
117
|
-
- Cannot configure mobile browser background
|
|
118
|
-
- Cannot modify global layout settings such as content width, container padding, and widget gaps (the default space between widgets)
|
|
119
|
-
|
|
120
|
-
**Note**: Angie can adjust all of these layout properties at the container or page level - just not site-wide.`;
|
|
121
140
|
async function createElementorKitServer() {
|
|
122
141
|
await waitForElementorEditor();
|
|
123
142
|
const server = new McpServer(
|
|
@@ -127,7 +146,7 @@ async function createElementorKitServer() {
|
|
|
127
146
|
title: "Elementor Kit"
|
|
128
147
|
},
|
|
129
148
|
{
|
|
130
|
-
instructions:
|
|
149
|
+
instructions: "Manages Elementor global design system: colors, typography, and site identity.",
|
|
131
150
|
capabilities: {
|
|
132
151
|
resources: {
|
|
133
152
|
subscribe: true
|
|
@@ -135,6 +154,7 @@ async function createElementorKitServer() {
|
|
|
135
154
|
}
|
|
136
155
|
}
|
|
137
156
|
);
|
|
157
|
+
addKitDescriptionResource(server);
|
|
138
158
|
const getAvailableTabs = async () => {
|
|
139
159
|
const kitSchema = await fetchKitSchema();
|
|
140
160
|
return Object.keys(kitSchema.data || {});
|
|
@@ -253,6 +273,14 @@ The tool will permanently update the site's global design settings and return a
|
|
|
253
273
|
annotations: {
|
|
254
274
|
title: "Update Elementor Kit Settings",
|
|
255
275
|
destructiveHint: true
|
|
276
|
+
},
|
|
277
|
+
_meta: {
|
|
278
|
+
"angie/requiredResources": [
|
|
279
|
+
{
|
|
280
|
+
uri: KIT_DESCRIPTION_URI,
|
|
281
|
+
whenToUse: "Read first for kit capabilities and limitations"
|
|
282
|
+
}
|
|
283
|
+
]
|
|
256
284
|
}
|
|
257
285
|
},
|
|
258
286
|
async ({
|
|
@@ -305,7 +333,7 @@ The tool will permanently update the site's global design settings and return a
|
|
|
305
333
|
sdk.registerLocalServer({
|
|
306
334
|
server,
|
|
307
335
|
version: VERSION,
|
|
308
|
-
description:
|
|
336
|
+
description: KIT_DESCRIPTION,
|
|
309
337
|
name: "elementor-kit-server"
|
|
310
338
|
});
|
|
311
339
|
return server;
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/elementor-kit-mcp-server.ts","../src/init.ts"],"sourcesContent":["import { getAngieSdk, McpServer, ResourceTemplate } from '@elementor/editor-mcp';\nimport { callWpApi, requireConfirmationMessage, waitForElementorEditor } from '@elementor/elementor-mcp-common';\nimport { z } from '@elementor/schema';\n\nconst RESOURCE_NAME_KIT_FONTS = 'elementor-kit-fonts';\nconst RESOURCE_URI_KIT_FONTS = 'elementor://kit/fonts';\nconst RESOURCE_NAME_KIT_SCHEMA = 'elementor-kit-schema';\nconst RESOURCE_URI_KIT_SCHEMA_TEMPLATE = 'elementor://kit/schema/{tab}';\nconst RESOURCE_NAME_KIT_SETTINGS = 'elementor-kit-settings';\nconst RESOURCE_URI_KIT_SETTINGS = 'elementor://kit/settings';\n\ntype KitFontsResponse = {\n\tfonts: Record< string, unknown >;\n};\n\ntype KitSchemaResponse = Record< string, unknown >;\n\nconst VERSION = '2.0.0';\nasync function fetchKitFonts() {\n\treturn callWpApi< KitFontsResponse >( `/angie/v1/elementor-kit/fonts`, 'GET' );\n}\n\nasync function fetchKitSchema() {\n\treturn callWpApi< KitSchemaResponse >( `/angie/v1/elementor-kit/schema`, 'GET' );\n}\n\nasync function fetchKitSettings() {\n\treturn callWpApi( `/angie/v1/elementor-kit`, 'GET' );\n}\n\ntype TypographyItem = {\n\ttypography_font_family?: string;\n};\n\nasync function validateFonts(\n\tsystemTypography: TypographyItem[] | null | undefined,\n\tcustomTypography: TypographyItem[] | null | undefined\n) {\n\tconst fontsResponse = await fetchKitFonts();\n\tconst availableFonts = Object.keys( fontsResponse.data.fonts || {} );\n\tconst invalidFonts: string[] = [];\n\n\t[ systemTypography, customTypography ].forEach( ( typography ) => {\n\t\tif ( typography ) {\n\t\t\ttypography.forEach( ( item ) => {\n\t\t\t\tif ( item.typography_font_family && ! availableFonts.includes( item.typography_font_family ) ) {\n\t\t\t\t\tinvalidFonts.push( item.typography_font_family );\n\t\t\t\t}\n\t\t\t} );\n\t\t}\n\t} );\n\n\tif ( invalidFonts.length > 0 ) {\n\t\treturn `Please use available fonts only. Invalid fonts: ${ invalidFonts.join(\n\t\t\t', '\n\t\t) }. Available fonts: ${ availableFonts.join( ', ' ) }`;\n\t}\n\n\treturn '';\n}\n\nfunction sanitizeMediaFields( obj: Record< string, unknown > ): Record< string, unknown > {\n\tconst mediaFields = [ 'site_logo', 'site_icon' ];\n\tconst sanitized = { ...obj };\n\n\tfor ( const field of mediaFields ) {\n\t\tif ( field in sanitized && sanitized[ field ] === '' ) {\n\t\t\tsanitized[ field ] = 0;\n\t\t}\n\t}\n\n\treturn sanitized;\n}\n\nconst baseColorSchema = z.object( {\n\ttitle: z.string(),\n\tcolor: z.string(),\n} );\n\nconst baseTypographySchema = z\n\t.object( {\n\t\ttitle: z.string(),\n\t\ttypography_typography: z.string(),\n\t\ttypography_font_family: z\n\t\t\t.string()\n\t\t\t.describe(\n\t\t\t\t'Font family name that must be from the available Elementor fonts list. Use the get-fonts endpoint (/angie/v1/elementor-kit/fonts) to get the complete list of available fonts. Only use fonts that exist in this list to avoid validation errors.'\n\t\t\t),\n\t\ttypography_font_weight: z.string(),\n\t\ttypography_font_size: z\n\t\t\t.object( {\n\t\t\t\tunit: z.string(),\n\t\t\t\tsize: z.number(),\n\t\t\t} )\n\t\t\t.optional(),\n\t\ttypography_font_size_tablet: z\n\t\t\t.object( {\n\t\t\t\tunit: z.string(),\n\t\t\t\tsize: z.number(),\n\t\t\t} )\n\t\t\t.optional(),\n\t\ttypography_font_size_mobile: z\n\t\t\t.object( {\n\t\t\t\tunit: z.string(),\n\t\t\t\tsize: z.number(),\n\t\t\t} )\n\t\t\t.optional(),\n\t\ttypography_line_height: z\n\t\t\t.object( {\n\t\t\t\tunit: z.string(),\n\t\t\t\tsize: z.number(),\n\t\t\t} )\n\t\t\t.optional(),\n\t} )\n\t.passthrough();\n\nconst systemColorItemSchema = baseColorSchema.extend( {\n\t_id: z.enum( [ 'primary', 'secondary', 'text', 'accent' ] ),\n} );\n\nconst systemTypographyItemSchema = baseTypographySchema.extend( {\n\t_id: z.enum( [ 'primary', 'secondary', 'text', 'accent' ] ),\n} );\n\nconst customColorItemSchema = baseColorSchema.extend( {\n\t_id: z.string(),\n} );\n\nconst customTypographyItemSchema = baseTypographySchema.extend( {\n\t_id: z.string(),\n} );\n\nconst systemColorsSchema = z.array( systemColorItemSchema ).length( 4 );\nconst systemTypographySchema = z.array( systemTypographyItemSchema ).length( 4 );\nconst customColorsSchema = z.array( customColorItemSchema );\nconst customTypographySchema = z.array( customTypographyItemSchema );\n\nconst generalPatchSchema = z\n\t.record( z.unknown() )\n\t.describe(\n\t\t'General patch object for any other Elementor kit settings like spacing, buttons, forms, layout settings, etc.'\n\t);\n\nconst SERVER_INSTRUCTIONS = `## Elementor Kit Settings Management\n\n### Capabilities:\n**Global Design System:**\n- Create, update, name, and delete global colors (both system and custom)\n- Create, update, name, and delete global fonts (both system and custom)\n\n**Site Identity:**\n- Insert site logo\n- Set site favicon\n- Update site name\n- Modify site description\n\n### Limitations:\n**Theme Style Settings:**\n- Cannot set or update Elementor Theme Style settings including typography, buttons, images, form fields, Hello Theme header, or Hello Theme footer that affect the entire website appearance\n\n**Site-Wide Settings:**\n- Cannot set site-wide background (color or image)\n- Cannot configure mobile browser background\n- Cannot modify global layout settings such as content width, container padding, and widget gaps (the default space between widgets)\n\n**Note**: Angie can adjust all of these layout properties at the container or page level - just not site-wide.`;\n\nexport async function createElementorKitServer(): Promise< McpServer > {\n\tawait waitForElementorEditor();\n\tconst server = new McpServer(\n\t\t{\n\t\t\tname: 'elementor-kit-server',\n\t\t\tversion: VERSION,\n\t\t\ttitle: 'Elementor Kit',\n\t\t},\n\t\t{\n\t\t\tinstructions: SERVER_INSTRUCTIONS,\n\t\t\tcapabilities: {\n\t\t\t\tresources: {\n\t\t\t\t\tsubscribe: true,\n\t\t\t\t},\n\t\t\t},\n\t\t}\n\t);\n\n\tconst getAvailableTabs = async (): Promise< string[] > => {\n\t\tconst kitSchema = await fetchKitSchema();\n\t\treturn Object.keys( kitSchema.data || {} );\n\t};\n\n\tserver.registerResource(\n\t\tRESOURCE_NAME_KIT_FONTS,\n\t\tRESOURCE_URI_KIT_FONTS,\n\t\t{\n\t\t\ttitle: 'Elementor Kit Available Fonts',\n\t\t\tdescription:\n\t\t\t\t'Complete list of all available font families that can be used in Elementor, including system fonts, Google fonts, and custom uploaded fonts',\n\t\t},\n\t\tasync ( uri ) => {\n\t\t\tconst fontsResponse = await fetchKitFonts();\n\t\t\treturn {\n\t\t\t\tcontents: [\n\t\t\t\t\t{\n\t\t\t\t\t\turi: uri.href,\n\t\t\t\t\t\tmimeType: 'application/json',\n\t\t\t\t\t\ttext: JSON.stringify( fontsResponse, null, 2 ),\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t};\n\t\t}\n\t);\n\n\tserver.registerResource(\n\t\tRESOURCE_NAME_KIT_SETTINGS,\n\t\tRESOURCE_URI_KIT_SETTINGS,\n\t\t{\n\t\t\ttitle: 'Elementor Kit Current Settings',\n\t\t\tdescription:\n\t\t\t\t'Complete current Elementor global kit configuration including all system and custom colors, typography settings, spacing, buttons, forms, and other site-wide design settings',\n\t\t},\n\t\tasync ( uri ) => {\n\t\t\tconst currentSettings = await fetchKitSettings();\n\t\t\treturn {\n\t\t\t\tcontents: [\n\t\t\t\t\t{\n\t\t\t\t\t\turi: uri.href,\n\t\t\t\t\t\tmimeType: 'application/json',\n\t\t\t\t\t\ttext: JSON.stringify( currentSettings, null, 2 ),\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t};\n\t\t}\n\t);\n\n\tconst availableTabs = await getAvailableTabs();\n\n\tserver.registerResource(\n\t\tRESOURCE_NAME_KIT_SCHEMA,\n\t\tnew ResourceTemplate( RESOURCE_URI_KIT_SCHEMA_TEMPLATE, {\n\t\t\tlist: async () => {\n\t\t\t\treturn {\n\t\t\t\t\tresources: availableTabs.map( ( tab ) => {\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\turi: `elementor://kit/schema/${ tab }`,\n\t\t\t\t\t\t\tname: `${ RESOURCE_NAME_KIT_SCHEMA }-${ tab }`,\n\t\t\t\t\t\t\ttitle: `Elementor Kit Schema - ${ tab }`,\n\t\t\t\t\t\t\tdescription: `Schema definition for Elementor kit ${ tab } settings tab`,\n\t\t\t\t\t\t\tmimeType: 'application/json',\n\t\t\t\t\t\t};\n\t\t\t\t\t} ),\n\t\t\t\t};\n\t\t\t},\n\t\t} ),\n\t\t{\n\t\t\ttitle: 'Elementor Kit Schema',\n\t\t\tdescription:\n\t\t\t\t'Complete schema definition for a specific Elementor kit settings tab, showing all available fields, their types, valid values, and configuration options',\n\t\t},\n\t\tasync ( uri, variables ) => {\n\t\t\tconst tab = Array.isArray( variables.tab ) ? variables.tab[ 0 ] : variables.tab;\n\n\t\t\tif ( ! tab ) {\n\t\t\t\tthrow new Error( 'Tab parameter is required' );\n\t\t\t}\n\n\t\t\tconst kitSchema = await fetchKitSchema();\n\t\t\tconst tabSchema = kitSchema.data?.[ tab ];\n\n\t\t\tif ( ! tabSchema ) {\n\t\t\t\tthrow new Error(\n\t\t\t\t\t`No schema found for tab '${ tab }'. Available tabs: ${ Object.keys( kitSchema.data ).join(\n\t\t\t\t\t\t', '\n\t\t\t\t\t) }`\n\t\t\t\t);\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\tcontents: [\n\t\t\t\t\t{\n\t\t\t\t\t\turi: uri.toString(),\n\t\t\t\t\t\tmimeType: 'application/json',\n\t\t\t\t\t\ttext: JSON.stringify( tabSchema, null, 2 ),\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t};\n\t\t}\n\t);\n\n\tserver.registerTool(\n\t\t'update-elementor-kit-settings-colors-and-fonts',\n\t\t{\n\t\t\tdescription: `This tool applies configuration changes to Elementor global kit settings that control site-wide design elements. Use this when you need to modify global colors, typography, spacing, buttons, form fields, or other theme-wide settings that affect the entire website appearance.\n\nThe tool will permanently update the site's global design settings and return a success confirmation with the updated configuration data.`,\n\t\t\tinputSchema: {\n\t\t\t\tsystemColors: systemColorsSchema\n\t\t\t\t\t.optional()\n\t\t\t\t\t.nullable()\n\t\t\t\t\t.describe(\n\t\t\t\t\t\t'System colors array with exactly 4 items having IDs: primary, secondary, text, accent'\n\t\t\t\t\t),\n\t\t\t\tsystemTypography: systemTypographySchema\n\t\t\t\t\t.optional()\n\t\t\t\t\t.nullable()\n\t\t\t\t\t.describe(\n\t\t\t\t\t\t'System typography array with exactly 4 items having IDs: primary, secondary, text, accent'\n\t\t\t\t\t),\n\t\t\t\tcustomColors: customColorsSchema\n\t\t\t\t\t.optional()\n\t\t\t\t\t.nullable()\n\t\t\t\t\t.describe( 'Custom colors array - flexible structure for additional color definitions' ),\n\t\t\t\tcustomTypography: customTypographySchema\n\t\t\t\t\t.optional()\n\t\t\t\t\t.nullable()\n\t\t\t\t\t.describe(\n\t\t\t\t\t\t'Custom typography array - flexible structure for additional font definitions (no color field needed)'\n\t\t\t\t\t),\n\t\t\t\tpatchObject: generalPatchSchema\n\t\t\t\t\t.optional()\n\t\t\t\t\t.nullable()\n\t\t\t\t\t.describe(\n\t\t\t\t\t\t'General patch object for any other Elementor kit settings like spacing, buttons, forms, layout settings, etc.'\n\t\t\t\t\t),\n\t\t\t\tconfirmationMessage: z\n\t\t\t\t\t.string()\n\t\t\t\t\t.describe(\n\t\t\t\t\t\t'REQUIRED: Provide a clear explanation in **markdown format** of what Elementor kit settings will be changed and their potential impact on the site\\'s global design. This message will be shown to the user before proceeding. Be specific about which design elements are being modified (colors, typography, spacing, etc.) and how they will affect the entire website. Examples: \"You\\'re about to update the global **primary color** from `blue` to `green`. This will change **buttons**, **links**, and **accent colors** throughout your entire site.\" or \"You\\'re about to change the **primary font** from `Roboto` to `Open Sans`. This will affect **headings** across all pages.\"'\n\t\t\t\t\t),\n\t\t\t},\n\t\t\tannotations: {\n\t\t\t\ttitle: 'Update Elementor Kit Settings',\n\t\t\t\tdestructiveHint: true,\n\t\t\t},\n\t\t},\n\t\tasync ( {\n\t\t\tsystemColors,\n\t\t\tsystemTypography,\n\t\t\tcustomColors,\n\t\t\tcustomTypography,\n\t\t\tpatchObject,\n\t\t\tconfirmationMessage,\n\t\t} ) => {\n\t\t\trequireConfirmationMessage( confirmationMessage, 'Elementor kit settings' );\n\n\t\t\tconst invalidFonts = await validateFonts( systemTypography, customTypography );\n\t\t\tif ( invalidFonts ) {\n\t\t\t\tthrow new Error( invalidFonts );\n\t\t\t}\n\n\t\t\tconst completePatchObject = {\n\t\t\t\t...( systemColors && { system_colors: systemColors } ),\n\t\t\t\t...( systemTypography && { system_typography: systemTypography } ),\n\t\t\t\t...( customColors && { custom_colors: customColors } ),\n\t\t\t\t...( customTypography && { custom_typography: customTypography } ),\n\t\t\t\t...sanitizeMediaFields( patchObject || {} ),\n\t\t\t};\n\n\t\t\tif ( Object.keys( completePatchObject ).length === 0 ) {\n\t\t\t\tthrow new Error(\n\t\t\t\t\t'At least one update must be provided (systemColors, systemTypography, customColors, customTypography, or patchObject)'\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tconst response = await callWpApi( `/angie/v1/elementor-kit`, 'POST', completePatchObject );\n\n\t\t\treturn {\n\t\t\t\tcontent: [\n\t\t\t\t\t{\n\t\t\t\t\t\ttype: 'text' as const,\n\t\t\t\t\t\ttext: JSON.stringify(\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tsuccess: true,\n\t\t\t\t\t\t\t\tmessage: 'Settings updated successfully',\n\t\t\t\t\t\t\t\tdata: response,\n\t\t\t\t\t\t\t\tappliedSettings: completePatchObject,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tnull,\n\t\t\t\t\t\t\t2\n\t\t\t\t\t\t),\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t};\n\t\t}\n\t);\n\n\tconst sdk = getAngieSdk();\n\tawait sdk.waitForReady();\n\tsdk.registerLocalServer( {\n\t\tserver,\n\t\tversion: VERSION,\n\t\tdescription: SERVER_INSTRUCTIONS,\n\t\tname: 'elementor-kit-server',\n\t} );\n\treturn server;\n}\n","import { createElementorKitServer } from './elementor-kit-mcp-server';\n\nexport function init() {\n\tcreateElementorKitServer();\n}\n"],"mappings":";AAAA,SAAS,aAAa,WAAW,wBAAwB;AACzD,SAAS,WAAW,4BAA4B,8BAA8B;AAC9E,SAAS,SAAS;AAElB,IAAM,0BAA0B;AAChC,IAAM,yBAAyB;AAC/B,IAAM,2BAA2B;AACjC,IAAM,mCAAmC;AACzC,IAAM,6BAA6B;AACnC,IAAM,4BAA4B;AAQlC,IAAM,UAAU;AAChB,eAAe,gBAAgB;AAC9B,SAAO,UAA+B,iCAAiC,KAAM;AAC9E;AAEA,eAAe,iBAAiB;AAC/B,SAAO,UAAgC,kCAAkC,KAAM;AAChF;AAEA,eAAe,mBAAmB;AACjC,SAAO,UAAW,2BAA2B,KAAM;AACpD;AAMA,eAAe,cACd,kBACA,kBACC;AACD,QAAM,gBAAgB,MAAM,cAAc;AAC1C,QAAM,iBAAiB,OAAO,KAAM,cAAc,KAAK,SAAS,CAAC,CAAE;AACnE,QAAM,eAAyB,CAAC;AAEhC,GAAE,kBAAkB,gBAAiB,EAAE,QAAS,CAAE,eAAgB;AACjE,QAAK,YAAa;AACjB,iBAAW,QAAS,CAAE,SAAU;AAC/B,YAAK,KAAK,0BAA0B,CAAE,eAAe,SAAU,KAAK,sBAAuB,GAAI;AAC9F,uBAAa,KAAM,KAAK,sBAAuB;AAAA,QAChD;AAAA,MACD,CAAE;AAAA,IACH;AAAA,EACD,CAAE;AAEF,MAAK,aAAa,SAAS,GAAI;AAC9B,WAAO,mDAAoD,aAAa;AAAA,MACvE;AAAA,IACD,CAAE,sBAAuB,eAAe,KAAM,IAAK,CAAE;AAAA,EACtD;AAEA,SAAO;AACR;AAEA,SAAS,oBAAqB,KAA4D;AACzF,QAAM,cAAc,CAAE,aAAa,WAAY;AAC/C,QAAM,YAAY,EAAE,GAAG,IAAI;AAE3B,aAAY,SAAS,aAAc;AAClC,QAAK,S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AE,WAAW,GAAI;AACtD,cAAM,IAAI;AAAA,UACT;AAAA,QACD;AAAA,MACD;AAEA,YAAM,WAAW,MAAM,UAAW,2BAA2B,QAAQ,mBAAoB;AAEzF,aAAO;AAAA,QACN,SAAS;AAAA,UACR;AAAA,YACC,MAAM;AAAA,YACN,MAAM,KAAK;AAAA,cACV;AAAA,gBACC,SAAS;AAAA,gBACT,SAAS;AAAA,gBACT,MAAM;AAAA,gBACN,iBAAiB;AAAA,cAClB;AAAA,cACA;AAAA,cACA;AAAA,YACD;AAAA,UACD;AAAA,QACD;AAAA,MACD;AAAA,IACD;AAAA,EACD;AAEA,QAAM,MAAM,YAAY;AACxB,QAAM,IAAI,aAAa;AACvB,MAAI,oBAAqB;AAAA,IACxB;AAAA,IACA,SAAS;AAAA,IACT,aAAa;AAAA,IACb,MAAM;AAAA,EACP,CAAE;AACF,SAAO;AACR;;;ACxYO,SAAS,OAAO;AACtB,2BAAyB;AAC1B;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../src/elementor-kit-mcp-server.ts","../src/mcp-description-resource.ts","../src/init.ts"],"sourcesContent":["import { getAngieSdk, McpServer, ResourceTemplate } from '@elementor/editor-mcp';\nimport { callWpApi, requireConfirmationMessage, waitForElementorEditor } from '@elementor/elementor-mcp-common';\nimport { z } from '@elementor/schema';\n\nimport { addKitDescriptionResource, KIT_DESCRIPTION, KIT_DESCRIPTION_URI } from './mcp-description-resource';\n\nconst RESOURCE_NAME_KIT_FONTS = 'elementor-kit-fonts';\nconst RESOURCE_URI_KIT_FONTS = 'elementor://kit/fonts';\nconst RESOURCE_NAME_KIT_SCHEMA = 'elementor-kit-schema';\nconst RESOURCE_URI_KIT_SCHEMA_TEMPLATE = 'elementor://kit/schema/{tab}';\nconst RESOURCE_NAME_KIT_SETTINGS = 'elementor-kit-settings';\nconst RESOURCE_URI_KIT_SETTINGS = 'elementor://kit/settings';\n\ntype KitFontsResponse = {\n\tfonts: Record< string, unknown >;\n};\n\ntype KitSchemaResponse = Record< string, unknown >;\n\nconst VERSION = '2.0.0';\nasync function fetchKitFonts() {\n\treturn callWpApi< KitFontsResponse >( `/angie/v1/elementor-kit/fonts`, 'GET' );\n}\n\nasync function fetchKitSchema() {\n\treturn callWpApi< KitSchemaResponse >( `/angie/v1/elementor-kit/schema`, 'GET' );\n}\n\nasync function fetchKitSettings() {\n\treturn callWpApi( `/angie/v1/elementor-kit`, 'GET' );\n}\n\ntype TypographyItem = {\n\ttypography_font_family?: string;\n};\n\nasync function validateFonts(\n\tsystemTypography: TypographyItem[] | null | undefined,\n\tcustomTypography: TypographyItem[] | null | undefined\n) {\n\tconst fontsResponse = await fetchKitFonts();\n\tconst availableFonts = Object.keys( fontsResponse.data.fonts || {} );\n\tconst invalidFonts: string[] = [];\n\n\t[ systemTypography, customTypography ].forEach( ( typography ) => {\n\t\tif ( typography ) {\n\t\t\ttypography.forEach( ( item ) => {\n\t\t\t\tif ( item.typography_font_family && ! availableFonts.includes( item.typography_font_family ) ) {\n\t\t\t\t\tinvalidFonts.push( item.typography_font_family );\n\t\t\t\t}\n\t\t\t} );\n\t\t}\n\t} );\n\n\tif ( invalidFonts.length > 0 ) {\n\t\treturn `Please use available fonts only. Invalid fonts: ${ invalidFonts.join(\n\t\t\t', '\n\t\t) }. Available fonts: ${ availableFonts.join( ', ' ) }`;\n\t}\n\n\treturn '';\n}\n\nfunction sanitizeMediaFields( obj: Record< string, unknown > ): Record< string, unknown > {\n\tconst mediaFields = [ 'site_logo', 'site_icon' ];\n\tconst sanitized = { ...obj };\n\n\tfor ( const field of mediaFields ) {\n\t\tif ( field in sanitized && sanitized[ field ] === '' ) {\n\t\t\tsanitized[ field ] = 0;\n\t\t}\n\t}\n\n\treturn sanitized;\n}\n\nconst baseColorSchema = z.object( {\n\ttitle: z.string(),\n\tcolor: z.string(),\n} );\n\nconst baseTypographySchema = z\n\t.object( {\n\t\ttitle: z.string(),\n\t\ttypography_typography: z.string(),\n\t\ttypography_font_family: z\n\t\t\t.string()\n\t\t\t.describe(\n\t\t\t\t'Font family name that must be from the available Elementor fonts list. Use the get-fonts endpoint (/angie/v1/elementor-kit/fonts) to get the complete list of available fonts. Only use fonts that exist in this list to avoid validation errors.'\n\t\t\t),\n\t\ttypography_font_weight: z.string(),\n\t\ttypography_font_size: z\n\t\t\t.object( {\n\t\t\t\tunit: z.string(),\n\t\t\t\tsize: z.number(),\n\t\t\t} )\n\t\t\t.optional(),\n\t\ttypography_font_size_tablet: z\n\t\t\t.object( {\n\t\t\t\tunit: z.string(),\n\t\t\t\tsize: z.number(),\n\t\t\t} )\n\t\t\t.optional(),\n\t\ttypography_font_size_mobile: z\n\t\t\t.object( {\n\t\t\t\tunit: z.string(),\n\t\t\t\tsize: z.number(),\n\t\t\t} )\n\t\t\t.optional(),\n\t\ttypography_line_height: z\n\t\t\t.object( {\n\t\t\t\tunit: z.string(),\n\t\t\t\tsize: z.number(),\n\t\t\t} )\n\t\t\t.optional(),\n\t} )\n\t.passthrough();\n\nconst systemColorItemSchema = baseColorSchema.extend( {\n\t_id: z.enum( [ 'primary', 'secondary', 'text', 'accent' ] ),\n} );\n\nconst systemTypographyItemSchema = baseTypographySchema.extend( {\n\t_id: z.enum( [ 'primary', 'secondary', 'text', 'accent' ] ),\n} );\n\nconst customColorItemSchema = baseColorSchema.extend( {\n\t_id: z.string(),\n} );\n\nconst customTypographyItemSchema = baseTypographySchema.extend( {\n\t_id: z.string(),\n} );\n\nconst systemColorsSchema = z.array( systemColorItemSchema ).length( 4 );\nconst systemTypographySchema = z.array( systemTypographyItemSchema ).length( 4 );\nconst customColorsSchema = z.array( customColorItemSchema );\nconst customTypographySchema = z.array( customTypographyItemSchema );\n\nconst generalPatchSchema = z\n\t.record( z.unknown() )\n\t.describe(\n\t\t'General patch object for any other Elementor kit settings like spacing, buttons, forms, layout settings, etc.'\n\t);\n\nexport async function createElementorKitServer(): Promise< McpServer > {\n\tawait waitForElementorEditor();\n\tconst server = new McpServer(\n\t\t{\n\t\t\tname: 'elementor-kit-server',\n\t\t\tversion: VERSION,\n\t\t\ttitle: 'Elementor Kit',\n\t\t},\n\t\t{\n\t\t\tinstructions: 'Manages Elementor global design system: colors, typography, and site identity.',\n\t\t\tcapabilities: {\n\t\t\t\tresources: {\n\t\t\t\t\tsubscribe: true,\n\t\t\t\t},\n\t\t\t},\n\t\t}\n\t);\n\n\taddKitDescriptionResource( server );\n\n\tconst getAvailableTabs = async (): Promise< string[] > => {\n\t\tconst kitSchema = await fetchKitSchema();\n\t\treturn Object.keys( kitSchema.data || {} );\n\t};\n\n\tserver.registerResource(\n\t\tRESOURCE_NAME_KIT_FONTS,\n\t\tRESOURCE_URI_KIT_FONTS,\n\t\t{\n\t\t\ttitle: 'Elementor Kit Available Fonts',\n\t\t\tdescription:\n\t\t\t\t'Complete list of all available font families that can be used in Elementor, including system fonts, Google fonts, and custom uploaded fonts',\n\t\t},\n\t\tasync ( uri ) => {\n\t\t\tconst fontsResponse = await fetchKitFonts();\n\t\t\treturn {\n\t\t\t\tcontents: [\n\t\t\t\t\t{\n\t\t\t\t\t\turi: uri.href,\n\t\t\t\t\t\tmimeType: 'application/json',\n\t\t\t\t\t\ttext: JSON.stringify( fontsResponse, null, 2 ),\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t};\n\t\t}\n\t);\n\n\tserver.registerResource(\n\t\tRESOURCE_NAME_KIT_SETTINGS,\n\t\tRESOURCE_URI_KIT_SETTINGS,\n\t\t{\n\t\t\ttitle: 'Elementor Kit Current Settings',\n\t\t\tdescription:\n\t\t\t\t'Complete current Elementor global kit configuration including all system and custom colors, typography settings, spacing, buttons, forms, and other site-wide design settings',\n\t\t},\n\t\tasync ( uri ) => {\n\t\t\tconst currentSettings = await fetchKitSettings();\n\t\t\treturn {\n\t\t\t\tcontents: [\n\t\t\t\t\t{\n\t\t\t\t\t\turi: uri.href,\n\t\t\t\t\t\tmimeType: 'application/json',\n\t\t\t\t\t\ttext: JSON.stringify( currentSettings, null, 2 ),\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t};\n\t\t}\n\t);\n\n\tconst availableTabs = await getAvailableTabs();\n\n\tserver.registerResource(\n\t\tRESOURCE_NAME_KIT_SCHEMA,\n\t\tnew ResourceTemplate( RESOURCE_URI_KIT_SCHEMA_TEMPLATE, {\n\t\t\tlist: async () => {\n\t\t\t\treturn {\n\t\t\t\t\tresources: availableTabs.map( ( tab ) => {\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\turi: `elementor://kit/schema/${ tab }`,\n\t\t\t\t\t\t\tname: `${ RESOURCE_NAME_KIT_SCHEMA }-${ tab }`,\n\t\t\t\t\t\t\ttitle: `Elementor Kit Schema - ${ tab }`,\n\t\t\t\t\t\t\tdescription: `Schema definition for Elementor kit ${ tab } settings tab`,\n\t\t\t\t\t\t\tmimeType: 'application/json',\n\t\t\t\t\t\t};\n\t\t\t\t\t} ),\n\t\t\t\t};\n\t\t\t},\n\t\t} ),\n\t\t{\n\t\t\ttitle: 'Elementor Kit Schema',\n\t\t\tdescription:\n\t\t\t\t'Complete schema definition for a specific Elementor kit settings tab, showing all available fields, their types, valid values, and configuration options',\n\t\t},\n\t\tasync ( uri, variables ) => {\n\t\t\tconst tab = Array.isArray( variables.tab ) ? variables.tab[ 0 ] : variables.tab;\n\n\t\t\tif ( ! tab ) {\n\t\t\t\tthrow new Error( 'Tab parameter is required' );\n\t\t\t}\n\n\t\t\tconst kitSchema = await fetchKitSchema();\n\t\t\tconst tabSchema = kitSchema.data?.[ tab ];\n\n\t\t\tif ( ! tabSchema ) {\n\t\t\t\tthrow new Error(\n\t\t\t\t\t`No schema found for tab '${ tab }'. Available tabs: ${ Object.keys( kitSchema.data ).join(\n\t\t\t\t\t\t', '\n\t\t\t\t\t) }`\n\t\t\t\t);\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\tcontents: [\n\t\t\t\t\t{\n\t\t\t\t\t\turi: uri.toString(),\n\t\t\t\t\t\tmimeType: 'application/json',\n\t\t\t\t\t\ttext: JSON.stringify( tabSchema, null, 2 ),\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t};\n\t\t}\n\t);\n\n\tserver.registerTool(\n\t\t'update-elementor-kit-settings-colors-and-fonts',\n\t\t{\n\t\t\tdescription: `This tool applies configuration changes to Elementor global kit settings that control site-wide design elements. Use this when you need to modify global colors, typography, spacing, buttons, form fields, or other theme-wide settings that affect the entire website appearance.\n\nThe tool will permanently update the site's global design settings and return a success confirmation with the updated configuration data.`,\n\t\t\tinputSchema: {\n\t\t\t\tsystemColors: systemColorsSchema\n\t\t\t\t\t.optional()\n\t\t\t\t\t.nullable()\n\t\t\t\t\t.describe(\n\t\t\t\t\t\t'System colors array with exactly 4 items having IDs: primary, secondary, text, accent'\n\t\t\t\t\t),\n\t\t\t\tsystemTypography: systemTypographySchema\n\t\t\t\t\t.optional()\n\t\t\t\t\t.nullable()\n\t\t\t\t\t.describe(\n\t\t\t\t\t\t'System typography array with exactly 4 items having IDs: primary, secondary, text, accent'\n\t\t\t\t\t),\n\t\t\t\tcustomColors: customColorsSchema\n\t\t\t\t\t.optional()\n\t\t\t\t\t.nullable()\n\t\t\t\t\t.describe( 'Custom colors array - flexible structure for additional color definitions' ),\n\t\t\t\tcustomTypography: customTypographySchema\n\t\t\t\t\t.optional()\n\t\t\t\t\t.nullable()\n\t\t\t\t\t.describe(\n\t\t\t\t\t\t'Custom typography array - flexible structure for additional font definitions (no color field needed)'\n\t\t\t\t\t),\n\t\t\t\tpatchObject: generalPatchSchema\n\t\t\t\t\t.optional()\n\t\t\t\t\t.nullable()\n\t\t\t\t\t.describe(\n\t\t\t\t\t\t'General patch object for any other Elementor kit settings like spacing, buttons, forms, layout settings, etc.'\n\t\t\t\t\t),\n\t\t\t\tconfirmationMessage: z\n\t\t\t\t\t.string()\n\t\t\t\t\t.describe(\n\t\t\t\t\t\t'REQUIRED: Provide a clear explanation in **markdown format** of what Elementor kit settings will be changed and their potential impact on the site\\'s global design. This message will be shown to the user before proceeding. Be specific about which design elements are being modified (colors, typography, spacing, etc.) and how they will affect the entire website. Examples: \"You\\'re about to update the global **primary color** from `blue` to `green`. This will change **buttons**, **links**, and **accent colors** throughout your entire site.\" or \"You\\'re about to change the **primary font** from `Roboto` to `Open Sans`. This will affect **headings** across all pages.\"'\n\t\t\t\t\t),\n\t\t\t},\n\t\t\tannotations: {\n\t\t\t\ttitle: 'Update Elementor Kit Settings',\n\t\t\t\tdestructiveHint: true,\n\t\t\t},\n\t\t\t_meta: {\n\t\t\t\t'angie/requiredResources': [\n\t\t\t\t\t{\n\t\t\t\t\t\turi: KIT_DESCRIPTION_URI,\n\t\t\t\t\t\twhenToUse: 'Read first for kit capabilities and limitations',\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t},\n\t\t},\n\t\tasync ( {\n\t\t\tsystemColors,\n\t\t\tsystemTypography,\n\t\t\tcustomColors,\n\t\t\tcustomTypography,\n\t\t\tpatchObject,\n\t\t\tconfirmationMessage,\n\t\t} ) => {\n\t\t\trequireConfirmationMessage( confirmationMessage, 'Elementor kit settings' );\n\n\t\t\tconst invalidFonts = await validateFonts( systemTypography, customTypography );\n\t\t\tif ( invalidFonts ) {\n\t\t\t\tthrow new Error( invalidFonts );\n\t\t\t}\n\n\t\t\tconst completePatchObject = {\n\t\t\t\t...( systemColors && { system_colors: systemColors } ),\n\t\t\t\t...( systemTypography && { system_typography: systemTypography } ),\n\t\t\t\t...( customColors && { custom_colors: customColors } ),\n\t\t\t\t...( customTypography && { custom_typography: customTypography } ),\n\t\t\t\t...sanitizeMediaFields( patchObject || {} ),\n\t\t\t};\n\n\t\t\tif ( Object.keys( completePatchObject ).length === 0 ) {\n\t\t\t\tthrow new Error(\n\t\t\t\t\t'At least one update must be provided (systemColors, systemTypography, customColors, customTypography, or patchObject)'\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tconst response = await callWpApi( `/angie/v1/elementor-kit`, 'POST', completePatchObject );\n\n\t\t\treturn {\n\t\t\t\tcontent: [\n\t\t\t\t\t{\n\t\t\t\t\t\ttype: 'text' as const,\n\t\t\t\t\t\ttext: JSON.stringify(\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tsuccess: true,\n\t\t\t\t\t\t\t\tmessage: 'Settings updated successfully',\n\t\t\t\t\t\t\t\tdata: response,\n\t\t\t\t\t\t\t\tappliedSettings: completePatchObject,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tnull,\n\t\t\t\t\t\t\t2\n\t\t\t\t\t\t),\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t};\n\t\t}\n\t);\n\n\tconst sdk = getAngieSdk();\n\tawait sdk.waitForReady();\n\tsdk.registerLocalServer( {\n\t\tserver,\n\t\tversion: VERSION,\n\t\tdescription: KIT_DESCRIPTION,\n\t\tname: 'elementor-kit-server',\n\t} );\n\treturn server;\n}\n","import { type McpServer } from '@elementor/editor-mcp';\n\nexport const KIT_DESCRIPTION_URI = 'elementor://kit/server-description';\n\nexport const KIT_DESCRIPTION = `## Elementor Kit Settings Management\n\n### Capabilities:\n**Global Design System:**\n- Create, update, name, and delete global colors (both system and custom)\n- Create, update, name, and delete global fonts (both system and custom)\n\n**Site Identity:**\n- Insert site logo\n- Set site favicon\n- Update site name\n- Modify site description\n\n### Limitations:\n**Theme Style Settings:**\n- Cannot set or update Elementor Theme Style settings including typography, buttons, images, form fields, Hello Theme header, or Hello Theme footer that affect the entire website appearance\n\n**Site-Wide Settings:**\n- Cannot set site-wide background (color or image)\n- Cannot configure mobile browser background\n- Cannot modify global layout settings such as content width, container padding, and widget gaps (the default space between widgets)\n\n**Note**: Angie can adjust all of these layout properties at the container or page level - just not site-wide.`;\n\nexport function addKitDescriptionResource( server: McpServer ) {\n\tserver.registerResource(\n\t\t'elementor-kit-server-description',\n\t\tKIT_DESCRIPTION_URI,\n\t\t{\n\t\t\ttitle: 'Elementor Kit Server Description',\n\t\t\tdescription: 'Elementor Kit capabilities and limitations',\n\t\t\tmimeType: 'text/plain',\n\t\t},\n\t\tasync ( uri ) => ( {\n\t\t\tcontents: [ { uri: uri.href, mimeType: 'text/plain', text: KIT_DESCRIPTION } ],\n\t\t} )\n\t);\n}\n","import { createElementorKitServer } from './elementor-kit-mcp-server';\n\nexport function init() {\n\tcreateElementorKitServer();\n}\n"],"mappings":";AAAA,SAAS,aAAa,WAAW,wBAAwB;AACzD,SAAS,WAAW,4BAA4B,8BAA8B;AAC9E,SAAS,SAAS;;;ACAX,IAAM,sBAAsB;AAE5B,IAAM,kBAAkB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAwBxB,SAAS,0BAA2B,QAAoB;AAC9D,SAAO;AAAA,IACN;AAAA,IACA;AAAA,IACA;AAAA,MACC,OAAO;AAAA,MACP,aAAa;AAAA,MACb,UAAU;AAAA,IACX;AAAA,IACA,OAAQ,SAAW;AAAA,MAClB,UAAU,CAAE,EAAE,KAAK,IAAI,MAAM,UAAU,cAAc,MAAM,gBAAgB,CAAE;AAAA,IAC9E;AAAA,EACD;AACD;;;ADnCA,IAAM,0BAA0B;AAChC,IAAM,yBAAyB;AAC/B,IAAM,2BAA2B;AACjC,IAAM,mCAAmC;AACzC,IAAM,6BAA6B;AACnC,IAAM,4BAA4B;AAQlC,IAAM,UAAU;AAChB,eAAe,gBAAgB;AAC9B,SAAO,UAA+B,iCAAiC,KAAM;AAC9E;AAEA,eAAe,iBAAiB;AAC/B,SAAO,UAAgC,kCAAkC,KAAM;AAChF;AAEA,eAAe,mBAAmB;AACjC,SAAO,UAAW,2BAA2B,KAAM;AACpD;AAMA,eAAe,cACd,kBACA,kBACC;AACD,QAAM,gBAAgB,MAAM,cAAc;AAC1C,QAAM,iBAAiB,OAAO,KAAM,cAAc,KAAK,SAAS,CAAC,CAAE;AACnE,QAAM,eAAyB,CAAC;AAEhC,GAAE,kBAAkB,gBAAiB,EAAE,QAAS,CAAE,eAAgB;A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
"private": false,
|
|
5
5
|
"author": "Elementor Team",
|
|
6
6
|
"homepage": "https://elementor.com/",
|
|
@@ -42,8 +42,8 @@
|
|
|
42
42
|
"tsup": "^8.3.5"
|
|
43
43
|
},
|
|
44
44
|
"dependencies": {
|
|
45
|
-
"@elementor/editor-mcp": "4.2.0-
|
|
46
|
-
"@elementor/elementor-mcp-common": "4.2.0-
|
|
47
|
-
"@elementor/schema": "4.2.0-
|
|
45
|
+
"@elementor/editor-mcp": "4.2.0-843",
|
|
46
|
+
"@elementor/elementor-mcp-common": "4.2.0-843",
|
|
47
|
+
"@elementor/schema": "4.2.0-843"
|
|
48
48
|
}
|
|
49
49
|
}
|
|
@@ -2,6 +2,8 @@ import { getAngieSdk, McpServer, ResourceTemplate } from '@elementor/editor-mcp'
|
|
|
2
2
|
import { callWpApi, requireConfirmationMessage, waitForElementorEditor } from '@elementor/elementor-mcp-common';
|
|
3
3
|
import { z } from '@elementor/schema';
|
|
4
4
|
|
|
5
|
+
import { addKitDescriptionResource, KIT_DESCRIPTION, KIT_DESCRIPTION_URI } from './mcp-description-resource';
|
|
6
|
+
|
|
5
7
|
const RESOURCE_NAME_KIT_FONTS = 'elementor-kit-fonts';
|
|
6
8
|
const RESOURCE_URI_KIT_FONTS = 'elementor://kit/fonts';
|
|
7
9
|
const RESOURCE_NAME_KIT_SCHEMA = 'elementor-kit-schema';
|
|
@@ -141,30 +143,6 @@ const generalPatchSchema = z
|
|
|
141
143
|
'General patch object for any other Elementor kit settings like spacing, buttons, forms, layout settings, etc.'
|
|
142
144
|
);
|
|
143
145
|
|
|
144
|
-
const SERVER_INSTRUCTIONS = `## Elementor Kit Settings Management
|
|
145
|
-
|
|
146
|
-
### Capabilities:
|
|
147
|
-
**Global Design System:**
|
|
148
|
-
- Create, update, name, and delete global colors (both system and custom)
|
|
149
|
-
- Create, update, name, and delete global fonts (both system and custom)
|
|
150
|
-
|
|
151
|
-
**Site Identity:**
|
|
152
|
-
- Insert site logo
|
|
153
|
-
- Set site favicon
|
|
154
|
-
- Update site name
|
|
155
|
-
- Modify site description
|
|
156
|
-
|
|
157
|
-
### Limitations:
|
|
158
|
-
**Theme Style Settings:**
|
|
159
|
-
- Cannot set or update Elementor Theme Style settings including typography, buttons, images, form fields, Hello Theme header, or Hello Theme footer that affect the entire website appearance
|
|
160
|
-
|
|
161
|
-
**Site-Wide Settings:**
|
|
162
|
-
- Cannot set site-wide background (color or image)
|
|
163
|
-
- Cannot configure mobile browser background
|
|
164
|
-
- Cannot modify global layout settings such as content width, container padding, and widget gaps (the default space between widgets)
|
|
165
|
-
|
|
166
|
-
**Note**: Angie can adjust all of these layout properties at the container or page level - just not site-wide.`;
|
|
167
|
-
|
|
168
146
|
export async function createElementorKitServer(): Promise< McpServer > {
|
|
169
147
|
await waitForElementorEditor();
|
|
170
148
|
const server = new McpServer(
|
|
@@ -174,7 +152,7 @@ export async function createElementorKitServer(): Promise< McpServer > {
|
|
|
174
152
|
title: 'Elementor Kit',
|
|
175
153
|
},
|
|
176
154
|
{
|
|
177
|
-
instructions:
|
|
155
|
+
instructions: 'Manages Elementor global design system: colors, typography, and site identity.',
|
|
178
156
|
capabilities: {
|
|
179
157
|
resources: {
|
|
180
158
|
subscribe: true,
|
|
@@ -183,6 +161,8 @@ export async function createElementorKitServer(): Promise< McpServer > {
|
|
|
183
161
|
}
|
|
184
162
|
);
|
|
185
163
|
|
|
164
|
+
addKitDescriptionResource( server );
|
|
165
|
+
|
|
186
166
|
const getAvailableTabs = async (): Promise< string[] > => {
|
|
187
167
|
const kitSchema = await fetchKitSchema();
|
|
188
168
|
return Object.keys( kitSchema.data || {} );
|
|
@@ -331,6 +311,14 @@ The tool will permanently update the site's global design settings and return a
|
|
|
331
311
|
title: 'Update Elementor Kit Settings',
|
|
332
312
|
destructiveHint: true,
|
|
333
313
|
},
|
|
314
|
+
_meta: {
|
|
315
|
+
'angie/requiredResources': [
|
|
316
|
+
{
|
|
317
|
+
uri: KIT_DESCRIPTION_URI,
|
|
318
|
+
whenToUse: 'Read first for kit capabilities and limitations',
|
|
319
|
+
},
|
|
320
|
+
],
|
|
321
|
+
},
|
|
334
322
|
},
|
|
335
323
|
async ( {
|
|
336
324
|
systemColors,
|
|
@@ -388,7 +376,7 @@ The tool will permanently update the site's global design settings and return a
|
|
|
388
376
|
sdk.registerLocalServer( {
|
|
389
377
|
server,
|
|
390
378
|
version: VERSION,
|
|
391
|
-
description:
|
|
379
|
+
description: KIT_DESCRIPTION,
|
|
392
380
|
name: 'elementor-kit-server',
|
|
393
381
|
} );
|
|
394
382
|
return server;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { type McpServer } from '@elementor/editor-mcp';
|
|
2
|
+
|
|
3
|
+
export const KIT_DESCRIPTION_URI = 'elementor://kit/server-description';
|
|
4
|
+
|
|
5
|
+
export const KIT_DESCRIPTION = `## Elementor Kit Settings Management
|
|
6
|
+
|
|
7
|
+
### Capabilities:
|
|
8
|
+
**Global Design System:**
|
|
9
|
+
- Create, update, name, and delete global colors (both system and custom)
|
|
10
|
+
- Create, update, name, and delete global fonts (both system and custom)
|
|
11
|
+
|
|
12
|
+
**Site Identity:**
|
|
13
|
+
- Insert site logo
|
|
14
|
+
- Set site favicon
|
|
15
|
+
- Update site name
|
|
16
|
+
- Modify site description
|
|
17
|
+
|
|
18
|
+
### Limitations:
|
|
19
|
+
**Theme Style Settings:**
|
|
20
|
+
- Cannot set or update Elementor Theme Style settings including typography, buttons, images, form fields, Hello Theme header, or Hello Theme footer that affect the entire website appearance
|
|
21
|
+
|
|
22
|
+
**Site-Wide Settings:**
|
|
23
|
+
- Cannot set site-wide background (color or image)
|
|
24
|
+
- Cannot configure mobile browser background
|
|
25
|
+
- Cannot modify global layout settings such as content width, container padding, and widget gaps (the default space between widgets)
|
|
26
|
+
|
|
27
|
+
**Note**: Angie can adjust all of these layout properties at the container or page level - just not site-wide.`;
|
|
28
|
+
|
|
29
|
+
export function addKitDescriptionResource( server: McpServer ) {
|
|
30
|
+
server.registerResource(
|
|
31
|
+
'elementor-kit-server-description',
|
|
32
|
+
KIT_DESCRIPTION_URI,
|
|
33
|
+
{
|
|
34
|
+
title: 'Elementor Kit Server Description',
|
|
35
|
+
description: 'Elementor Kit capabilities and limitations',
|
|
36
|
+
mimeType: 'text/plain',
|
|
37
|
+
},
|
|
38
|
+
async ( uri ) => ( {
|
|
39
|
+
contents: [ { uri: uri.href, mimeType: 'text/plain', text: KIT_DESCRIPTION } ],
|
|
40
|
+
} )
|
|
41
|
+
);
|
|
42
|
+
}
|