@onlyflows/servicenow-mcp 2.2.0-dev.6 → 2.2.0

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 (244) hide show
  1. package/.env.example +6 -3
  2. package/CHANGELOG.md +286 -0
  3. package/README.md +504 -101
  4. package/dist/atf-form.d.ts +3 -15
  5. package/dist/atf-form.d.ts.map +1 -1
  6. package/dist/atf-result-cache.d.ts +23 -59
  7. package/dist/atf-result-cache.d.ts.map +1 -1
  8. package/dist/auth.d.ts +1 -0
  9. package/dist/auth.d.ts.map +1 -1
  10. package/dist/auth.js +17 -0
  11. package/dist/auth.js.map +1 -1
  12. package/dist/batch-limits.d.ts +18 -0
  13. package/dist/batch-limits.d.ts.map +1 -0
  14. package/dist/batch-limits.js +21 -0
  15. package/dist/batch-limits.js.map +1 -0
  16. package/dist/bounded-input.d.ts +49 -0
  17. package/dist/bounded-input.d.ts.map +1 -0
  18. package/dist/bounded-input.js +81 -0
  19. package/dist/bounded-input.js.map +1 -0
  20. package/dist/client.d.ts +25 -0
  21. package/dist/client.d.ts.map +1 -1
  22. package/dist/client.js +92 -18
  23. package/dist/client.js.map +1 -1
  24. package/dist/encoded-query-policy.d.ts +11 -0
  25. package/dist/encoded-query-policy.d.ts.map +1 -1
  26. package/dist/encoded-query-policy.js +10 -1
  27. package/dist/encoded-query-policy.js.map +1 -1
  28. package/dist/field-policy.d.ts +82 -3
  29. package/dist/field-policy.d.ts.map +1 -1
  30. package/dist/field-policy.js +609 -80
  31. package/dist/field-policy.js.map +1 -1
  32. package/dist/html-response.d.ts +34 -0
  33. package/dist/html-response.d.ts.map +1 -0
  34. package/dist/html-response.js +72 -0
  35. package/dist/html-response.js.map +1 -0
  36. package/dist/http-runtime.d.ts.map +1 -1
  37. package/dist/http-runtime.js +8 -0
  38. package/dist/http-runtime.js.map +1 -1
  39. package/dist/incident-journal-policy.d.ts +27 -5
  40. package/dist/incident-journal-policy.d.ts.map +1 -1
  41. package/dist/incident-journal-policy.js +34 -21
  42. package/dist/incident-journal-policy.js.map +1 -1
  43. package/dist/json-shape-limits.d.ts +71 -0
  44. package/dist/json-shape-limits.d.ts.map +1 -0
  45. package/dist/json-shape-limits.js +131 -0
  46. package/dist/json-shape-limits.js.map +1 -0
  47. package/dist/metadata-cache.d.ts +46 -21
  48. package/dist/metadata-cache.d.ts.map +1 -1
  49. package/dist/metadata-cache.js +228 -195
  50. package/dist/metadata-cache.js.map +1 -1
  51. package/dist/policy-card.d.ts +131 -0
  52. package/dist/policy-card.d.ts.map +1 -0
  53. package/dist/policy-card.js +409 -0
  54. package/dist/policy-card.js.map +1 -0
  55. package/dist/profile-manager.d.ts +7 -3
  56. package/dist/profile-manager.d.ts.map +1 -1
  57. package/dist/profile-manager.js +66 -3
  58. package/dist/profile-manager.js.map +1 -1
  59. package/dist/record-identifier-policy.d.ts +2 -8
  60. package/dist/record-identifier-policy.d.ts.map +1 -1
  61. package/dist/risky-grants.d.ts +25 -0
  62. package/dist/risky-grants.d.ts.map +1 -0
  63. package/dist/risky-grants.js +77 -0
  64. package/dist/risky-grants.js.map +1 -0
  65. package/dist/server.d.ts.map +1 -1
  66. package/dist/server.js +26 -5
  67. package/dist/server.js.map +1 -1
  68. package/dist/setup-prompts.js +1 -0
  69. package/dist/setup-prompts.js.map +1 -1
  70. package/dist/setup.d.ts +1 -1
  71. package/dist/setup.d.ts.map +1 -1
  72. package/dist/setup.js +300 -58
  73. package/dist/setup.js.map +1 -1
  74. package/dist/stdio-runtime.d.ts +15 -0
  75. package/dist/stdio-runtime.d.ts.map +1 -1
  76. package/dist/stdio-runtime.js +60 -0
  77. package/dist/stdio-runtime.js.map +1 -1
  78. package/dist/structured-query.d.ts +100 -115
  79. package/dist/structured-query.d.ts.map +1 -1
  80. package/dist/structured-query.js +132 -16
  81. package/dist/structured-query.js.map +1 -1
  82. package/dist/table-policy.d.ts +10 -4
  83. package/dist/table-policy.d.ts.map +1 -1
  84. package/dist/table-policy.js +1 -1
  85. package/dist/table-policy.js.map +1 -1
  86. package/dist/tool-error.d.ts +18 -0
  87. package/dist/tool-error.d.ts.map +1 -1
  88. package/dist/tool-error.js +69 -0
  89. package/dist/tool-error.js.map +1 -1
  90. package/dist/tool-table-access.d.ts.map +1 -1
  91. package/dist/tool-table-access.js +32 -2
  92. package/dist/tool-table-access.js.map +1 -1
  93. package/dist/tools/aggregate.d.ts +13 -19
  94. package/dist/tools/aggregate.d.ts.map +1 -1
  95. package/dist/tools/aggregate.js +2 -3
  96. package/dist/tools/aggregate.js.map +1 -1
  97. package/dist/tools/all-fields-cap.d.ts.map +1 -1
  98. package/dist/tools/all-fields-cap.js +3 -38
  99. package/dist/tools/all-fields-cap.js.map +1 -1
  100. package/dist/tools/atf-author-module.d.ts +28 -7
  101. package/dist/tools/atf-author-module.d.ts.map +1 -1
  102. package/dist/tools/atf-author-module.js +4 -2
  103. package/dist/tools/atf-author-module.js.map +1 -1
  104. package/dist/tools/atf-contracts.d.ts +135 -829
  105. package/dist/tools/atf-contracts.d.ts.map +1 -1
  106. package/dist/tools/atf-shared.js +2 -2
  107. package/dist/tools/atf-shared.js.map +1 -1
  108. package/dist/tools/atf-step-catalog.d.ts +3 -7
  109. package/dist/tools/atf-step-catalog.d.ts.map +1 -1
  110. package/dist/tools/atf-step-catalog.js +12 -5
  111. package/dist/tools/atf-step-catalog.js.map +1 -1
  112. package/dist/tools/atf.d.ts +8 -24
  113. package/dist/tools/atf.d.ts.map +1 -1
  114. package/dist/tools/atf.js +2 -2
  115. package/dist/tools/atf.js.map +1 -1
  116. package/dist/tools/attach.d.ts +6 -22
  117. package/dist/tools/attach.d.ts.map +1 -1
  118. package/dist/tools/batch.d.ts +18 -71
  119. package/dist/tools/batch.d.ts.map +1 -1
  120. package/dist/tools/batch.js +544 -96
  121. package/dist/tools/batch.js.map +1 -1
  122. package/dist/tools/catalog.d.ts +2 -2
  123. package/dist/tools/catalog.d.ts.map +1 -1
  124. package/dist/tools/catalog.js +7 -1
  125. package/dist/tools/catalog.js.map +1 -1
  126. package/dist/tools/codesearch.d.ts +1 -13
  127. package/dist/tools/codesearch.d.ts.map +1 -1
  128. package/dist/tools/create-module.d.ts +9 -14
  129. package/dist/tools/create-module.d.ts.map +1 -1
  130. package/dist/tools/create-module.js +4 -8
  131. package/dist/tools/create-module.js.map +1 -1
  132. package/dist/tools/delete.d.ts +1 -9
  133. package/dist/tools/delete.d.ts.map +1 -1
  134. package/dist/tools/delete.js +2 -3
  135. package/dist/tools/delete.js.map +1 -1
  136. package/dist/tools/discover.d.ts +6 -14
  137. package/dist/tools/discover.d.ts.map +1 -1
  138. package/dist/tools/flow-view-contracts.d.ts +1023 -0
  139. package/dist/tools/flow-view-contracts.d.ts.map +1 -0
  140. package/dist/tools/flow-view-contracts.js +570 -0
  141. package/dist/tools/flow-view-contracts.js.map +1 -0
  142. package/dist/tools/flow-view-graph.d.ts +86 -0
  143. package/dist/tools/flow-view-graph.d.ts.map +1 -0
  144. package/dist/tools/flow-view-graph.js +993 -0
  145. package/dist/tools/flow-view-graph.js.map +1 -0
  146. package/dist/tools/flow-view-gzip.d.ts +52 -0
  147. package/dist/tools/flow-view-gzip.d.ts.map +1 -0
  148. package/dist/tools/flow-view-gzip.js +179 -0
  149. package/dist/tools/flow-view-gzip.js.map +1 -0
  150. package/dist/tools/flow-view-mermaid.d.ts +37 -0
  151. package/dist/tools/flow-view-mermaid.d.ts.map +1 -0
  152. package/dist/tools/flow-view-mermaid.js +337 -0
  153. package/dist/tools/flow-view-mermaid.js.map +1 -0
  154. package/dist/tools/flow-view-module.d.ts +61 -0
  155. package/dist/tools/flow-view-module.d.ts.map +1 -0
  156. package/dist/tools/flow-view-module.js +378 -0
  157. package/dist/tools/flow-view-module.js.map +1 -0
  158. package/dist/tools/flow-view-policy.d.ts +106 -0
  159. package/dist/tools/flow-view-policy.d.ts.map +1 -0
  160. package/dist/tools/flow-view-policy.js +461 -0
  161. package/dist/tools/flow-view-policy.js.map +1 -0
  162. package/dist/tools/flow-view-renderers.d.ts +68 -0
  163. package/dist/tools/flow-view-renderers.d.ts.map +1 -0
  164. package/dist/tools/flow-view-renderers.js +513 -0
  165. package/dist/tools/flow-view-renderers.js.map +1 -0
  166. package/dist/tools/flow-view-table.d.ts +115 -0
  167. package/dist/tools/flow-view-table.d.ts.map +1 -0
  168. package/dist/tools/flow-view-table.js +1002 -0
  169. package/dist/tools/flow-view-table.js.map +1 -0
  170. package/dist/tools/get-module.d.ts +36 -42
  171. package/dist/tools/get-module.d.ts.map +1 -1
  172. package/dist/tools/health.d.ts +9 -6
  173. package/dist/tools/health.d.ts.map +1 -1
  174. package/dist/tools/incident-journal-module.d.ts +8 -7
  175. package/dist/tools/incident-journal-module.d.ts.map +1 -1
  176. package/dist/tools/index.d.ts +4 -4
  177. package/dist/tools/index.d.ts.map +1 -1
  178. package/dist/tools/index.js +43 -6
  179. package/dist/tools/index.js.map +1 -1
  180. package/dist/tools/markdown.d.ts +27 -0
  181. package/dist/tools/markdown.d.ts.map +1 -1
  182. package/dist/tools/markdown.js +104 -1
  183. package/dist/tools/markdown.js.map +1 -1
  184. package/dist/tools/nl.d.ts +1 -11
  185. package/dist/tools/nl.d.ts.map +1 -1
  186. package/dist/tools/profile.d.ts +1 -1
  187. package/dist/tools/profile.d.ts.map +1 -1
  188. package/dist/tools/profile.js +19 -1
  189. package/dist/tools/profile.js.map +1 -1
  190. package/dist/tools/query-module.d.ts +59 -71
  191. package/dist/tools/query-module.d.ts.map +1 -1
  192. package/dist/tools/query-module.js +2 -2
  193. package/dist/tools/query-module.js.map +1 -1
  194. package/dist/tools/record-write-shared.d.ts.map +1 -1
  195. package/dist/tools/record-write-shared.js +19 -2
  196. package/dist/tools/record-write-shared.js.map +1 -1
  197. package/dist/tools/relationships.d.ts +6 -22
  198. package/dist/tools/relationships.d.ts.map +1 -1
  199. package/dist/tools/result-envelope.d.ts +2255 -1357
  200. package/dist/tools/result-envelope.d.ts.map +1 -1
  201. package/dist/tools/result-envelope.js +24 -2
  202. package/dist/tools/result-envelope.js.map +1 -1
  203. package/dist/tools/schema-module.d.ts +36 -21
  204. package/dist/tools/schema-module.d.ts.map +1 -1
  205. package/dist/tools/schema-module.js +106 -65
  206. package/dist/tools/schema-module.js.map +1 -1
  207. package/dist/tools/script.d.ts +1 -11
  208. package/dist/tools/script.d.ts.map +1 -1
  209. package/dist/tools/syslog.d.ts +11 -18
  210. package/dist/tools/syslog.d.ts.map +1 -1
  211. package/dist/tools/syslog.js +2 -3
  212. package/dist/tools/syslog.js.map +1 -1
  213. package/dist/tools/table-hierarchy.d.ts +35 -0
  214. package/dist/tools/table-hierarchy.d.ts.map +1 -0
  215. package/dist/tools/table-hierarchy.js +74 -0
  216. package/dist/tools/table-hierarchy.js.map +1 -0
  217. package/dist/tools/tool-module.d.ts +40 -15
  218. package/dist/tools/tool-module.d.ts.map +1 -1
  219. package/dist/tools/tool-module.js +755 -205
  220. package/dist/tools/tool-module.js.map +1 -1
  221. package/dist/tools/update-module.d.ts +11 -17
  222. package/dist/tools/update-module.d.ts.map +1 -1
  223. package/dist/tools/update-module.js +10 -12
  224. package/dist/tools/update-module.js.map +1 -1
  225. package/dist/version.d.ts +1 -1
  226. package/dist/version.d.ts.map +1 -1
  227. package/dist/version.js +1 -1
  228. package/dist/version.js.map +1 -1
  229. package/dist/write-value-policy.d.ts +20 -12
  230. package/dist/write-value-policy.d.ts.map +1 -1
  231. package/dist/write-value-policy.js +179 -67
  232. package/dist/write-value-policy.js.map +1 -1
  233. package/docs/ADDING-TOOLS.md +22 -13
  234. package/docs/CLIENT-SETUP.md +110 -52
  235. package/docs/CROSS-CLIENT-RELEASE-MATRIX.md +2 -2
  236. package/docs/FLOW-VIEW.md +214 -0
  237. package/docs/PRODUCTION-SECURITY.md +154 -25
  238. package/docs/RELEASE-VALIDATION.md +2 -2
  239. package/docs/TESTING-OAUTH.md +1 -1
  240. package/docs/V2-MIGRATION.md +404 -30
  241. package/package.json +20 -6
  242. package/scripts/release-validate.mjs +56 -0
  243. package/server.json +22 -0
  244. package/tools/inspector/package-lock.json +163 -201
