@elementor/elementor-kit-mcp 4.2.0-940 → 4.2.0-941
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 +3 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +3 -2
- package/dist/index.mjs.map +1 -1
- package/package.json +4 -4
- package/src/elementor-kit-mcp-server.ts +4 -3
package/dist/index.js
CHANGED
|
@@ -164,6 +164,7 @@ var customTypographySchema = import_schema.z.array(customTypographyItemSchema);
|
|
|
164
164
|
var generalPatchSchema = import_schema.z.record(import_schema.z.unknown()).describe(
|
|
165
165
|
"General patch object for any other Elementor kit settings like spacing, buttons, forms, layout settings, etc."
|
|
166
166
|
);
|
|
167
|
+
var SERVER_INSTRUCTIONS = "Manages Elementor global design system: colors, typography, and site identity.";
|
|
167
168
|
async function createElementorKitServer() {
|
|
168
169
|
await (0, import_elementor_mcp_common.waitForElementorEditor)();
|
|
169
170
|
const server = new import_editor_mcp.McpServer(
|
|
@@ -173,7 +174,7 @@ async function createElementorKitServer() {
|
|
|
173
174
|
title: "Elementor Kit"
|
|
174
175
|
},
|
|
175
176
|
{
|
|
176
|
-
instructions:
|
|
177
|
+
instructions: SERVER_INSTRUCTIONS,
|
|
177
178
|
capabilities: {
|
|
178
179
|
resources: {
|
|
179
180
|
subscribe: true
|
|
@@ -360,7 +361,7 @@ The tool will permanently update the site's global design settings and return a
|
|
|
360
361
|
sdk.registerLocalServer({
|
|
361
362
|
server,
|
|
362
363
|
version: VERSION,
|
|
363
|
-
description:
|
|
364
|
+
description: SERVER_INSTRUCTIONS,
|
|
364
365
|
name: "elementor-kit-server"
|
|
365
366
|
});
|
|
366
367
|
return server;
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
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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AAA,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;;;AE5XO,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_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\nconst SERVER_INSTRUCTIONS = 'Manages Elementor global design system: colors, typography, and site identity.';\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\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: SERVER_INSTRUCTIONS,\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,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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A,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACD,MAAO;AACN,kEAA4B,qBAAqB,wBAAyB;AAE1E,YAAM,eAAe,MAAM,cAAe,kBAAkB,gBAAiB;AAC7E,UAAK,cAAe;AACnB,cAAM,IAAI,MAAO,YAAa;AAAA,MAC/B;AAEA,YAAM,sBAAsB;AAAA,QAC3B,GAAK,gBAAgB,EAAE,eAAe,aAAa;AAAA,QACnD,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;;;AE7XO,SAAS,OAAO;AACtB,2BAAyB;AAC1B;","names":[]}
|
package/dist/index.mjs
CHANGED
|
@@ -137,6 +137,7 @@ var customTypographySchema = z.array(customTypographyItemSchema);
|
|
|
137
137
|
var generalPatchSchema = z.record(z.unknown()).describe(
|
|
138
138
|
"General patch object for any other Elementor kit settings like spacing, buttons, forms, layout settings, etc."
|
|
139
139
|
);
|
|
140
|
+
var SERVER_INSTRUCTIONS = "Manages Elementor global design system: colors, typography, and site identity.";
|
|
140
141
|
async function createElementorKitServer() {
|
|
141
142
|
await waitForElementorEditor();
|
|
142
143
|
const server = new McpServer(
|
|
@@ -146,7 +147,7 @@ async function createElementorKitServer() {
|
|
|
146
147
|
title: "Elementor Kit"
|
|
147
148
|
},
|
|
148
149
|
{
|
|
149
|
-
instructions:
|
|
150
|
+
instructions: SERVER_INSTRUCTIONS,
|
|
150
151
|
capabilities: {
|
|
151
152
|
resources: {
|
|
152
153
|
subscribe: true
|
|
@@ -333,7 +334,7 @@ The tool will permanently update the site's global design settings and return a
|
|
|
333
334
|
sdk.registerLocalServer({
|
|
334
335
|
server,
|
|
335
336
|
version: VERSION,
|
|
336
|
-
description:
|
|
337
|
+
description: SERVER_INSTRUCTIONS,
|
|
337
338
|
name: "elementor-kit-server"
|
|
338
339
|
});
|
|
339
340
|
return server;
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
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,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D;AAAA,MACD;AAAA,IACD;AAAA,IACA,OAAQ;AAAA,MACP;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACD,MAAO;AACN,iCAA4B,qBAAqB,wBAAyB;AAE1E,YAAM,eAAe,MAAM,cAAe,kBAAkB,gBAAiB;AAC7E,UAAK,cAAe;AACnB,cAAM,IAAI,MAAO,YAAa;AAAA,MAC/B;AAEA,YAAM,sBAAsB;AAAA,QAC3B,GAAK,gBAAgB,EAAE,eAAe,aAAa;AAAA,QACnD,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,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;;;AE5XO,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_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\nconst SERVER_INSTRUCTIONS = 'Manages Elementor global design system: colors, typography, and site identity.';\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\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: SERVER_INSTRUCTIONS,\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,MA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AAA,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;;;AE7XO,SAAS,OAAO;AACtB,2BAAyB;AAC1B;","names":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elementor/elementor-kit-mcp",
|
|
3
|
-
"version": "4.2.0-
|
|
3
|
+
"version": "4.2.0-941",
|
|
4
4
|
"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-941",
|
|
46
|
+
"@elementor/elementor-mcp-common": "4.2.0-941",
|
|
47
|
+
"@elementor/schema": "4.2.0-941"
|
|
48
48
|
}
|
|
49
49
|
}
|
|
@@ -2,7 +2,7 @@ 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,
|
|
5
|
+
import { addKitDescriptionResource, KIT_DESCRIPTION_URI } from './mcp-description-resource';
|
|
6
6
|
|
|
7
7
|
const RESOURCE_NAME_KIT_FONTS = 'elementor-kit-fonts';
|
|
8
8
|
const RESOURCE_URI_KIT_FONTS = 'elementor://kit/fonts';
|
|
@@ -143,6 +143,7 @@ const generalPatchSchema = z
|
|
|
143
143
|
'General patch object for any other Elementor kit settings like spacing, buttons, forms, layout settings, etc.'
|
|
144
144
|
);
|
|
145
145
|
|
|
146
|
+
const SERVER_INSTRUCTIONS = 'Manages Elementor global design system: colors, typography, and site identity.';
|
|
146
147
|
export async function createElementorKitServer(): Promise< McpServer > {
|
|
147
148
|
await waitForElementorEditor();
|
|
148
149
|
const server = new McpServer(
|
|
@@ -152,7 +153,7 @@ export async function createElementorKitServer(): Promise< McpServer > {
|
|
|
152
153
|
title: 'Elementor Kit',
|
|
153
154
|
},
|
|
154
155
|
{
|
|
155
|
-
instructions:
|
|
156
|
+
instructions: SERVER_INSTRUCTIONS,
|
|
156
157
|
capabilities: {
|
|
157
158
|
resources: {
|
|
158
159
|
subscribe: true,
|
|
@@ -376,7 +377,7 @@ The tool will permanently update the site's global design settings and return a
|
|
|
376
377
|
sdk.registerLocalServer( {
|
|
377
378
|
server,
|
|
378
379
|
version: VERSION,
|
|
379
|
-
description:
|
|
380
|
+
description: SERVER_INSTRUCTIONS,
|
|
380
381
|
name: 'elementor-kit-server',
|
|
381
382
|
} );
|
|
382
383
|
return server;
|