@dynatrace-oss/dynatrace-mcp-server 1.7.2-dev.20260323072603 → 1.7.2

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.
Files changed (3) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/index.js +23 -7
  3. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -2,6 +2,10 @@
2
2
 
3
3
  ## Unreleased Changes
4
4
 
5
+ ## 1.7.2
6
+
7
+ - Fixed: Empty string values for `OAUTH_CLIENT_ID`, `OAUTH_CLIENT_SECRET`, and `DT_PLATFORM_TOKEN` environment variables are now treated as unset, preventing authentication failures when tools like Claude Desktop set blank fields to `""`. A warning is logged when an empty string is detected.
8
+
5
9
  ## 1.7.1
6
10
 
7
11
  - Fixed MCPB bundle file not working on Claude Desktop
package/index.js CHANGED
@@ -115306,7 +115306,7 @@ var {
115306
115306
  } = import_index2.default;
115307
115307
 
115308
115308
  // package.json
115309
- var version2 = "1.7.2-dev.20260323072603";
115309
+ var version2 = "1.7.2";
115310
115310
 
115311
115311
  // src/utils/version.ts
115312
115312
  function getPackageJsonVersion() {
@@ -116512,10 +116512,17 @@ var chatWithDavisCopilot = async (dtClient, text, context, annotations, state) =
116512
116512
  };
116513
116513
 
116514
116514
  // src/getDynatraceEnv.ts
116515
+ function normalizeOptionalEnvVar(name, value) {
116516
+ if (value === "") {
116517
+ console.warn(`\u26A0\uFE0F ${name} is set to an empty string \u2013 ignoring it and treating it as unset.`);
116518
+ return void 0;
116519
+ }
116520
+ return value;
116521
+ }
116515
116522
  function getDynatraceEnv(env = process.env) {
116516
- const oauthClientId = env.OAUTH_CLIENT_ID;
116517
- const oauthClientSecret = env.OAUTH_CLIENT_SECRET;
116518
- const dtPlatformToken = env.DT_PLATFORM_TOKEN;
116523
+ const oauthClientId = normalizeOptionalEnvVar("OAUTH_CLIENT_ID", env.OAUTH_CLIENT_ID);
116524
+ const oauthClientSecret = normalizeOptionalEnvVar("OAUTH_CLIENT_SECRET", env.OAUTH_CLIENT_SECRET);
116525
+ const dtPlatformToken = normalizeOptionalEnvVar("DT_PLATFORM_TOKEN", env.DT_PLATFORM_TOKEN);
116519
116526
  const dtEnvironment = env.DT_ENVIRONMENT;
116520
116527
  const slackConnectionId = env.SLACK_CONNECTION_ID || "fake-slack-connection-id";
116521
116528
  let grailBudgetGB = parseFloat(env.DT_GRAIL_QUERY_BUDGET_GB || "1000");
@@ -116620,7 +116627,8 @@ var DynatraceMcpTelemetry = class {
116620
116627
  os_type: os.type(),
116621
116628
  os_release: os.release(),
116622
116629
  environment_id: this.environmentInfo.environmentId,
116623
- stage: this.environmentInfo.stage
116630
+ stage: this.environmentInfo.stage,
116631
+ auth_type: this.environmentInfo.authType
116624
116632
  };
116625
116633
  }
116626
116634
  /**
@@ -116991,7 +116999,15 @@ var main = async () => {
116991
116999
  console.error("No OAuth credentials or platform token provided - switching to OAuth authorization code flow.");
116992
117000
  oauthClientId = DT_MCP_AUTH_CODE_FLOW_OAUTH_CLIENT_ID;
116993
117001
  }
116994
- const environmentInfo = parseEnvironmentUrl(dtEnvironment);
117002
+ let authType;
117003
+ if (dtPlatformToken) {
117004
+ authType = "platform_token";
117005
+ } else if (oauthClientId && oauthClientSecret) {
117006
+ authType = "oauth_client_credentials_flow";
117007
+ } else {
117008
+ authType = "oauth_authorization_code_flow";
117009
+ }
117010
+ const environmentInfo = { ...parseEnvironmentUrl(dtEnvironment), authType };
116995
117011
  const telemetry = createTelemetry(environmentInfo);
116996
117012
  await telemetry.trackMcpServerStart();
116997
117013
  const shutdownHandler = (...shutdownOps) => {
@@ -118268,7 +118284,7 @@ Next Steps:
118268
118284
  main().catch(async (error46) => {
118269
118285
  console.error("Fatal error in main():", error46);
118270
118286
  try {
118271
- const telemetry = createTelemetry({ environmentId: "unknown", stage: "unknown" });
118287
+ const telemetry = createTelemetry({ environmentId: "unknown", stage: "unknown", authType: "unknown" });
118272
118288
  await telemetry.trackError(error46, "main_error");
118273
118289
  await telemetry.shutdown();
118274
118290
  } catch (e2) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dynatrace-oss/dynatrace-mcp-server",
3
- "version": "1.7.2-dev.20260323072603",
3
+ "version": "1.7.2",
4
4
  "mcpName": "io.github.dynatrace-oss/Dynatrace-mcp",
5
5
  "description": "Model Context Protocol (MCP) server for Dynatrace",
6
6
  "keywords": [