package/.env.example CHANGED
@@ -27,9 +27,12 @@ MCP_CLIENT_ID=example-client
27
27
 
28
28
  # Deny-by-default example policy. This permits only bounded incident reads.
29
29
  # For local exploratory read-only testing, SN_ALLOWED_READ_TABLES=* plus the
30
- # SN_FIELD_POLICY_DEFINITIONS wildcard below allows all non-hard-denied readable
31
- # tables/fields. Keep writes exact unless you intentionally want broad mutation
32
- # access.
30
+ # SN_FIELD_POLICY_DEFINITIONS wildcard below allows reads of every table and
31
+ # every field except sensitive-looking names (password, token, secret and
32
+ # similar), bounded by the account's ServiceNow ACLs. SN_FIELD_POLICY_DEFINITIONS
33
+ # applies only to this environment profile; if ~/.servicenow-mcp/config.json
34
+ # exists, setting it stops startup. Keep writes exact unless you intentionally
35
+ # want broad mutation access.
33
36
  SN_ALLOWED_READ_TABLES=incident
34
37
  SN_ALLOWED_WRITE_TABLES=
35
38
  SN_TABLE_ACCESS_TARGETS=[{"table":"incident","kind":"canonical","tools":["sn_query","sn_get"],"closureComplete":true,"relatedTables":["incident"]}]
