@umbraco-cms/mcp-dev 18.1.8 → 18.1.10

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-O6YXPPS2.js";
12
+ } from "./chunk-B47BCEST.js";
13
13
 
14
14
  // node_modules/ajv/dist/compile/codegen/code.js
15
15
  var require_code = __commonJS({
@@ -4126,13 +4126,14 @@ var require_fast_uri = __commonJS({
4126
4126
  if (!malformedIPLiteral) {
4127
4127
  malformedHost = canonicalizeHost(parsed, options, schemeHandler, isIP);
4128
4128
  }
4129
- if (!schemeHandler || schemeHandler && !schemeHandler.skipNormalize) {
4130
- if (uri.indexOf("%") !== -1) {
4131
- if (parsed.host !== void 0 && !malformedIPLiteral) {
4132
- const host = isIP ? parsed.host : normalizePercentEncoding(parsed.host, true);
4133
- parsed.host = reescapeHostDelimiters(host, isIP);
4134
- }
4129
+ if (uri.indexOf("%") !== -1 && parsed.host !== void 0 && !malformedIPLiteral) {
4130
+ let host = isIP ? parsed.host : normalizePercentEncoding(parsed.host, true);
4131
+ if (!isIP) {
4132
+ host = normalizePercentEncoding(host.toLowerCase());
4135
4133
  }
4134
+ parsed.host = reescapeHostDelimiters(host, isIP);
4135
+ }
4136
+ if (!schemeHandler || schemeHandler && !schemeHandler.skipNormalize) {
4136
4137
  if (parsed.path) {
4137
4138
  parsed.path = normalizePathEncoding(parsed.path);
4138
4139
  }
@@ -12905,7 +12906,7 @@ var StdioServerTransport = class {
12905
12906
  // package.json
12906
12907
  var package_default = {
12907
12908
  name: "@umbraco-cms/mcp-dev",
12908
- version: "18.1.8",
12909
+ version: "18.1.10",
12909
12910
  type: "module",
12910
12911
  description: "A model context protocol (MCP) server for Umbraco CMS",
12911
12912
  main: "dist/index.js",
@@ -12949,7 +12950,7 @@ var package_default = {
12949
12950
  "dev:hosted": "wrangler dev"
12950
12951
  },
12951
12952
  engines: {
12952
- node: ">=22.0.0"
12953
+ node: ">=22.3.0"
12953
12954
  },
12954
12955
  files: [
12955
12956
  "dist",
@@ -12977,8 +12978,8 @@ var package_default = {
12977
12978
  "@modelcontextprotocol/sdk": "^1.28.0",
12978
12979
  "@types/uuid": "^10.0.0",
12979
12980
  "@types/yargs": "^17.0.33",
12980
- "@umbraco-cms/mcp-hosted": "^1.0.0-beta.45",
12981
- "@umbraco-cms/mcp-server-sdk": "^1.0.0-beta.45",
12981
+ "@umbraco-cms/mcp-hosted": "^1.0.0-beta.47",
12982
+ "@umbraco-cms/mcp-server-sdk": "^1.0.0-beta.47",
12982
12983
  dotenv: "^16.5.0",
12983
12984
  "form-data": "^4.0.4",
12984
12985
  "mime-types": "^3.0.1",
@@ -13171,9 +13172,9 @@ function UmbracoToolFactory(server, user, serverConfig) {
13171
13172
  ToolRegistrar.registerTools(server, user, tools, config, readonlyMode, filteredTools);
13172
13173
  });
13173
13174
  if (readonlyMode && filteredTools.length > 0) {
13174
- console.log(`
13175
+ console.error(`
13175
13176
  Readonly mode: Disabled ${filteredTools.length} write tools:`);
13176
- console.log(` ${filteredTools.join(", ")}`);
13177
+ console.error(` ${filteredTools.join(", ")}`);
13177
13178
  }
13178
13179
  }
13179
13180
 
@@ -13193,6 +13194,31 @@ var main = async () => {
13193
13194
  configureApiClient(() => UmbracoManagementClient.getClient());
13194
13195
  const client = UmbracoManagementClient.getClient();
13195
13196
  const user = await client.getUserCurrent();
13197
+ let serverInfo;
13198
+ let serverInfoError;
13199
+ try {
13200
+ serverInfo = await client.getServerInformation();
13201
+ } catch (error) {
13202
+ serverInfoError = error;
13203
+ }
13204
+ if (serverInfo) {
13205
+ setUmbracoVersion(serverInfo.version);
13206
+ }
13207
+ await checkUmbracoVersion({
13208
+ mcpVersion: package_default.version,
13209
+ // UMBRACO_TARGET_MAJOR is stamped into src/config/umbraco-target.generated.ts
13210
+ // by the orval target-major transformer, from the Umbraco instance the API
13211
+ // client was generated against. Override to point at a different major.
13212
+ // (`?.trim() ||`, not `??`: an env var set to an empty string must still
13213
+ // fall back, or the check silently no-ops with no log output at all.)
13214
+ expectedUmbracoMajor: process.env.UMBRACO_EXPECTED_MAJOR?.trim() || UMBRACO_TARGET_MAJOR,
13215
+ client: {
13216
+ getServerInformation: async () => {
13217
+ if (serverInfo) return serverInfo;
13218
+ throw serverInfoError ?? new Error("Unable to fetch Umbraco server information");
13219
+ }
13220
+ }
13221
+ });
13196
13222
  const rawConfig = await getServerConfig2(true);
13197
13223
  const configLoader2 = createCollectionConfigLoader2({
13198
13224
  modeRegistry: allModes,
@@ -13208,18 +13234,6 @@ var main = async () => {
13208
13234
  filterConfig,
13209
13235
  serverConfig: config
13210
13236
  });
13211
- const serverInfo = await client.getServerInformation();
13212
- setUmbracoVersion(serverInfo.version);
13213
- await checkUmbracoVersion({
13214
- mcpVersion: package_default.version,
13215
- // UMBRACO_TARGET_MAJOR is stamped into src/config/umbraco-target.generated.ts
13216
- // by the orval target-major transformer, from the Umbraco instance the API
13217
- // client was generated against. Override to point at a different major.
13218
- // (`?.trim() ||`, not `??`: an env var set to an empty string must still
13219
- // fall back, or the check silently no-ops with no log output at all.)
13220
- expectedUmbracoMajor: process.env.UMBRACO_EXPECTED_MAJOR?.trim() || UMBRACO_TARGET_MAJOR,
13221
- client: { getServerInformation: async () => serverInfo }
13222
- });
13223
13237
  configureVersionCheckHook();
13224
13238
  const versionCheckMessage = getVersionCheckMessage();
13225
13239
  const server = new McpServer(