@salesforce/mcp 0.22.1 → 0.23.1

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 (2) hide show
  1. package/lib/telemetry.js +21 -0
  2. package/package.json +3 -3
package/lib/telemetry.js CHANGED
@@ -16,13 +16,30 @@
16
16
  import { randomBytes } from 'node:crypto';
17
17
  import { readFileSync } from 'node:fs';
18
18
  import { join } from 'node:path';
19
+ import * as os from 'node:os';
19
20
  import { TelemetryReporter } from '@salesforce/telemetry';
20
21
  import { warn } from '@oclif/core/ux';
21
22
  const PROJECT = 'salesforce-mcp-server';
22
23
  // WARN: This is intentionally empty! It's populated at the time of publish
23
24
  // This is to prevent telemetry pollution from local clones and forks
24
25
  const APP_INSIGHTS_KEY = 'InstrumentationKey=2ca64abb-6123-4c7b-bd9e-4fe73e71fe9c;IngestionEndpoint=https://eastus-1.in.applicationinsights.azure.com/;LiveEndpoint=https://eastus.livediagnostics.monitor.azure.com/;ApplicationId=ecd8fa7a-0e0d-4109-94db-4d7878ada862';
26
+ const O11Y_UPLOAD_ENDPOINT = 'https://794testsite.my.site.com/byolwr/webruntime/log/metrics';
25
27
  const generateRandomId = () => randomBytes(20).toString('hex');
28
+ /**
29
+ * Check if the current host is an internal Salesforce environment
30
+ */
31
+ function isInternalHost() {
32
+ return os.hostname().endsWith('internal.salesforce.com');
33
+ }
34
+ /**
35
+ * Get internal Salesforce environment properties
36
+ */
37
+ function getInternalProperties() {
38
+ return {
39
+ 'sfInternal.hostname': os.hostname(),
40
+ 'sfInternal.username': os.userInfo().username,
41
+ };
42
+ }
26
43
  const getCliId = (cacheDir) => {
27
44
  // We need to find sf's cache directory and read the CLIID.txt file from there.
28
45
  // The problem is that sf's cache directory is OS specific and we don't want to
@@ -101,6 +118,8 @@ export class Telemetry {
101
118
  date: new Date().toUTCString(),
102
119
  timestamp: String(Date.now()),
103
120
  processUptime: process.uptime() * 1000,
121
+ // Internal Properties (only in internal Salesforce environments)
122
+ ...(isInternalHost() ? getInternalProperties() : {}),
104
123
  });
105
124
  }
106
125
  catch {
@@ -119,6 +138,8 @@ export class Telemetry {
119
138
  key: APP_INSIGHTS_KEY,
120
139
  userId: this.cliId,
121
140
  waitForConnection: true,
141
+ o11yUploadEndpoint: O11Y_UPLOAD_ENDPOINT,
142
+ enableO11y: true,
122
143
  });
123
144
  this.reporter.start();
124
145
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforce/mcp",
3
- "version": "0.22.1",
3
+ "version": "0.23.1",
4
4
  "description": "MCP Server for interacting with Salesforce instances",
5
5
  "bin": {
6
6
  "sf-mcp-server": "bin/run.js"
@@ -46,10 +46,10 @@
46
46
  "@salesforce/mcp-provider-lwc-experts": "0.6.0",
47
47
  "@salesforce/mcp-provider-aura-experts": "0.3.3",
48
48
  "@salesforce/mcp-provider-mobile-web": "0.2.0",
49
- "@salesforce/mcp-provider-devops": "0.1.5",
49
+ "@salesforce/mcp-provider-devops": "0.1.6",
50
50
  "@salesforce/source-deploy-retrieve": "^12.22.0",
51
51
  "@salesforce/source-tracking": "^7.4.8",
52
- "@salesforce/telemetry": "^6.1.0",
52
+ "@salesforce/telemetry": "^6.2.6",
53
53
  "@salesforce/ts-types": "^2.0.11",
54
54
  "zod": "^3.25.76"
55
55
  },