package/CHANGELOG.md CHANGED
@@ -5,6 +5,292 @@ All notable changes to this project are documented here.
5
5
  The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [Unreleased]
9
+
10
+ ## [2.2.0] — 2026-10-30
11
+
12
+ 2.2.0 is the first stable release since 2.1.0. It contains everything
13
+ published on the `dev` channel as 2.2.0-dev.1 through 2.2.0-dev.6 (listed
14
+ under those versions below) plus the changes in this section. Numbers in
15
+ parentheses are the pull requests that made each change.
16
+
17
+ > **Upgrade every install: this release fixes a denial-of-service
18
+ > vulnerability.** A single oversized or deeply nested request could make the
19
+ > server exhaust its memory and stop. See **Security** below.
20
+ >
21
+ > **Read this before upgrading.** 2.2.0 can stop a working install from
22
+ > starting, and it changes what some profiles may write:
23
+ >
24
+ > - The server refuses to start while `SN_FIELD_POLICY_DEFINITIONS` is set and
25
+ > `~/.servicenow-mcp/config.json` exists.
26
+ > - A malformed or ambiguous field policy in `config.json` now stops the whole
27
+ > file from loading. The server, `servicenow-mcp-setup` and
28
+ > `servicenow-mcp-profile` all refuse it until you fix it by hand.
29
+ > - `sn_create`, `sn_update` and `sn_batch` can append `comments` and
30
+ > `work_notes` on every table a profile may write. Leaving the dedicated
31
+ > journal tools off a target no longer withholds journals.
32
+ > - `sn_create` and `sn_update` writes to `incident` are no longer limited to
33
+ > 14 typed fields: every field the profile's field policy allows, such as
34
+ > `watch_list`, can now be written.
35
+ > - `["*"]` in a field set now means every field. A profile that used it, and
36
+ > so failed every call, becomes fully open.
37
+ > - `readable: []` no longer blocks writes to its table. Add `writable: []` to
38
+ > keep writes blocked.
39
+ >
40
+ > [Upgrading to 2.2.0](docs/V2-MIGRATION.md#upgrading-to-220) lists every case
41
+ > with its remedy.
42
+
43
+ ### Security
44
+
45
+ - **Denial-of-service fix: oversized requests are rejected before
46
+ validation.** A single very large or deeply nested request could make
47
+ the server use far more memory and time than its size suggests, until it
48
+ stopped responding. Every
49
+ incoming message, over stdio and HTTP, now passes plain structural checks
50
+ before any schema runs, and one outside the limits is rejected with a short,
51
+ fixed error. The limits admit the largest call any tool accepts, so
52
+ legitimate calls are not affected. (#16)
53
+ - Messages: arrays of at most 10,000 elements, at most 52,176 array
54
+ elements and object members in total, and at most 32 levels of nesting.
55
+ Over HTTP such a message gets a 400 with JSON-RPC error `-32600`
56
+ `Request exceeds structural limits.`; over stdio a request with a usable
57
+ id gets the same error, and anything else is dropped.
58
+ - Tool arguments: at most 52,112 array elements and object members.
59
+ - `structured_query`: at most 2,048 values, 12 levels deep, arrays of 32,
60
+ objects of 8 keys, 64 conditions and 65 groups. Any query the compiler
61
+ accepts is within these.
62
+ - Existing collection limits (`sn_atf_author` `steps` and `test_sys_ids`,
63
+ `structured_query` `order_by`, group `conditions`, set `values`, ATF
64
+ name-value inputs) are checked before any element is parsed.
65
+ - **Dependency advisories.** `zod` moves to 4.6.7, pinned exactly
66
+ (GHSA-mrhx-c7xc-m3w5, CVE-2023-54404; no 3.x release is fixed).
67
+ `@modelcontextprotocol/sdk` moves to 1.32.2 (GHSA-22jm-h49p-29qw,
68
+ GHSA-6prh-2h8m-c8cw, GHSA-46jr-4wx8-v453, GHSA-rvq5-wwqv-78pq, and
69
+ GHSA-6qxp-vccf-f47h in the SDK's client-side OAuth flow, which this server
70
+ does not use). `body-parser` (GHSA-27r3-jxmh-p828), `fast-uri`
71
+ (GHSA-w74x-v6f9-j3xg), `hono`, `iconv-lite`, `ip-address`, `proxy-addr`
72
+ (GHSA-jqcg-44mw-7w3h, critical) and `qs` take their fixed releases, and `npm audit --omit=dev` reports nothing. The
73
+ container's runtime base, `gcr.io/distroless/nodejs22-debian13:nonroot`, is
74
+ pinned to a digest with `libssl3t64` 3.5.7-1~deb13u3 (CVE-2026-84782) and
75
+ Node 22.23.3. (#10, #16)
76
+ - *`@hono/node-server` 2.1.3* (GHSA-rmxm-3fg6-px4f, medium). Its
77
+ `serveStatic` decoded the request path twice, so a crafted path could skip
78
+ middleware mounted on a static prefix. This server never uses
79
+ `serveStatic`: the SDK's HTTP transport uses only the adapter's request
80
+ listener, and the stdio server does not load the adapter at all. The
81
+ upgrade keeps `npm audit` clean. The developer-only inspector's lockfile
82
+ moves to 2.1.5.
83
+ - **Redirects are no longer followed.** API calls and the OAuth token request
84
+ used to follow HTTP redirects: a cross-origin redirect forwarded an API-key
85
+ header, and a 307 re-sent the token request body, which holds the client
86
+ secret. Any 3xx now fails with "The instance redirected the request to
87
+ another location", without echoing the `Location`. (#15)
88
+ - **Omitting the journal tools no longer withholds journals.** A profile that
89
+ grants `sn_create`, `sn_update` or `sn_batch` on a table can now append
90
+ `comments` and `work_notes` there, and `sn_batch` can post one
91
+ customer-visible comment per matched record, each of which can send a
92
+ notification. To withhold comments, set `fieldPolicy.<table>.writable` to an
93
+ explicit list without `comments`, and narrow parent tables such as `task`
94
+ the same way. (#11)
95
+ - **Journal writes are never re-sent.** The HTTP client no longer retries a
96
+ `PATCH` or `PUT` that sets `comments` or `work_notes` after a 502, 503, 504
97
+ or connection error, because the first attempt may already have appended
98
+ the entry. A 429 is still retried and a 401 still refreshes once. Detection is by field
99
+ name (`comments`, `work_notes`); see
100
+ [Production security boundaries](docs/PRODUCTION-SECURITY.md#journal-content). (#11)
101
+ - `servicenow-mcp-setup grant` applies its default tools only to the tables,
102
+ and the operations, named in that command. A re-grant could widen a target
103
+ narrowed with `--tools`, or make a table reachable only as a related table
104
+ directly readable or writable. (#11)
105
+ - `sn_batch` targets each matched record once per run and stops at a 401
106
+ instead of retrying every remaining record with rejected credentials. It
107
+ always looks up its records on the instance, never in the metadata cache, so
108
+ a repeat run cannot act on an earlier run's matches. (#9, #11)
109
+ - **Metadata cache.** The cache no longer reads `sys_user` or
110
+ `sys_properties`; remove any read grant on either table that you added only
111
+ for it, because `sys_properties` rows can hold integration secrets. Cache
112
+ entries are partitioned by credential, not by the ServiceNow user it runs
113
+ as: after re-mapping a client-credentials application or API key to another
114
+ user, or restricting that user, restart the server or rotate the secret.
115
+ Table and field policy still apply on every call, cached or not. Until an
116
+ entry is refetched, a tightened ServiceNow ACL is not seen: by default up to
117
+ 24 hours for metadata (configurable to 7 days) and 5 minutes for
118
+ `sn_schema`. `sn_schema`
119
+ returns `inherited_from` only where the profile can read `super_class` on
120
+ `sys_db_object`. (#9)
121
+ - **`sn_flow_view` reads `sys_variable_value` and `var_dictionary`.**
122
+ `sys_variable_value` is a system table, so a profile's `"*"` field-policy
123
+ entry does not narrow it; name it to hide older flows' input values. Grant
124
+ the flow tables with `tools: ["sn_flow_view"]`, as `grant --flows` does, to
125
+ keep the generic read tools off them. See
126
+ [docs/FLOW-VIEW.md](docs/FLOW-VIEW.md#field-policy). (#18)
127
+
128
+ ### Added
129
+
130
+ - **`sn_flow_view`, the 24th tool.** It shows one Flow Designer flow or
131
+ subflow as a Mermaid diagram, a numbered outline and a structured graph:
132
+ trigger, steps, If / Else If / Else, loops, parallel branches, Try / Catch,
133
+ input values and data pill labels, and the subflows it calls to depth 3. It
134
+ is read-only, reads 15 `sys_hub_*` and variable tables through the Table API
135
+ under the profile's table and field policy, and never calls Flow Designer's
136
+ internal API. Input values are shown by default, with sensitive names and
137
+ password types redacted; `include_inputs: false` reads no values. The
138
+ result fits `max_response_bytes` (default 100,000). See
139
+ [docs/FLOW-VIEW.md](docs/FLOW-VIEW.md). Thanks to Jace Benson's `jsn` CLI,
140
+ whose flow inspection informed the approach; no `jsn` code is used. (#18)
141
+ - `servicenow-mcp-setup grant --flows` grants read on the `sn_flow_view`
142
+ tables, bound to `sn_flow_view` only. (#18)
143
+ - **Policy card.** `sn_profile` returns the profile's effective policy as data
144
+ (`policy`) and as a text table (`policy_card`), and
145
+ `servicenow-mcp-setup policy show --profile <name> [--json]` prints the same
146
+ card: readable and writable tables with their tools, field rules, class and
147
+ domain fields that need explicit listing, auth type, raw encoded-query
148
+ reads, ATF grants and `sn_batch` limits. It never prints a secret, key or
149
+ credential reference, and it enforces nothing new. The data is held to
150
+ 40,000 bytes and the text to 24,000; `policy.truncated` says what was cut.
151
+ (#17)
152
+ - **`sn_batch` dry runs show a sample.** A dry run also returns up to 5
153
+ matched records (`sys_id` plus a `number`, `name`, `short_description` or
154
+ `title` the profile may read), `fields_to_write` (names, never values) and a
155
+ note that `confirm` re-runs the query. The sample costs one extra read; if
156
+ it fails or takes more than 5 seconds, the dry run still returns the count.
157
+ A target granted only `sn_batch` can therefore now see up to 5 display
158
+ values in a dry run, where before it saw a count. (#17)
159
+ - **Warnings on risky grants.** `servicenow-mcp-setup grant` and the setup
160
+ wizard warn when a grant gives write access to a privilege-sensitive table:
161
+ roles, groups, delegation, ACLs, approvals, scripts, `sys_properties`,
162
+ `sys_user`, `sys_user_group` and authentication tables. The wizard also
163
+ warns on the `"*"` write wildcard, which `grant` rejects. The grant still
164
+ goes ahead; `grant --json` carries the text in `warnings`. (#17)
165
+ - **Journal fields through the generic write tools, on every table.**
166
+ `sn_create`, `sn_update` and `sn_batch` accept `comments` and `work_notes`
167
+ on every table granted for writes, with the dedicated tools' bounds, and
168
+ field policy decides permission. The dedicated tools remain. (#11)
169
+ - `sn_batch` results carry a `message` saying how many records were not
170
+ confirmed or not sent, and why the run stopped. (#11)
171
+ - **MCP Registry metadata.** `package.json` declares `mcpName`
172
+ `io.github.onlyflowstech/servicenow-mcp`, and the package ships the
173
+ `server.json` manifest for the official MCP Registry. (#14)
174
+ - The README leads with what the server controls and what it does not, lists
175
+ the tools by area, and documents per-profile field policy. `AGENTS.md`
176
+ describes how contributors' AI agents work in this repository. (#11, #13,
177
+ #14)
178
+ - From the 2.2.0 dev builds: the ATF tools `sn_atf_author`, `sn_atf_run`,
179
+ `sn_atf_results` and `sn_atf_readiness`, with `setup grant --atf`;
180
+ Windows support in `servicenow-mcp-setup`; and the npm `dev` channel for
181
+ prereleases (`npm install -g @onlyflows/servicenow-mcp@dev`). Details are
182
+ under 2.2.0-dev.1 through 2.2.0-dev.6 below.
183
+
184
+ ### Changed
185
+
186
+ - **Field policy and journal rules (breaking for some profiles).** Each item
187
+ below has its remedy in
188
+ [Upgrading to 2.2.0](docs/V2-MIGRATION.md#upgrading-to-220). (#11)
189
+ - `SN_FIELD_POLICY_DEFINITIONS` configures only the `SN_PROFILE_NAME`
190
+ environment profile. While it is set and a config file supplies the
191
+ profiles, the server, `servicenow-mcp-setup` and `servicenow-mcp-profile`
192
+ refuse to start and say how to move the policy into each profile's
193
+ `fieldPolicy`.
194
+ - Field policy is validated when profiles load. A malformed `fieldPolicy`,
195
+ `readableTableFields` or `writableTableFields` used to deny every call on
196
+ its profile, or narrow nothing; it now stops startup with the profile, key
197
+ path and table named and no configured value repeated. One bad profile
198
+ stops the whole file from loading.
199
+ - A profile's `"*"` field-policy entry now reaches `incident`,
200
+ `change_request`, `problem`, `sc_request`, `sc_req_item`, `sc_task`,
201
+ `task`, `cmdb_ci`, `cmdb_ci_server`, `cmdb_ci_computer`, `kb_knowledge`
202
+ and every custom table, so `{"*": {"writable": []}}` now denies writes to
203
+ them. The 23 built-in system tables still never take it.
204
+ - `sys_class_name`, `sys_class_path`, `sys_domain` and `sys_domain_path`
205
+ are written only where a profile lists them by name; no wildcard covers
206
+ them.
207
+ - `sn_incident_add_comment` and `sn_incident_add_work_note` are denied when
208
+ the incident's `writable` set leaves out `comments` or `work_notes`.
209
+ - `incident` accepts every field the profile allows, not only the 14 typed
210
+ fields; those 14 keep their typed checks.
211
+ - `["*"]` in a field set means every field; it used to fail every call.
212
+ `readable: []` no longer blocks writes as a side effect; add
213
+ `writable: []` for that.
214
+ - A dot-walked or `variables.*` write key is denied with the reason
215
+ `unsupported_field_path`, and a write-value denial names the field and
216
+ table, never the value.
217
+ - **`sn_batch` uses the ServiceNow REST Batch API and never re-sends a batch
218
+ that may have reached the instance.** Confirmed updates and deletes go up to
219
+ 50 records per request, with each request kept under 4 MiB unless one
220
+ record alone exceeds about 3 MiB, which is then sent on its own. A batch
221
+ sub-request that fails with a server error is reported as unconfirmed, not
222
+ retried. The run falls back to one Table API call per record only when the
223
+ instance refuses a batch request (401, 403 or 404), and only for that
224
+ batch's records and the ones after it. That fallback follows the HTTP
225
+ client's retry rules: an ordinary update or delete is retried up to twice
226
+ after a 502, 503, 504 or connection error, and a journal write is re-sent
227
+ only after a 429 or a 401 credential refresh, when ServiceNow has not
228
+ processed it. A rate limit (429) that persists through the client's retries
229
+ stops the run with the `Retry-After` hint. Unconfirmed records count as
230
+ neither processed nor failed; records not sent count as failed. (#11)
231
+ - `servicenow-mcp-setup grant --write incident` also binds the two incident
232
+ journal tools; comments are customer-visible. An explicit `--tools` list
233
+ withholds them. Existing profiles are not changed. (#11)
234
+ - `sn_update` advertises `idempotentHint: false`, because a journal field
235
+ appends an entry on every call. (#11)
236
+ - **Metadata caching works in every auth mode.** Freshness is checked against
237
+ the table's row count and newest `sys_updated_on`, so OAuth
238
+ `client_credentials` and API-key profiles, where the cache used to turn
239
+ itself off, now cache too. `sn_schema` results are reused for 5 minutes
240
+ (`schemaCacheTtlMs` / `SN_SCHEMA_CACHE_TTL_MS`, up to 1 hour), and
241
+ `force_recache: true` refreshes one read. (#9)
242
+ - **zod 4 is visible to clients in three ways.** Input validation errors
243
+ reported by the MCP SDK use zod 4's wording (for example `Invalid input:
244
+ expected string, received undefined` instead of `Required`); tool schemas
245
+ are served inline instead of with internal `$ref`s, which adds about 18 KB
246
+ to `tools/list`; and integer fields in output schemas state the
247
+ safe-integer range. Tools accept and reject the same input as before. (#16)
248
+ - **Less memory at startup.** The startup tool-catalog check no longer
249
+ compiles output-schema validators it never uses, which saves about 6 MB of
250
+ idle memory in a stdio server. Validation of real calls is unchanged. (#19)
251
+
252
+ ### Fixed
253
+
254
+ - A hibernating developer instance, and any other HTML page returned instead
255
+ of an API response (single sign-on, maintenance, proxy), now gives a clear
256
+ error instead of a generic upstream failure: "The ServiceNow instance
257
+ <host> appears to be hibernating ... wake it at
258
+ https://developer.servicenow.com", or a fixed "returned an HTML page"
259
+ message. A 200 response that is not valid JSON gets a fixed message too,
260
+ and none of these repeats response text. The setup wizard and
261
+ `servicenow-mcp-setup doctor --live` no longer print raw error messages, and
262
+ `doctor --live` checks profiles concurrently with a 10-second timeout. (#15)
263
+ - `incident` fields outside the 14 typed ones, such as `cmdb_ci`,
264
+ `business_service`, `watch_list`, `hold_reason` and every `u_`/`x_` custom
265
+ field, are writable. Incident `description`, `close_notes`, choice fields
266
+ and the reference fields `caller_id`, `assignment_group` and `assigned_to`
267
+ can be cleared with `""` or `null`. (#11)
268
+ - Generic writes accept `null`, finite decimals such as `12.5`, arrays for
269
+ list fields such as `watch_list`, and the `{value, display_value, link}`
270
+ read shape. (#11)
271
+ - `sn_batch` applies the same value policy as `sn_update` and sends the
272
+ canonical values; it used to send the caller's values unchecked. It now
273
+ uses the documented REST Batch API shape, so a batch the instance had
274
+ already applied is no longer replayed one record at a time, and a large
275
+ batch no longer becomes a request of tens of megabytes. (#11)
276
+ - Write responses always include the written record's `sys_id`, so a
277
+ successful create no longer reads as a failure that invites a duplicate
278
+ retry. (#11)
279
+ - The metadata cache no longer serves stale rows on accounts east of UTC, and
280
+ it detects deletes. A table whose newest row is dated in the future is not
281
+ cached. (#9)
282
+ - `sn_schema` and `fields: "all"` follow a table's parents by name instead of
283
+ by label, so hierarchies such as `alm_hardware` keep their inherited
284
+ fields. (#9)
285
+ - `servicenow-mcp-setup` offers a table's parent by name, not by label, and
286
+ fetches one OAuth token for its parent lookups. The `relatedTables`
287
+ documentation, `grant` output and `--related` help now say what
288
+ `grant --related` adds. (#12)
289
+ - From the 2.2.0 dev builds: tool schemas no longer declare JSON Schema
290
+ draft-07, which clients on the current MCP specification refused
291
+ (2.2.0-dev.6), and `servicenow-mcp-setup` finds client CLIs and registers
292
+ clients on native Windows (2.2.0-dev.6).
293
+
8
294
  ## [2.2.0-dev.6] — 2026-09-16
9
295
 
10
296
  ### Fixed