@onlyflows/servicenow-mcp 2.3.0-rc.1 → 2.3.0-rc.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/CHANGELOG.md +788 -3
- package/README.md +446 -41
- package/dist/atf-policy.d.ts +1 -1
- package/dist/atf-policy.d.ts.map +1 -1
- package/dist/atf-policy.js +2 -0
- package/dist/atf-policy.js.map +1 -1
- package/dist/call-metrics.d.ts +42 -0
- package/dist/call-metrics.d.ts.map +1 -0
- package/dist/call-metrics.js +89 -0
- package/dist/call-metrics.js.map +1 -0
- package/dist/client.d.ts +18 -14
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +51 -36
- package/dist/client.js.map +1 -1
- package/dist/code-search-snippet.d.ts +25 -0
- package/dist/code-search-snippet.d.ts.map +1 -0
- package/dist/code-search-snippet.js +67 -0
- package/dist/code-search-snippet.js.map +1 -0
- package/dist/code-search-targets.d.ts +66 -0
- package/dist/code-search-targets.d.ts.map +1 -0
- package/dist/code-search-targets.js +82 -0
- package/dist/code-search-targets.js.map +1 -0
- package/dist/config.d.ts +1 -1
- package/dist/config.d.ts.map +1 -1
- package/dist/credential-tables.d.ts +32 -0
- package/dist/credential-tables.d.ts.map +1 -0
- package/dist/credential-tables.js +58 -0
- package/dist/credential-tables.js.map +1 -0
- package/dist/encoded-query-policy.d.ts +9 -0
- package/dist/encoded-query-policy.d.ts.map +1 -1
- package/dist/encoded-query-policy.js +27 -2
- package/dist/encoded-query-policy.js.map +1 -1
- package/dist/execution-context.d.ts +14 -0
- package/dist/execution-context.d.ts.map +1 -1
- package/dist/execution-context.js +8 -0
- package/dist/execution-context.js.map +1 -1
- package/dist/field-policy.d.ts +44 -1
- package/dist/field-policy.d.ts.map +1 -1
- package/dist/field-policy.js +623 -35
- package/dist/field-policy.js.map +1 -1
- package/dist/hidden-values.d.ts +225 -0
- package/dist/hidden-values.d.ts.map +1 -0
- package/dist/hidden-values.js +748 -0
- package/dist/hidden-values.js.map +1 -0
- package/dist/http-entrypoint.d.ts.map +1 -1
- package/dist/http-entrypoint.js +7 -0
- package/dist/http-entrypoint.js.map +1 -1
- package/dist/http-observability.js +1 -0
- package/dist/http-observability.js.map +1 -1
- package/dist/http-runtime.js +16 -0
- package/dist/http-runtime.js.map +1 -1
- package/dist/index.js +7 -0
- package/dist/index.js.map +1 -1
- package/dist/metadata-cache.d.ts +135 -7
- package/dist/metadata-cache.d.ts.map +1 -1
- package/dist/metadata-cache.js +357 -21
- package/dist/metadata-cache.js.map +1 -1
- package/dist/policy-card.d.ts +16 -1
- package/dist/policy-card.d.ts.map +1 -1
- package/dist/policy-card.js +15 -2
- package/dist/policy-card.js.map +1 -1
- package/dist/profile-admin.d.ts +18 -0
- package/dist/profile-admin.d.ts.map +1 -1
- package/dist/profile-admin.js +26 -1
- package/dist/profile-admin.js.map +1 -1
- package/dist/profile-manager.d.ts +13 -1
- package/dist/profile-manager.d.ts.map +1 -1
- package/dist/profile-manager.js +23 -1
- package/dist/profile-manager.js.map +1 -1
- package/dist/response-too-large.d.ts +23 -0
- package/dist/response-too-large.d.ts.map +1 -0
- package/dist/response-too-large.js +42 -0
- package/dist/response-too-large.js.map +1 -0
- package/dist/risky-grants.d.ts +6 -2
- package/dist/risky-grants.d.ts.map +1 -1
- package/dist/risky-grants.js +58 -5
- package/dist/risky-grants.js.map +1 -1
- package/dist/setup-prompts.js +1 -1
- package/dist/setup-prompts.js.map +1 -1
- package/dist/setup.d.ts +4 -0
- package/dist/setup.d.ts.map +1 -1
- package/dist/setup.js +176 -68
- package/dist/setup.js.map +1 -1
- package/dist/structured-query.d.ts +61 -2
- package/dist/structured-query.d.ts.map +1 -1
- package/dist/structured-query.js +382 -36
- package/dist/structured-query.js.map +1 -1
- package/dist/table-policy.d.ts +75 -2
- package/dist/table-policy.d.ts.map +1 -1
- package/dist/table-policy.js +184 -15
- package/dist/table-policy.js.map +1 -1
- package/dist/tool-error.d.ts +47 -4
- package/dist/tool-error.d.ts.map +1 -1
- package/dist/tool-error.js +104 -4
- package/dist/tool-error.js.map +1 -1
- package/dist/tool-table-access.d.ts +9 -2
- package/dist/tool-table-access.d.ts.map +1 -1
- package/dist/tool-table-access.js +118 -36
- package/dist/tool-table-access.js.map +1 -1
- package/dist/tools/aggregate.js +2 -2
- package/dist/tools/aggregate.js.map +1 -1
- package/dist/tools/all-fields-cap.d.ts.map +1 -1
- package/dist/tools/all-fields-cap.js +29 -7
- package/dist/tools/all-fields-cap.js.map +1 -1
- package/dist/tools/atf-author-module.d.ts +1 -7
- package/dist/tools/atf-author-module.d.ts.map +1 -1
- package/dist/tools/atf-author-module.js +16 -7
- package/dist/tools/atf-author-module.js.map +1 -1
- package/dist/tools/atf-contracts.d.ts +69 -4
- package/dist/tools/atf-contracts.d.ts.map +1 -1
- package/dist/tools/atf-contracts.js +32 -2
- package/dist/tools/atf-contracts.js.map +1 -1
- package/dist/tools/atf-renderers.js +2 -1
- package/dist/tools/atf-renderers.js.map +1 -1
- package/dist/tools/atf-results-module.d.ts.map +1 -1
- package/dist/tools/atf-results-module.js +5 -3
- package/dist/tools/atf-results-module.js.map +1 -1
- package/dist/tools/atf-run-module.js +3 -2
- package/dist/tools/atf-run-module.js.map +1 -1
- package/dist/tools/atf-shared.d.ts +6 -0
- package/dist/tools/atf-shared.d.ts.map +1 -1
- package/dist/tools/atf-shared.js +49 -10
- package/dist/tools/atf-shared.js.map +1 -1
- package/dist/tools/atf-step-catalog.d.ts +13 -8
- package/dist/tools/atf-step-catalog.d.ts.map +1 -1
- package/dist/tools/atf-step-catalog.js +169 -5
- package/dist/tools/atf-step-catalog.js.map +1 -1
- package/dist/tools/batch.d.ts.map +1 -1
- package/dist/tools/batch.js +25 -7
- package/dist/tools/batch.js.map +1 -1
- package/dist/tools/catalog.d.ts.map +1 -1
- package/dist/tools/catalog.js +2 -1
- package/dist/tools/catalog.js.map +1 -1
- package/dist/tools/codesearch.d.ts +2 -2
- package/dist/tools/codesearch.d.ts.map +1 -1
- package/dist/tools/codesearch.js +536 -67
- package/dist/tools/codesearch.js.map +1 -1
- package/dist/tools/flow-view-contracts.d.ts +59 -3
- package/dist/tools/flow-view-contracts.d.ts.map +1 -1
- package/dist/tools/flow-view-contracts.js +34 -2
- package/dist/tools/flow-view-contracts.js.map +1 -1
- package/dist/tools/flow-view-graph.d.ts +14 -0
- package/dist/tools/flow-view-graph.d.ts.map +1 -1
- package/dist/tools/flow-view-graph.js +43 -1
- package/dist/tools/flow-view-graph.js.map +1 -1
- package/dist/tools/flow-view-module.js +2 -2
- package/dist/tools/flow-view-module.js.map +1 -1
- package/dist/tools/flow-view-policy.d.ts +3 -3
- package/dist/tools/flow-view-policy.d.ts.map +1 -1
- package/dist/tools/flow-view-policy.js +5 -4
- package/dist/tools/flow-view-policy.js.map +1 -1
- package/dist/tools/flow-view-renderers.d.ts.map +1 -1
- package/dist/tools/flow-view-renderers.js +9 -21
- package/dist/tools/flow-view-renderers.js.map +1 -1
- package/dist/tools/get-module.js +1 -1
- package/dist/tools/get-module.js.map +1 -1
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js +116 -25
- package/dist/tools/index.js.map +1 -1
- package/dist/tools/platform-view-contracts.d.ts +189 -0
- package/dist/tools/platform-view-contracts.d.ts.map +1 -0
- package/dist/tools/platform-view-contracts.js +353 -0
- package/dist/tools/platform-view-contracts.js.map +1 -0
- package/dist/tools/platform-view-evaluate.d.ts +219 -0
- package/dist/tools/platform-view-evaluate.d.ts.map +1 -0
- package/dist/tools/platform-view-evaluate.js +1346 -0
- package/dist/tools/platform-view-evaluate.js.map +1 -0
- package/dist/tools/platform-view-module.d.ts +28 -0
- package/dist/tools/platform-view-module.d.ts.map +1 -0
- package/dist/tools/platform-view-module.js +111 -0
- package/dist/tools/platform-view-module.js.map +1 -0
- package/dist/tools/platform-view-scan.d.ts +57 -0
- package/dist/tools/platform-view-scan.d.ts.map +1 -0
- package/dist/tools/platform-view-scan.js +375 -0
- package/dist/tools/platform-view-scan.js.map +1 -0
- package/dist/tools/platform-view-upgrades.d.ts +152 -0
- package/dist/tools/platform-view-upgrades.d.ts.map +1 -0
- package/dist/tools/platform-view-upgrades.js +545 -0
- package/dist/tools/platform-view-upgrades.js.map +1 -0
- package/dist/tools/profile.d.ts.map +1 -1
- package/dist/tools/profile.js +1 -0
- package/dist/tools/profile.js.map +1 -1
- package/dist/tools/query-module.d.ts.map +1 -1
- package/dist/tools/query-module.js +231 -64
- package/dist/tools/query-module.js.map +1 -1
- package/dist/tools/record-write-shared.d.ts.map +1 -1
- package/dist/tools/record-write-shared.js +4 -3
- package/dist/tools/record-write-shared.js.map +1 -1
- package/dist/tools/result-envelope.d.ts +429 -38
- package/dist/tools/result-envelope.d.ts.map +1 -1
- package/dist/tools/result-envelope.js +372 -36
- package/dist/tools/result-envelope.js.map +1 -1
- package/dist/tools/schema-module.d.ts.map +1 -1
- package/dist/tools/schema-module.js +1 -1
- package/dist/tools/schema-module.js.map +1 -1
- package/dist/tools/syslog-cursor.d.ts +61 -0
- package/dist/tools/syslog-cursor.d.ts.map +1 -0
- package/dist/tools/syslog-cursor.js +146 -0
- package/dist/tools/syslog-cursor.js.map +1 -0
- package/dist/tools/syslog.d.ts +2 -0
- package/dist/tools/syslog.d.ts.map +1 -1
- package/dist/tools/syslog.js +126 -2
- package/dist/tools/syslog.js.map +1 -1
- package/dist/tools/truncation-hint.d.ts +125 -0
- package/dist/tools/truncation-hint.d.ts.map +1 -0
- package/dist/tools/truncation-hint.js +298 -0
- package/dist/tools/truncation-hint.js.map +1 -0
- package/dist/unknown-filter-fields.d.ts +52 -0
- package/dist/unknown-filter-fields.d.ts.map +1 -0
- package/dist/unknown-filter-fields.js +87 -0
- package/dist/unknown-filter-fields.js.map +1 -0
- package/dist/update-set-eval/engine.d.ts +29 -0
- package/dist/update-set-eval/engine.d.ts.map +1 -0
- package/dist/update-set-eval/engine.js +405 -0
- package/dist/update-set-eval/engine.js.map +1 -0
- package/dist/update-set-eval/prepare.d.ts +72 -0
- package/dist/update-set-eval/prepare.d.ts.map +1 -0
- package/dist/update-set-eval/prepare.js +216 -0
- package/dist/update-set-eval/prepare.js.map +1 -0
- package/dist/update-set-eval/rules.d.ts +126 -0
- package/dist/update-set-eval/rules.d.ts.map +1 -0
- package/dist/update-set-eval/rules.js +927 -0
- package/dist/update-set-eval/rules.js.map +1 -0
- package/dist/update-set-eval/script-scan.d.ts +65 -0
- package/dist/update-set-eval/script-scan.d.ts.map +1 -0
- package/dist/update-set-eval/script-scan.js +378 -0
- package/dist/update-set-eval/script-scan.js.map +1 -0
- package/dist/update-set-eval/secret-patterns.d.ts +75 -0
- package/dist/update-set-eval/secret-patterns.d.ts.map +1 -0
- package/dist/update-set-eval/secret-patterns.js +570 -0
- package/dist/update-set-eval/secret-patterns.js.map +1 -0
- package/dist/update-set-eval/types.d.ts +181 -0
- package/dist/update-set-eval/types.d.ts.map +1 -0
- package/dist/update-set-eval/types.js +20 -0
- package/dist/update-set-eval/types.js.map +1 -0
- package/dist/update-set-eval/xml-reader.d.ts +117 -0
- package/dist/update-set-eval/xml-reader.d.ts.map +1 -0
- package/dist/update-set-eval/xml-reader.js +561 -0
- package/dist/update-set-eval/xml-reader.js.map +1 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/docs/CLIENT-SETUP.md +30 -7
- package/docs/FLOW-VIEW.md +14 -5
- package/docs/PRODUCTION-SECURITY.md +84 -1
- package/docs/PROFILE-CREDENTIALS.md +10 -4
- package/docs/V2-MIGRATION.md +1 -1
- package/package.json +1 -1
- package/server.json +2 -2
package/docs/CLIENT-SETUP.md
CHANGED
|
@@ -27,7 +27,9 @@ servicenow-mcp-setup
|
|
|
27
27
|
```
|
|
28
28
|
|
|
29
29
|
Run bare on a terminal, `servicenow-mcp-setup` is a guided wizard. It
|
|
30
|
-
generates the local auth material, prompts for the instance and credential
|
|
30
|
+
generates the local auth material, prompts for the instance and credential
|
|
31
|
+
(the authentication type defaults to OAuth client credentials, and Basic is
|
|
32
|
+
offered last, marked legacy),
|
|
31
33
|
verifies that credential against the instance with one bounded authenticated
|
|
32
34
|
read, prompts for table access, writes the profile with its grant already
|
|
33
35
|
attached, and registers any supported client whose CLI is installed.
|
|
@@ -198,7 +200,7 @@ grant is validated with the same loader the server uses at request time, so a
|
|
|
198
200
|
rejected policy fails at the CLI rather than at the first tool call.
|
|
199
201
|
|
|
200
202
|
Without `--tools`, each table named with `--read` gets
|
|
201
|
-
`sn_query,sn_get,sn_aggregate,sn_schema`, and each table named with `--write`
|
|
203
|
+
`sn_query,sn_get,sn_aggregate,sn_schema,sn_codesearch`, and each table named with `--write`
|
|
202
204
|
gets `sn_create,sn_update`. A write grant on `incident` also binds
|
|
203
205
|
`sn_incident_add_comment` and `sn_incident_add_work_note`. Comments are
|
|
204
206
|
customer-visible, so a comment the agent appends can notify the incident's
|
|
@@ -215,6 +217,27 @@ with `--tools`; `--replace` discards every rule on the profile, so grant its
|
|
|
215
217
|
other tables again afterwards. `sn_delete`, `sn_batch`, and `sn_atf` are never
|
|
216
218
|
granted implicitly and must be named with `--tools`.
|
|
217
219
|
|
|
220
|
+
`sn_codesearch` is checked against each code table it searches
|
|
221
|
+
(`sys_script`, `sys_script_include`, `sys_ui_script`, `sys_script_client`,
|
|
222
|
+
`sys_ws_operation`, `sys_module`), so a plain `--read sys_script_include` is enough to search
|
|
223
|
+
script includes. A search with no `table` searches the code tables the profile
|
|
224
|
+
may read and names the others in a warning; it fails only when it may read none
|
|
225
|
+
of them. It does nothing on other tables. A profile saved before this default keeps its stored tool list:
|
|
226
|
+
re-run `grant --profile <name> --read <code table>` or add
|
|
227
|
+
`--tools sn_codesearch` to give it the tool. The profile's field policy still
|
|
228
|
+
applies: a code table whose script field is not readable denies `sn_codesearch`
|
|
229
|
+
as it denies `sn_query` for that field (a search with no `table` leaves that
|
|
230
|
+
table out and names it in the warning).
|
|
231
|
+
|
|
232
|
+
Searching ATF step scripts (`sn_codesearch` with `table: "sys_atf_step"`) reads
|
|
233
|
+
three tables, so it needs read on `sys_variable_value`, `sys_atf_step` and
|
|
234
|
+
`sys_atf_test`, each bound to `sn_codesearch`:
|
|
235
|
+
`servicenow-mcp-setup grant --profile <name> --read sys_variable_value,sys_atf_step,sys_atf_test`.
|
|
236
|
+
`--atf` binds those tables to `sn_atf_author` only, so it is added on top. The
|
|
237
|
+
search is limited in the server to the script inputs of ATF steps; the grant on
|
|
238
|
+
`sys_variable_value` does not let `sn_codesearch` search any other table's
|
|
239
|
+
variables.
|
|
240
|
+
|
|
218
241
|
A grant decides which tools reach a table; the profile's field policy still
|
|
219
242
|
decides which fields they may write. The journal tools follow it like
|
|
220
243
|
`sn_update` does: if the incident's effective `writable` list, from
|
|
@@ -304,8 +327,8 @@ At the protected prompt, enter the name of the supervisor-injected environment
|
|
|
304
327
|
secret for this profile. The stored entry is a structured `secret_ref`; the
|
|
305
328
|
referenced secret is resolved only when a call explicitly selects `dev`.
|
|
306
329
|
|
|
307
|
-
The following creates a separate
|
|
308
|
-
|
|
330
|
+
The following creates a separate OAuth staging profile with an encrypted
|
|
331
|
+
client secret. First inject `SN_PROFILE_ENCRYPTION_KEY` from the secret manager
|
|
309
332
|
into the CLI process. The key is exactly 32 random bytes encoded as base64 or
|
|
310
333
|
base64url and remains separate from the profile file, MCP bearer, and
|
|
311
334
|
ServiceNow credentials. Then run:
|
|
@@ -314,12 +337,12 @@ ServiceNow credentials. Then run:
|
|
|
314
337
|
servicenow-mcp-profile create \
|
|
315
338
|
--name staging \
|
|
316
339
|
--instance https://staging.service-now.com \
|
|
317
|
-
--auth-type
|
|
318
|
-
--
|
|
340
|
+
--auth-type oauth \
|
|
341
|
+
--client-id staging-non-secret-client-id \
|
|
319
342
|
--source encrypted
|
|
320
343
|
```
|
|
321
344
|
|
|
322
|
-
Enter the staging
|
|
345
|
+
Enter the staging client secret only at the non-echoed prompt or bounded standard
|
|
323
346
|
input. The resulting owner-only `~/.servicenow-mcp/config.json` contains the
|
|
324
347
|
two non-secret instance definitions plus a structured secret reference for
|
|
325
348
|
`dev` and a versioned encrypted envelope for `staging`. It contains neither
|
package/docs/FLOW-VIEW.md
CHANGED
|
@@ -24,9 +24,15 @@ reads only through the Table API. Every call requires an explicit `profile`.
|
|
|
24
24
|
`true`, `false`, `loop_body`, `loop_back`, `parallel`, `error`, `subflow`),
|
|
25
25
|
data pills, flow variables, the limits that were hit and fixed-vocabulary
|
|
26
26
|
warnings. Node ids are generated (`n0` is the trigger), never instance
|
|
27
|
-
data.
|
|
28
|
-
|
|
29
|
-
|
|
27
|
+
data. It also holds what the text shows beyond the graph, so a client that
|
|
28
|
+
reads only `structuredContent` loses nothing: `diagram` (the Mermaid source,
|
|
29
|
+
when `format` asks for a diagram), `ref` (the flow record as table and
|
|
30
|
+
sys_id, never as a link, so the instance address stays out of
|
|
31
|
+
`structuredContent`) and `warning_details` (each warning code with its
|
|
32
|
+
explanation).
|
|
33
|
+
- **The text** holds a headline, a link to the flow record, a summary table, a
|
|
34
|
+
Mermaid `flowchart TD` diagram and a numbered outline in an untrusted-content
|
|
35
|
+
block.
|
|
30
36
|
|
|
31
37
|
Branches are drawn the way Flow Designer stores them. The `false` edge of an If
|
|
32
38
|
or Else If enters the next Else If or the Else node, which then leads into its
|
|
@@ -196,13 +202,16 @@ then values dropped, then descriptions, annotations and conditions cut to 200
|
|
|
196
202
|
characters, then steps halved behind a "more" node, then pills and variables
|
|
197
203
|
dropped. The text gets the rest: diagram and full outline, then a shortened
|
|
198
204
|
outline, then the outline alone, then the summary table. Every reduction is
|
|
199
|
-
reported in `limits_hit`.
|
|
205
|
+
reported in `limits_hit`. The `diagram` is drawn from the nodes that are left
|
|
206
|
+
and is the first thing given up: when the graph and the diagram do not fit
|
|
207
|
+
together, `diagram` keeps only a `note` saying it was left out (its source is
|
|
208
|
+
never cut short), and `nodes` and `edges` describe the same graph.
|
|
200
209
|
|
|
201
210
|
## How clients show it
|
|
202
211
|
|
|
203
212
|
| Client | What to expect |
|
|
204
213
|
| --- | --- |
|
|
205
|
-
| Clients that read `structuredContent` | The full graph, for their own rendering. |
|
|
214
|
+
| Clients that read `structuredContent` | The full graph, with the diagram source, for their own rendering. |
|
|
206
215
|
| Chat clients that render Markdown with Mermaid support | The diagram drawn, plus the outline. Whether a `mermaid` block is drawn depends on the client and its version. |
|
|
207
216
|
| Terminal clients (Claude Code, Codex CLI) | The Mermaid source and the outline as text. `format: "outline"` saves space; paste the diagram into any Mermaid viewer to draw it. |
|
|
208
217
|
|
|
@@ -287,7 +287,7 @@ SN_ALLOWED_READ_TABLES=incident,problem,change_request
|
|
|
287
287
|
SN_ALLOWED_WRITE_TABLES=incident,change_request
|
|
288
288
|
SN_TABLE_ACCESS_TARGETS=<runtime-config:reviewed-target-catalog>
|
|
289
289
|
SN_METADATA_CACHE_TTL_MS=86400000
|
|
290
|
-
SN_METADATA_CACHE_TABLES=sys_glide_object,sys_dictionary,sys_db_object,sys_app,sys_plugins,sys_metadata*,sys_flow
|
|
290
|
+
SN_METADATA_CACHE_TABLES=sys_glide_object,sys_dictionary,sys_db_object,sys_app,sys_plugins,sys_metadata*,sys_flow*,sys_script,sys_script_include,sys_ui_script,sys_script_client,sys_ws_operation,sys_module
|
|
291
291
|
```
|
|
292
292
|
|
|
293
293
|
Metadata caching works in every auth mode, including the client_credentials
|
|
@@ -326,6 +326,26 @@ ACLs on the cached rows are not evaluated on the hit. Do not add it, and review
|
|
|
326
326
|
table you do add against the same two questions: are its rows ACL-restricted
|
|
327
327
|
per user, and would a stale or cross-identity answer be a disclosure?
|
|
328
328
|
|
|
329
|
+
The six code tables in the default list (`sys_script`, `sys_script_include`,
|
|
330
|
+
`sys_ui_script`, `sys_script_client`, `sys_ws_operation`, `sys_module`) hold
|
|
331
|
+
script bodies, and scripts can contain hard-coded credentials. A cached entry
|
|
332
|
+
keeps the whole response of a read, so it holds the full `script`,
|
|
333
|
+
`operation_script` or `content` of every row read, not the 200-character snippet
|
|
334
|
+
`sn_codesearch` shows. `sys_variable_value`, which holds ATF step inputs among
|
|
335
|
+
every other table's variable values, is not in the default list: an ATF step
|
|
336
|
+
script search reads it straight through, and an operator who adds it to the list
|
|
337
|
+
caches those values for the TTL, so add it only after the same review. Entries
|
|
338
|
+
live only in process memory, partitioned by instance and credential identity,
|
|
339
|
+
and are never written to disk or to logs. They are kept for up to the cache TTL
|
|
340
|
+
(24 hours by default), within 32 MiB per credential and 128 MiB overall. They
|
|
341
|
+
differ from `sys_properties` in that no cross-identity hit is possible, since
|
|
342
|
+
the partition is the credential, and the payloads are large enough to be worth
|
|
343
|
+
keeping. A script edit moves the table's watermark and refreshes the entry, but
|
|
344
|
+
a tightened ServiceNow ACL does not, so it follows the restart-or-rotate rule
|
|
345
|
+
above. To keep script bodies out of the cache, set `SN_METADATA_CACHE_TABLES`
|
|
346
|
+
(or `metadataCache.tables` on a file-backed profile) to the list without them:
|
|
347
|
+
`sys_glide_object,sys_dictionary,sys_db_object,sys_app,sys_plugins,sys_metadata*,sys_flow*`.
|
|
348
|
+
|
|
329
349
|
For a named profile, keep the secret out of JSON and reference the same
|
|
330
350
|
canonical runtime secret:
|
|
331
351
|
|
|
@@ -447,6 +467,34 @@ client's ordinary retry on 502, 503, 504 and connection errors, so a gateway
|
|
|
447
467
|
failure after the instance applied such a write can append the entry twice.
|
|
448
468
|
Where a duplicate would matter, withhold such fields with field policy.
|
|
449
469
|
|
|
470
|
+
## Password-type fields
|
|
471
|
+
|
|
472
|
+
Read and write tools hide a field by its dictionary type as well as by its
|
|
473
|
+
name. A field of internal type `password`, `password2`, `masked` or
|
|
474
|
+
`encrypted_text` never leaves the server and is never asked for, whatever it
|
|
475
|
+
is called (`ssh_passphrase`, `key`, `answer`): it is refused when named,
|
|
476
|
+
dropped from `fields=all`, detailed, default and `"*"` reads and from write
|
|
477
|
+
echoes, and refused as a filter, order, aggregate, group-by or write field.
|
|
478
|
+
The whole field goes in every display shape, display values included. A
|
|
479
|
+
`sys_properties` row shows `value` only when its `type` is a known non-secret
|
|
480
|
+
type, and `value` is never a filter, order or group field there.
|
|
481
|
+
|
|
482
|
+
- **Grant the integration user read access to `sys_dictionary` and
|
|
483
|
+
`sys_db_object`** (and `sys_db_view_table` for database views). The types
|
|
484
|
+
come from one `sys_dictionary` read per credential, kept for an hour (or the
|
|
485
|
+
profile's metadata-cache TTL, if shorter), and concurrent calls share one
|
|
486
|
+
read; no table grant is needed. While
|
|
487
|
+
ServiceNow refuses or fails that read, every field-policy tool refuses with a
|
|
488
|
+
message naming this access.
|
|
489
|
+
- **`"fieldTypes": { "dictionary": "not_required" }`** on a profile (or
|
|
490
|
+
`SN_FIELD_TYPES_DICTIONARY=not_required` for the environment profile) lets
|
|
491
|
+
those calls run with name-only hiding instead. The server warns at startup
|
|
492
|
+
and each time it falls back, and the policy card flags the profile. Approve it only
|
|
493
|
+
where the granted tables hold no password-type field.
|
|
494
|
+
- A value whose secrecy is set per record, rather than by the field's
|
|
495
|
+
dictionary type, is not recognised by type. Where a granted table holds such
|
|
496
|
+
values, narrow the field with field policy.
|
|
497
|
+
|
|
450
498
|
## Flow views
|
|
451
499
|
|
|
452
500
|
`sn_flow_view` is read-only. It reads 15 tables through the Table API and
|
|
@@ -472,6 +520,41 @@ flow read creates a Workflow Studio history record. Approve it on these terms:
|
|
|
472
520
|
[docs/FLOW-VIEW.md](FLOW-VIEW.md) lists every table, required field and
|
|
473
521
|
field-policy switch.
|
|
474
522
|
|
|
523
|
+
## Tables a `"*"` grant does not cover
|
|
524
|
+
|
|
525
|
+
`sys_audit`, `sys_journal_field`, `sys_history_line`, `sys_audit_delete`,
|
|
526
|
+
`sys_attachment_doc` and `sys_email` hold old and new field values, comments and
|
|
527
|
+
work notes, deleted records, attachment content and email bodies. A `"*"` entry
|
|
528
|
+
in `readTables` or `writeTables` never covers them: approve one only when the
|
|
529
|
+
profile names it, bound to the tools that need it.
|
|
530
|
+
|
|
531
|
+
- A database view built over one of them, or a custom table that extends one, has
|
|
532
|
+
a different table name, so a `"*"` grant reaches it. Do not grant such a view or
|
|
533
|
+
table unless those rows are meant to be exposed, and review database views on
|
|
534
|
+
the instance before approving a `"*"` profile. A profile with an explicit table
|
|
535
|
+
list never reaches a view it does not name.
|
|
536
|
+
- Declare a view as a `view` target with every table it reads in
|
|
537
|
+
`relatedTables`. The profile then fails to load unless it also names each of
|
|
538
|
+
those tables, for a named-only table by name.
|
|
539
|
+
- A `"*"` write grant does not cover `sys_atf_step`, `sys_variable_value` or
|
|
540
|
+
`sys_element_mapping`, which hold what `sn_atf_author` checks when it adds a
|
|
541
|
+
step. Under `"*"` only
|
|
542
|
+
`sn_atf_author` writes them; the generic write tools need the table named for
|
|
543
|
+
write. Reads are unchanged.
|
|
544
|
+
- A `"*"` field-policy entry narrows these six once the profile names them, as it
|
|
545
|
+
does the ITSM tables; a value column is left out of a default read.
|
|
546
|
+
- `sn_atf_author` checks each ATF step that names a table: `record_query`,
|
|
547
|
+
`record_validation`, `field_values_validation` and `open_existing_record` need a
|
|
548
|
+
read grant on it, `open_new_form` and `set_field_values` a write grant, and a
|
|
549
|
+
named-only table must be named for either. Step conditions may use only the
|
|
550
|
+
operators that compare a field with a literal, over fields the field policy
|
|
551
|
+
lets the profile read, and `record_query` and `record_validation` refuse
|
|
552
|
+
`enforce_security: false`. A condition value (and a `set_field_values` value) may refer to an
|
|
553
|
+
earlier step's output only by record id or sys_id, and the fields a `set_field_values` step
|
|
554
|
+
sets must be writable on its table. The impersonated user's ACLs still apply
|
|
555
|
+
on top. Suites authored in the instance are not checked by the server's table grants,
|
|
556
|
+
and `atf.execute` stays opt-in.
|
|
557
|
+
|
|
475
558
|
## Denied exposure patterns
|
|
476
559
|
|
|
477
560
|
Do not approve a deployment that has any of these properties:
|
|
@@ -12,11 +12,17 @@ After installing the package, invoke the dedicated operator-only executable:
|
|
|
12
12
|
servicenow-mcp-profile create \
|
|
13
13
|
--name dev \
|
|
14
14
|
--instance https://dev.service-now.com \
|
|
15
|
-
--auth-type
|
|
16
|
-
--
|
|
15
|
+
--auth-type oauth \
|
|
16
|
+
--client-id <non-secret-oauth-client-id> \
|
|
17
17
|
--source encrypted
|
|
18
18
|
```
|
|
19
19
|
|
|
20
|
+
Always pass `--auth-type`. Left out, `create` still builds a Basic profile, as
|
|
21
|
+
it always has, and prints a deprecation notice only when standard error is an
|
|
22
|
+
interactive terminal, so captured output stays the single JSON result. ServiceNow is
|
|
23
|
+
retiring Basic Auth for REST calls, so OAuth client credentials is the
|
|
24
|
+
recommended type: [Authentication](../README.md#authentication).
|
|
25
|
+
|
|
20
26
|
When working from a source checkout, build first and invoke the same artifact
|
|
21
27
|
directly:
|
|
22
28
|
|
|
@@ -25,8 +31,8 @@ npm run build
|
|
|
25
31
|
node dist/profile-admin.js create \
|
|
26
32
|
--name dev \
|
|
27
33
|
--instance https://dev.service-now.com \
|
|
28
|
-
--auth-type
|
|
29
|
-
--
|
|
34
|
+
--auth-type oauth \
|
|
35
|
+
--client-id <non-secret-oauth-client-id> \
|
|
30
36
|
--source encrypted
|
|
31
37
|
```
|
|
32
38
|
|
package/docs/V2-MIGRATION.md
CHANGED
|
@@ -764,7 +764,7 @@ then the `"*"` entry, then every field, on:
|
|
|
764
764
|
`cmdb_ci_computer`, `kb_knowledge`;
|
|
765
765
|
- every table without a built-in entry, named in the policy or not.
|
|
766
766
|
|
|
767
|
-
The other
|
|
767
|
+
The other 24 built-in tables are system tables, listed in the
|
|
768
768
|
[field policy reference](../README.md#field-policy). A `"*"` entry never
|
|
769
769
|
reaches them, named or not.
|
|
770
770
|
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@onlyflows/servicenow-mcp",
|
|
3
3
|
"mcpName": "io.github.onlyflowstech/servicenow-mcp",
|
|
4
|
-
"version": "2.3.0-rc.
|
|
4
|
+
"version": "2.3.0-rc.3",
|
|
5
5
|
"description": "Governed stdio ServiceNow MCP server for production: 24 tools with per-profile table and field policy, dry-run bulk changes, activity events, multi-instance profiles, CMDB traversal, ATF testing and read-only Flow Designer flow views.",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"types": "dist/index.d.ts",
|
package/server.json
CHANGED
|
@@ -7,12 +7,12 @@
|
|
|
7
7
|
"url": "https://github.com/onlyflowstech/servicenow-mcp",
|
|
8
8
|
"source": "github"
|
|
9
9
|
},
|
|
10
|
-
"version": "2.3.0-rc.
|
|
10
|
+
"version": "2.3.0-rc.3",
|
|
11
11
|
"packages": [
|
|
12
12
|
{
|
|
13
13
|
"registryType": "npm",
|
|
14
14
|
"identifier": "@onlyflows/servicenow-mcp",
|
|
15
|
-
"version": "2.3.0-rc.
|
|
15
|
+
"version": "2.3.0-rc.3",
|
|
16
16
|
"runtimeHint": "npx",
|
|
17
17
|
"transport": {
|
|
18
18
|
"type": "stdio"
|