@umbraco-cms/mcp-dev 18.0.2 → 18.1.0

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 CHANGED
@@ -9,7 +9,7 @@ import {
9
9
  availableCollections,
10
10
  setAllowFilePathUploads,
11
11
  setUmbracoVersion
12
- } from "./chunk-WQUG24BZ.js";
12
+ } from "./chunk-MMATLZNV.js";
13
13
 
14
14
  // node_modules/ajv/dist/compile/codegen/code.js
15
15
  var require_code = __commonJS({
@@ -3622,7 +3622,12 @@ var require_fast_uri = __commonJS({
3622
3622
  }
3623
3623
  function resolve(baseURI, relativeURI, options) {
3624
3624
  const schemelessOptions = options ? Object.assign({ scheme: "null" }, options) : { scheme: "null" };
3625
- const resolved = resolveComponent(parse(baseURI, schemelessOptions), parse(relativeURI, schemelessOptions), schemelessOptions, true);
3625
+ const { parsed: baseParsed, malformedAuthorityOrPort: baseMalformed } = parseWithStatus(baseURI, schemelessOptions);
3626
+ const { parsed: relativeParsed, malformedAuthorityOrPort: relativeMalformed } = parseWithStatus(relativeURI, schemelessOptions);
3627
+ if (baseMalformed || relativeMalformed) {
3628
+ throw new Error(baseParsed.error || relativeParsed.error || "URI is malformed.");
3629
+ }
3630
+ const resolved = resolveComponent(baseParsed, relativeParsed, schemelessOptions, true);
3626
3631
  schemelessOptions.skipEscape = true;
3627
3632
  return serialize(resolved, schemelessOptions);
3628
3633
  }
@@ -3748,6 +3753,7 @@ var require_fast_uri = __commonJS({
3748
3753
  }
3749
3754
  var URI_PARSE = /^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;
3750
3755
  var AUTHORITY_PREFIX = /^(?:[^#/:?]+:)?\/\/([^/?#]*)/;
3756
+ var AUTHORITY_INTRODUCER_REGION = /^(?:[^#/:?]+:)?([/\\\t\n\r]*)/;
3751
3757
  function getParseError(parsed, matches) {
3752
3758
  if (matches[2] !== void 0 && parsed.path && parsed.path[0] !== "/") {
3753
3759
  return 'URI path must start with "/" when authority is present.';
@@ -3782,6 +3788,20 @@ var require_fast_uri = __commonJS({
3782
3788
  parsed.error = "URI authority must not contain a literal backslash.";
3783
3789
  malformedAuthorityOrPort = true;
3784
3790
  }
3791
+ const introducerMatch = uri.match(AUTHORITY_INTRODUCER_REGION);
3792
+ if (introducerMatch !== null) {
3793
+ const region = introducerMatch[1];
3794
+ const normalizedRegion = region.replace(/[\t\n\r]/g, "");
3795
+ if (normalizedRegion.length >= 2) {
3796
+ if (normalizedRegion.slice(0, 2) !== "//") {
3797
+ parsed.error = parsed.error || "URI authority must not contain a literal backslash.";
3798
+ malformedAuthorityOrPort = true;
3799
+ } else if (region.length !== normalizedRegion.length) {
3800
+ parsed.error = parsed.error || "URI authority introducer must not contain whitespace.";
3801
+ malformedAuthorityOrPort = true;
3802
+ }
3803
+ }
3804
+ }
3785
3805
  const matches = uri.match(URI_PARSE);
3786
3806
  if (matches) {
3787
3807
  parsed.scheme = matches[1];
@@ -12517,7 +12537,7 @@ var StdioServerTransport = class {
12517
12537
  // package.json
12518
12538
  var package_default = {
12519
12539
  name: "@umbraco-cms/mcp-dev",
12520
- version: "18.0.2",
12540
+ version: "18.1.0",
12521
12541
  type: "module",
12522
12542
  description: "A model context protocol (MCP) server for Umbraco CMS",
12523
12543
  main: "dist/index.js",
@@ -12542,7 +12562,7 @@ var package_default = {
12542
12562
  compile: "tsc --noEmit",
12543
12563
  watch: "tsup --config tsup.config.ts --watch",
12544
12564
  generate: "orval --config orval.config.ts",
12545
- inspect: "npx @modelcontextprotocol/inspector node dist/index.js",
12565
+ inspect: "npx @modelcontextprotocol/inspector@1 node dist/index.js",
12546
12566
  test: "node --experimental-vm-modules node_modules/jest/bin/jest.js",
12547
12567
  "test:all": "npm run build && npm run test && npm run test:evals",
12548
12568
  "test:one": "node --experimental-vm-modules node_modules/jest/bin/jest.js --runInBand --forceExit",
@@ -12589,8 +12609,8 @@ var package_default = {
12589
12609
  "@modelcontextprotocol/sdk": "^1.28.0",
12590
12610
  "@types/uuid": "^10.0.0",
12591
12611
  "@types/yargs": "^17.0.33",
12592
- "@umbraco-cms/mcp-hosted": "^1.0.0-beta.31",
12593
- "@umbraco-cms/mcp-server-sdk": "^1.0.0-beta.31",
12612
+ "@umbraco-cms/mcp-hosted": "^1.0.0-beta.35",
12613
+ "@umbraco-cms/mcp-server-sdk": "^1.0.0-beta.35",
12594
12614
  dotenv: "^16.5.0",
12595
12615
  "form-data": "^4.0.4",
12596
12616
  "mime-types": "^3.0.1",
@@ -12603,6 +12623,7 @@ var package_default = {
12603
12623
  "@anthropic-ai/claude-agent-sdk": "0.2.39",
12604
12624
  "@cloudflare/workers-oauth-provider": "^0.2.3",
12605
12625
  "@jest/types": "^29.6.3",
12626
+ "@modelcontextprotocol/inspector": "^1.0.1",
12606
12627
  "@playwright/test": "^1.58.2",
12607
12628
  "@types/dotenv": "^6.1.1",
12608
12629
  "@types/jest": "^29.5.14",
@@ -12789,7 +12810,12 @@ Readonly mode: Disabled ${filteredTools.length} write tools:`);
12789
12810
  }
12790
12811
 
12791
12812
  // src/index.ts
12792
- import { checkUmbracoVersion, configureApiClient, initializeUmbracoFetch, getServerConfig as getServerConfig2, handleCliCommands, createCollectionConfigLoader as createCollectionConfigLoader2 } from "@umbraco-cms/mcp-server-sdk";
12813
+ import { checkUmbracoVersion, configureVersionCheckHook, getVersionCheckMessage, configureApiClient, initializeUmbracoFetch, getServerConfig as getServerConfig2, handleCliCommands, createCollectionConfigLoader as createCollectionConfigLoader2 } from "@umbraco-cms/mcp-server-sdk";
12814
+
12815
+ // src/config/umbraco-target.generated.ts
12816
+ var UMBRACO_TARGET_MAJOR = "18";
12817
+
12818
+ // src/index.ts
12793
12819
  var main = async () => {
12794
12820
  setAllowFilePathUploads(true);
12795
12821
  clearConfigCache();
@@ -12797,10 +12823,6 @@ var main = async () => {
12797
12823
  const config = serverConfig.umbraco;
12798
12824
  initializeUmbracoFetch(config.auth);
12799
12825
  configureApiClient(() => UmbracoManagementClient.getClient());
12800
- const server = new McpServer({
12801
- name: "Umbraco CMS Developer MCP Server",
12802
- version: package_default.version
12803
- });
12804
12826
  const client = UmbracoManagementClient.getClient();
12805
12827
  const user = await client.getUserCurrent();
12806
12828
  const rawConfig = await getServerConfig2(true);
@@ -12822,8 +12844,23 @@ var main = async () => {
12822
12844
  setUmbracoVersion(serverInfo.version);
12823
12845
  await checkUmbracoVersion({
12824
12846
  mcpVersion: package_default.version,
12847
+ // UMBRACO_TARGET_MAJOR is stamped into src/config/umbraco-target.generated.ts
12848
+ // by the orval target-major transformer, from the Umbraco instance the API
12849
+ // client was generated against. Override to point at a different major.
12850
+ // (`?.trim() ||`, not `??`: an env var set to an empty string must still
12851
+ // fall back, or the check silently no-ops with no log output at all.)
12852
+ expectedUmbracoMajor: process.env.UMBRACO_EXPECTED_MAJOR?.trim() || UMBRACO_TARGET_MAJOR,
12825
12853
  client: { getServerInformation: async () => serverInfo }
12826
12854
  });
12855
+ configureVersionCheckHook();
12856
+ const versionCheckMessage = getVersionCheckMessage();
12857
+ const server = new McpServer(
12858
+ {
12859
+ name: "Umbraco CMS Developer MCP Server",
12860
+ version: package_default.version
12861
+ },
12862
+ versionCheckMessage ? { instructions: versionCheckMessage } : void 0
12863
+ );
12827
12864
  UmbracoToolFactory(server, user, config);
12828
12865
  const transport = new StdioServerTransport();
12829
12866
  await server.connect(transport);