@sonisoft/now-sdk-ext-mcp 4.8.1 → 4.8.3

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/README.md CHANGED
@@ -521,6 +521,12 @@ Since stdout is reserved for JSON-RPC, **never use `console.log()` in server cod
521
521
  - Every tool that talks to ServiceNow should accept an optional `instance` parameter
522
522
  - Test every tool through the MCP client (not by calling handler functions directly) so the full protocol stack is exercised
523
523
 
524
+ ## ServiceNow SDK upgrades
525
+
526
+ New `@servicenow/sdk` releases are rolled through sn-credstore, core, the CLI and the MCP
527
+ server by a scheduled routine. Its runbook and scripts (`scripts/sdk-watch/`) are described in
528
+ [docs/SDK_UPGRADE_ROUTINE.md](docs/SDK_UPGRADE_ROUTINE.md).
529
+
524
530
  ## License
525
531
 
526
532
  MIT
@@ -1 +1 @@
1
- {"version":3,"file":"logging.d.ts","sourceRoot":"","sources":["../../src/common/logging.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAE,MAAM,EAAiC,MAAM,4BAA4B,CAAC;AAKnF;;;;;;GAMG;AACH,wBAAgB,WAAW,IAAI,IAAI,CA2BlC;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAE9C"}
1
+ {"version":3,"file":"logging.d.ts","sourceRoot":"","sources":["../../src/common/logging.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAGH,OAAO,EAAE,MAAM,EAAiC,MAAM,4BAA4B,CAAC;AAgBnF;;;;;;GAMG;AACH,wBAAgB,WAAW,IAAI,IAAI,CA4DlC;AAWD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAE9C"}
@@ -15,8 +15,13 @@
15
15
  * stdout is the JSON-RPC transport. Everything here goes to stderr, and nothing in this
16
16
  * process may ever write to fd 1.
17
17
  */
18
+ import { createRequire } from "node:module";
18
19
  import { Logger, configureLogging, redactValue } from "@sonisoft/now-sdk-ext-core";
19
20
  import { logger as sdkLogger } from "@servicenow/sdk-cli/dist/logger/index.js";
21
+ /** The SDK logger module, wherever it was installed. */
22
+ const SDK_LOGGER_PATH = /@servicenow[\\/]sdk-cli[\\/]dist[\\/]logger[\\/]index\.js$/;
23
+ const isSdkLogger = (value) => typeof value?.setLevel === "function"
24
+ && ["info", "warn", "error", "debug"].every(level => typeof value[level] === "function");
20
25
  let configured = false;
21
26
  /**
22
27
  * Configures process-wide logging. Call once, before anything constructs a manager.
@@ -40,22 +45,64 @@ export function initLogging() {
40
45
  // resolves those; naming them here would override an operator's NEX_LOG_FILE=0.
41
46
  });
42
47
  const sdkLog = getLogger("ServiceNow SDK");
43
- sdkLogger.setLevel("silent");
44
- for (const level of ["info", "warn", "error", "debug"]) {
45
- sdkLogger[level] = (...args) => {
46
- const message = args.map(arg => {
47
- if (typeof arg === "string")
48
- return arg;
49
- try {
50
- return JSON.stringify(redactValue(arg)) ?? String(arg);
51
- }
52
- catch {
53
- return "[unserializable]";
54
- }
55
- }).join(" ");
56
- sdkLog[level](message || "ServiceNow SDK");
57
- };
48
+ // Every copy of the SDK's logger, not just the one this package resolves. When this
49
+ // package's @servicenow/sdk-cli and core's differ, core loads its own copy, and that
50
+ // is the copy that refreshes OAuth tokens. Unpatched, it printed "[now-sdk] Access
51
+ // Token has expired, refreshing token" through console.log, onto fd 1. Core has
52
+ // already been imported by now, so its copy is in the module cache.
53
+ //
54
+ // This finds CommonJS copies only (require.cache), which is what the SDK ships today.
55
+ // Should a release move its logger to ESM, the console backstop below still catches
56
+ // its console.log output, and scripts/sdk-watch/stdio-smoke.mjs checks fd 1 directly.
57
+ const cache = createRequire(import.meta.url).cache;
58
+ const copies = new Set(isSdkLogger(sdkLogger) ? [sdkLogger] : []);
59
+ for (const [path, mod] of Object.entries(cache)) {
60
+ const exported = mod?.exports?.logger;
61
+ if (SDK_LOGGER_PATH.test(path) && isSdkLogger(exported))
62
+ copies.add(exported);
58
63
  }
64
+ for (const copy of copies) {
65
+ copy.setLevel("silent");
66
+ for (const level of ["info", "warn", "error", "debug"]) {
67
+ copy[level] = (...args) => sdkLog[level](toMessage(args) || "ServiceNow SDK");
68
+ }
69
+ }
70
+ // And a backstop for anything else that reaches for console.log, info or debug: a
71
+ // copy loaded later, or another library. Those write to stdout; route them to stderr
72
+ // through the redacting logger instead. warn and error already go to stderr. Core's
73
+ // logger writes to a process.stderr stream, never console, so this cannot recurse;
74
+ // the guard keeps it that way if that ever changes.
75
+ const consoleLog = getLogger("console");
76
+ let routing = false;
77
+ const route = (level) => (...args) => {
78
+ if (routing) {
79
+ process.stderr.write(`${toMessage(args)}\n`);
80
+ return;
81
+ }
82
+ routing = true;
83
+ try {
84
+ consoleLog[level](toMessage(args));
85
+ }
86
+ finally {
87
+ routing = false;
88
+ }
89
+ };
90
+ console.log = route("info");
91
+ console.info = route("info");
92
+ console.debug = route("debug");
93
+ }
94
+ /** Joins log arguments, serialising anything that is not a string through redaction. */
95
+ function toMessage(args) {
96
+ return args.map(arg => {
97
+ if (typeof arg === "string")
98
+ return arg;
99
+ try {
100
+ return JSON.stringify(redactValue(arg)) ?? String(arg);
101
+ }
102
+ catch {
103
+ return "[unserializable]";
104
+ }
105
+ }).join(" ");
59
106
  }
60
107
  /**
61
108
  * Returns a named logger.
@@ -1 +1 @@
1
- {"version":3,"file":"logging.js","sourceRoot":"","sources":["../../src/common/logging.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAE,MAAM,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AACnF,OAAO,EAAE,MAAM,IAAI,SAAS,EAAE,MAAM,0CAA0C,CAAC;AAE/E,IAAI,UAAU,GAAG,KAAK,CAAC;AAEvB;;;;;;GAMG;AACH,MAAM,UAAU,WAAW;IACvB,IAAI,UAA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C,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC;QACvC,CAAC;gBAAS,CAAC;YACP,OAAO,GAAG,KAAK,CAAC;QACpB,CAAC;IACL,CAAC,CAAC;IACF,OAAO,CAAC,GAAG,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC;IAC5B,OAAO,CAAC,IAAI,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC;IAC7B,OAAO,CAAC,KAAK,GAAG,KAAK,CAAC,OAAO,CAAC,CAAC;AACnC,CAAC;AAED,wFAAwF;AACxF,SAAS,SAAS,CAAC,IAAe;IAC9B,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE;QAClB,IAAI,OAAO,GAAG,KAAK,QAAQ;YAAE,OAAO,GAAG,CAAC;QACxC,IAAI,CAAC;YAAC,OAAO,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC;QAAC,CAAC;QAC/D,MAAM,CAAC;YAAC,OAAO,kBAAkB,CAAC;QAAC,CAAC;IACxC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AACjB,CAAC;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,UAAU,SAAS,CAAC,IAAY;IAClC,OAAO,IAAI,MAAM,CAAC,IAAI,CAAC,CAAC;AAC5B,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"execute-script.d.ts","sourceRoot":"","sources":["../../src/tools/execute-script.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAMpE;;;;;GAKG;AACH,wBAAgB,yBAAyB,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,CAkIjE"}
1
+ {"version":3,"file":"execute-script.d.ts","sourceRoot":"","sources":["../../src/tools/execute-script.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AASpE;;;;;GAKG;AACH,wBAAgB,yBAAyB,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,CAgJjE"}
@@ -2,6 +2,8 @@ import { z } from "zod";
2
2
  import { BackgroundScriptExecutor } from "@sonisoft/now-sdk-ext-core";
3
3
  import { withConnectionRetry } from "../common/connection.js";
4
4
  import { annotationsFor } from "../common/annotations.js";
5
+ /** The `code` core puts on ScriptScopeError. */
6
+ const SCRIPT_SCOPE_ERROR_CODE = "NEX_SCRIPT_SCOPE_UNAVAILABLE";
5
7
  /**
6
8
  * Registers the execute_script tool on the MCP server.
7
9
  *
@@ -15,13 +17,16 @@ export function registerExecuteScriptTool(server) {
15
17
  description: "Execute JavaScript on a ServiceNow instance using Scripts - Background " +
16
18
  "(the /sys.scripts.do endpoint). The script runs server-side with full " +
17
19
  "GlideSystem API access (gs, GlideRecord, GlideAggregate, GlideDateTime, " +
18
- "GlideUser, etc.). Use gs.print() or gs.info() to produce output.\n\n" +
20
+ "GlideUser, etc.). Use gs.info() to produce output (gs.print() also works in global, but prints nothing in a scoped app).\n\n" +
19
21
  "SCOPE BEHAVIOR: Scripts execute within the specified application scope. " +
20
22
  "When running in a scoped app (e.g., scope: 'x_myapp_custom'), you can " +
21
23
  "reference that scope's Script Includes and classes directly by name " +
22
24
  "(e.g., MyUtil.doSomething()) without fully-qualifying them. When running " +
23
25
  "in global scope, scoped classes must be fully-qualified " +
24
- "(e.g., x_myapp_custom.MyUtil.doSomething()).\n\n" +
26
+ "(e.g., x_myapp_custom.MyUtil.doSomething()). Only 'global' and applications " +
27
+ "developed on the instance (sys_app) can be used; installed store apps " +
28
+ "(sys_store_app) cannot — run in global and call their APIs fully-qualified. " +
29
+ "In a scoped app, use gs.info() for output: gs.print() is global-only.\n\n" +
25
30
  "IMPORTANT: This executes code directly on the ServiceNow instance. " +
26
31
  "Always review scripts before execution and prefer read-only operations " +
27
32
  "unless modification is explicitly intended.",
@@ -37,7 +42,7 @@ export function registerExecuteScriptTool(server) {
37
42
  script: z
38
43
  .string()
39
44
  .describe("The JavaScript code to execute on the ServiceNow instance. " +
40
- "Use gs.print() or gs.info() to output results — these are the only " +
45
+ "Use gs.info() (or, in global only, gs.print()) to output results — these are the only " +
41
46
  "ways to capture output from background scripts. The script runs in " +
42
47
  "the server-side Rhino engine with access to all ServiceNow server-side " +
43
48
  "APIs: GlideRecord, GlideAggregate, GlideDateTime, GlideUser, " +
@@ -46,9 +51,11 @@ export function registerExecuteScriptTool(server) {
46
51
  scope: z
47
52
  .string()
48
53
  .default("global")
49
- .describe("The application scope to execute the script in. Accepts either:\n" +
50
- '- A scope name (e.g., "global", "x_myapp_custom", "x_snc_app") — ' +
51
- "automatically resolved to the corresponding sys_id via the sys_scope table.\n" +
54
+ .describe("The application scope to execute the script in. Accepts:\n" +
55
+ '- "global" — the Global scope.\n' +
56
+ '- The scope of an application developed on the instance (a sys_app, e.g. ' +
57
+ '"x_myapp_custom") — resolved to its sys_id via the sys_app table. ' +
58
+ "Installed store apps (sys_store_app) are rejected with an explanation.\n" +
52
59
  "- A sys_id directly (32-character hex string) if already known.\n\n" +
53
60
  'Defaults to "global". Set this to the target app scope when you need ' +
54
61
  "to access scoped Script Includes, Business Rules, or other scoped " +
@@ -82,7 +89,7 @@ export function registerExecuteScriptTool(server) {
82
89
  content: [
83
90
  {
84
91
  type: "text",
85
- text: "Script executed but returned no output. If you expected output, make sure your script uses gs.print() or gs.info().",
92
+ text: "Script executed but returned no output. If you expected output, make sure your script uses gs.print() or gs.info() (gs.info() in a scoped app, where gs.print() prints nothing).",
86
93
  },
87
94
  ],
88
95
  };
@@ -108,11 +115,19 @@ export function registerExecuteScriptTool(server) {
108
115
  }
109
116
  catch (error) {
110
117
  const message = error instanceof Error ? error.message : String(error);
118
+ // An unusable scope (store app, typo, …) fails before the script is sent, and
119
+ // core's message already says why and what to do — say that, not "error
120
+ // executing script", which reads as if the script itself ran and failed.
121
+ // Matched by code, not by importing ScriptScopeError, so an older core
122
+ // without that export cannot break this module at load.
123
+ const isScopeError = error?.code === SCRIPT_SCOPE_ERROR_CODE;
111
124
  return {
112
125
  content: [
113
126
  {
114
127
  type: "text",
115
- text: `Error executing script: ${message}`,
128
+ text: isScopeError
129
+ ? `Script not run. ${message}`
130
+ : `Error executing script: ${message}`,
116
131
  },
117
132
  ],
118
133
  isError: true,
@@ -1 +1 @@
1
- {"version":3,"file":"execute-script.js","sourceRoot":"","sources":["../../src/tools/execute-script.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AACtE,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAE1D;;;;;GAKG;AACH,MAAM,UAAU,yBAAyB,CAAC,MAAiB;IACzD,MAAM,CAAC,YAAY,CACjB,gBAAgB,EAChB;QACE,WAAW,EAAE,cAAc,CAAC,gBAAgB,CAAC;QAC7C,KAAK,EAAE,2BAA2B;QAClC,WAAW,EACT,yEAAyE;YACzE,wEAAwE;YACxE,0EAA0E;YAC1E,sEAAsE;YACtE,0EAA0E;YAC1E,wEAAwE;YACxE,sEAAsE;YACtE,2EAA2E;YAC3E,0DAA0D;YAC1D,kDAAkD;YAClD,qEAAqE;YACrE,yEAAyE;YACzE,6CAA6C;QAC/C,WAAW,EAAE;YACX,QAAQ,EAAE,CAAC;iBACR,MAAM,EAAE;iBACR,QAAQ,EAAE;iBACV,QAAQ,CACP,+DAA+D;gBAC/D,+DAA+D;gBAC/D,kEAAkE;gBAClE,sEAAsE;gBACtE,wEAAwE,CACzE;YACH,MAAM,EAAE,CAAC;iBACN,MAAM,EAAE;iBACR,QAAQ,CACP,6DAA6D;gBAC7D,qEAAqE;gBACrE,qEAAqE;gBACrE,yEAAyE;gBACzE,+DAA+D;gBAC/D,wDAAwD;gBACxD,iEAAiE,CAClE;YACH,KAAK,EAAE,CAAC;iBAC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
  "name": "@sonisoft/now-sdk-ext-mcp",
3
- "version": "4.8.1",
3
+ "version": "4.8.3",
4
4
  "description": "MCP server for interacting with ServiceNow instances via @sonisoft/now-sdk-ext-core",
5
5
  "keywords": [
6
6
  "servicenow",
@@ -48,8 +48,8 @@
48
48
  "@servicenow/sdk-cli": "4.9.2",
49
49
  "@servicenow/sdk-cli-core": "3.0.3",
50
50
  "@servicenow/sdk-core": "4.9.2",
51
- "@sonisoft/now-sdk-ext-core": "^6.5.1",
52
- "@sonisoft/sn-credstore": "1.1.1",
51
+ "@sonisoft/now-sdk-ext-core": "^6.6.2",
52
+ "@sonisoft/sn-credstore": "1.4.0",
53
53
  "zod": "^3.23.8"
54
54
  },
55
55
  "devDependencies": {