@onlyflows/servicenow-mcp 1.0.0 → 2.1.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 (281) hide show
  1. package/.env.example +56 -0
  2. package/CHANGELOG.md +214 -0
  3. package/README.md +939 -101
  4. package/dist/auth.d.ts +88 -0
  5. package/dist/auth.d.ts.map +1 -0
  6. package/dist/auth.js +396 -0
  7. package/dist/auth.js.map +1 -0
  8. package/dist/client.d.ts +111 -17
  9. package/dist/client.d.ts.map +1 -1
  10. package/dist/client.js +554 -79
  11. package/dist/client.js.map +1 -1
  12. package/dist/config.d.ts +41 -4
  13. package/dist/config.d.ts.map +1 -1
  14. package/dist/config.js +44 -34
  15. package/dist/config.js.map +1 -1
  16. package/dist/encoded-query-policy.d.ts +72 -0
  17. package/dist/encoded-query-policy.d.ts.map +1 -0
  18. package/dist/encoded-query-policy.js +409 -0
  19. package/dist/encoded-query-policy.js.map +1 -0
  20. package/dist/execution-context.d.ts +235 -0
  21. package/dist/execution-context.d.ts.map +1 -0
  22. package/dist/execution-context.js +441 -0
  23. package/dist/execution-context.js.map +1 -0
  24. package/dist/field-policy.d.ts +117 -0
  25. package/dist/field-policy.d.ts.map +1 -0
  26. package/dist/field-policy.js +1684 -0
  27. package/dist/field-policy.js.map +1 -0
  28. package/dist/http-auth.d.ts +131 -0
  29. package/dist/http-auth.d.ts.map +1 -0
  30. package/dist/http-auth.js +347 -0
  31. package/dist/http-auth.js.map +1 -0
  32. package/dist/http-entrypoint.d.ts +26 -0
  33. package/dist/http-entrypoint.d.ts.map +1 -0
  34. package/dist/http-entrypoint.js +255 -0
  35. package/dist/http-entrypoint.js.map +1 -0
  36. package/dist/http-observability.d.ts +147 -0
  37. package/dist/http-observability.d.ts.map +1 -0
  38. package/dist/http-observability.js +711 -0
  39. package/dist/http-observability.js.map +1 -0
  40. package/dist/http-request-policy.d.ts +72 -0
  41. package/dist/http-request-policy.d.ts.map +1 -0
  42. package/dist/http-request-policy.js +463 -0
  43. package/dist/http-request-policy.js.map +1 -0
  44. package/dist/http-request-signal.d.ts +12 -0
  45. package/dist/http-request-signal.d.ts.map +1 -0
  46. package/dist/http-request-signal.js +39 -0
  47. package/dist/http-request-signal.js.map +1 -0
  48. package/dist/http-runtime.d.ts +77 -0
  49. package/dist/http-runtime.d.ts.map +1 -0
  50. package/dist/http-runtime.js +1321 -0
  51. package/dist/http-runtime.js.map +1 -0
  52. package/dist/incident-journal-policy.d.ts +22 -0
  53. package/dist/incident-journal-policy.d.ts.map +1 -0
  54. package/dist/incident-journal-policy.js +115 -0
  55. package/dist/incident-journal-policy.js.map +1 -0
  56. package/dist/index.d.ts +14 -4
  57. package/dist/index.d.ts.map +1 -1
  58. package/dist/index.js +140 -36
  59. package/dist/index.js.map +1 -1
  60. package/dist/metadata-cache.d.ts +71 -0
  61. package/dist/metadata-cache.d.ts.map +1 -0
  62. package/dist/metadata-cache.js +397 -0
  63. package/dist/metadata-cache.js.map +1 -0
  64. package/dist/profile-admin.d.ts +64 -0
  65. package/dist/profile-admin.d.ts.map +1 -0
  66. package/dist/profile-admin.js +351 -0
  67. package/dist/profile-admin.js.map +1 -0
  68. package/dist/profile-credentials.d.ts +68 -0
  69. package/dist/profile-credentials.d.ts.map +1 -0
  70. package/dist/profile-credentials.js +329 -0
  71. package/dist/profile-credentials.js.map +1 -0
  72. package/dist/profile-manager.d.ts +187 -0
  73. package/dist/profile-manager.d.ts.map +1 -0
  74. package/dist/profile-manager.js +1026 -0
  75. package/dist/profile-manager.js.map +1 -0
  76. package/dist/record-identifier-policy.d.ts +39 -0
  77. package/dist/record-identifier-policy.d.ts.map +1 -0
  78. package/dist/record-identifier-policy.js +203 -0
  79. package/dist/record-identifier-policy.js.map +1 -0
  80. package/dist/runtime-environment.d.ts +23 -0
  81. package/dist/runtime-environment.d.ts.map +1 -0
  82. package/dist/runtime-environment.js +58 -0
  83. package/dist/runtime-environment.js.map +1 -0
  84. package/dist/server.d.ts +33 -0
  85. package/dist/server.d.ts.map +1 -0
  86. package/dist/server.js +73 -0
  87. package/dist/server.js.map +1 -0
  88. package/dist/servicenow-identifiers.d.ts +8 -0
  89. package/dist/servicenow-identifiers.d.ts.map +1 -0
  90. package/dist/servicenow-identifiers.js +22 -0
  91. package/dist/servicenow-identifiers.js.map +1 -0
  92. package/dist/setup-prompts.d.ts +7 -0
  93. package/dist/setup-prompts.d.ts.map +1 -0
  94. package/dist/setup-prompts.js +123 -0
  95. package/dist/setup-prompts.js.map +1 -0
  96. package/dist/setup.d.ts +109 -0
  97. package/dist/setup.d.ts.map +1 -0
  98. package/dist/setup.js +1903 -0
  99. package/dist/setup.js.map +1 -0
  100. package/dist/startup.d.ts +43 -0
  101. package/dist/startup.d.ts.map +1 -0
  102. package/dist/startup.js +75 -0
  103. package/dist/startup.js.map +1 -0
  104. package/dist/stdio-runtime.d.ts +106 -0
  105. package/dist/stdio-runtime.d.ts.map +1 -0
  106. package/dist/stdio-runtime.js +231 -0
  107. package/dist/stdio-runtime.js.map +1 -0
  108. package/dist/structured-query.d.ts +187 -0
  109. package/dist/structured-query.d.ts.map +1 -0
  110. package/dist/structured-query.js +503 -0
  111. package/dist/structured-query.js.map +1 -0
  112. package/dist/table-defaults.d.ts +28 -0
  113. package/dist/table-defaults.d.ts.map +1 -0
  114. package/dist/table-defaults.js +85 -0
  115. package/dist/table-defaults.js.map +1 -0
  116. package/dist/table-policy.d.ts +71 -0
  117. package/dist/table-policy.d.ts.map +1 -0
  118. package/dist/table-policy.js +290 -0
  119. package/dist/table-policy.js.map +1 -0
  120. package/dist/tool-error.d.ts +48 -0
  121. package/dist/tool-error.d.ts.map +1 -0
  122. package/dist/tool-error.js +139 -0
  123. package/dist/tool-error.js.map +1 -0
  124. package/dist/tool-table-access.d.ts +19 -0
  125. package/dist/tool-table-access.d.ts.map +1 -0
  126. package/dist/tool-table-access.js +388 -0
  127. package/dist/tool-table-access.js.map +1 -0
  128. package/dist/tools/aggregate.d.ts +22 -42
  129. package/dist/tools/aggregate.d.ts.map +1 -1
  130. package/dist/tools/aggregate.js +103 -47
  131. package/dist/tools/aggregate.js.map +1 -1
  132. package/dist/tools/all-fields-cap.d.ts +45 -0
  133. package/dist/tools/all-fields-cap.d.ts.map +1 -0
  134. package/dist/tools/all-fields-cap.js +151 -0
  135. package/dist/tools/all-fields-cap.js.map +1 -0
  136. package/dist/tools/atf.d.ts +21 -60
  137. package/dist/tools/atf.d.ts.map +1 -1
  138. package/dist/tools/atf.js +180 -116
  139. package/dist/tools/atf.js.map +1 -1
  140. package/dist/tools/attach.d.ts +31 -45
  141. package/dist/tools/attach.d.ts.map +1 -1
  142. package/dist/tools/attach.js +175 -137
  143. package/dist/tools/attach.js.map +1 -1
  144. package/dist/tools/batch.d.ts +78 -42
  145. package/dist/tools/batch.d.ts.map +1 -1
  146. package/dist/tools/batch.js +172 -68
  147. package/dist/tools/batch.js.map +1 -1
  148. package/dist/tools/catalog.d.ts +6 -0
  149. package/dist/tools/catalog.d.ts.map +1 -0
  150. package/dist/tools/catalog.js +203 -0
  151. package/dist/tools/catalog.js.map +1 -0
  152. package/dist/tools/codesearch.d.ts +14 -25
  153. package/dist/tools/codesearch.d.ts.map +1 -1
  154. package/dist/tools/codesearch.js +60 -48
  155. package/dist/tools/codesearch.js.map +1 -1
  156. package/dist/tools/create-module.d.ts +48 -0
  157. package/dist/tools/create-module.d.ts.map +1 -0
  158. package/dist/tools/create-module.js +98 -0
  159. package/dist/tools/create-module.js.map +1 -0
  160. package/dist/tools/create.d.ts +2 -38
  161. package/dist/tools/create.d.ts.map +1 -1
  162. package/dist/tools/create.js +9 -41
  163. package/dist/tools/create.js.map +1 -1
  164. package/dist/tools/delete.d.ts +13 -23
  165. package/dist/tools/delete.d.ts.map +1 -1
  166. package/dist/tools/delete.js +30 -33
  167. package/dist/tools/delete.js.map +1 -1
  168. package/dist/tools/discover.d.ts +15 -27
  169. package/dist/tools/discover.d.ts.map +1 -1
  170. package/dist/tools/discover.js +103 -60
  171. package/dist/tools/discover.js.map +1 -1
  172. package/dist/tools/get-module.d.ts +85 -0
  173. package/dist/tools/get-module.d.ts.map +1 -0
  174. package/dist/tools/get-module.js +221 -0
  175. package/dist/tools/get-module.js.map +1 -0
  176. package/dist/tools/get.d.ts +2 -51
  177. package/dist/tools/get.d.ts.map +1 -1
  178. package/dist/tools/get.js +9 -49
  179. package/dist/tools/get.js.map +1 -1
  180. package/dist/tools/handler-result.d.ts +14 -0
  181. package/dist/tools/handler-result.d.ts.map +1 -0
  182. package/dist/tools/handler-result.js +177 -0
  183. package/dist/tools/handler-result.js.map +1 -0
  184. package/dist/tools/health.d.ts +12 -15
  185. package/dist/tools/health.d.ts.map +1 -1
  186. package/dist/tools/health.js +55 -36
  187. package/dist/tools/health.js.map +1 -1
  188. package/dist/tools/incident-journal-module.d.ts +12 -0
  189. package/dist/tools/incident-journal-module.d.ts.map +1 -0
  190. package/dist/tools/incident-journal-module.js +61 -0
  191. package/dist/tools/incident-journal-module.js.map +1 -0
  192. package/dist/tools/index.d.ts +47 -36
  193. package/dist/tools/index.d.ts.map +1 -1
  194. package/dist/tools/index.js +814 -35
  195. package/dist/tools/index.js.map +1 -1
  196. package/dist/tools/nl.d.ts +10 -24
  197. package/dist/tools/nl.d.ts.map +1 -1
  198. package/dist/tools/nl.js +37 -147
  199. package/dist/tools/nl.js.map +1 -1
  200. package/dist/tools/profile.d.ts +37 -0
  201. package/dist/tools/profile.d.ts.map +1 -0
  202. package/dist/tools/profile.js +39 -0
  203. package/dist/tools/profile.js.map +1 -0
  204. package/dist/tools/query-module.d.ts +119 -0
  205. package/dist/tools/query-module.d.ts.map +1 -0
  206. package/dist/tools/query-module.js +324 -0
  207. package/dist/tools/query-module.js.map +1 -0
  208. package/dist/tools/query.d.ts +2 -72
  209. package/dist/tools/query.d.ts.map +1 -1
  210. package/dist/tools/query.js +8 -72
  211. package/dist/tools/query.js.map +1 -1
  212. package/dist/tools/record-write-shared.d.ts +7 -0
  213. package/dist/tools/record-write-shared.d.ts.map +1 -0
  214. package/dist/tools/record-write-shared.js +65 -0
  215. package/dist/tools/record-write-shared.js.map +1 -0
  216. package/dist/tools/relationships.d.ts +21 -42
  217. package/dist/tools/relationships.d.ts.map +1 -1
  218. package/dist/tools/relationships.js +70 -56
  219. package/dist/tools/relationships.js.map +1 -1
  220. package/dist/tools/result-envelope.d.ts +603 -0
  221. package/dist/tools/result-envelope.d.ts.map +1 -0
  222. package/dist/tools/result-envelope.js +770 -0
  223. package/dist/tools/result-envelope.js.map +1 -0
  224. package/dist/tools/schema-module.d.ts +64 -0
  225. package/dist/tools/schema-module.d.ts.map +1 -0
  226. package/dist/tools/schema-module.js +367 -0
  227. package/dist/tools/schema-module.js.map +1 -0
  228. package/dist/tools/schema.d.ts +2 -37
  229. package/dist/tools/schema.d.ts.map +1 -1
  230. package/dist/tools/schema.js +6 -57
  231. package/dist/tools/schema.js.map +1 -1
  232. package/dist/tools/script.d.ts +33 -27
  233. package/dist/tools/script.d.ts.map +1 -1
  234. package/dist/tools/script.js +43 -37
  235. package/dist/tools/script.js.map +1 -1
  236. package/dist/tools/syslog.d.ts +19 -46
  237. package/dist/tools/syslog.d.ts.map +1 -1
  238. package/dist/tools/syslog.js +101 -67
  239. package/dist/tools/syslog.js.map +1 -1
  240. package/dist/tools/tool-module.d.ts +143 -0
  241. package/dist/tools/tool-module.d.ts.map +1 -0
  242. package/dist/tools/tool-module.js +1095 -0
  243. package/dist/tools/tool-module.js.map +1 -0
  244. package/dist/tools/update-module.d.ts +51 -0
  245. package/dist/tools/update-module.d.ts.map +1 -0
  246. package/dist/tools/update-module.js +111 -0
  247. package/dist/tools/update-module.js.map +1 -0
  248. package/dist/tools/update.d.ts +2 -45
  249. package/dist/tools/update.d.ts.map +1 -1
  250. package/dist/tools/update.js +9 -41
  251. package/dist/tools/update.js.map +1 -1
  252. package/dist/utils.d.ts +68 -1
  253. package/dist/utils.d.ts.map +1 -1
  254. package/dist/utils.js +114 -16
  255. package/dist/utils.js.map +1 -1
  256. package/dist/version.d.ts +10 -0
  257. package/dist/version.d.ts.map +1 -0
  258. package/dist/version.js +13 -0
  259. package/dist/version.js.map +1 -0
  260. package/dist/write-value-policy.d.ts +56 -0
  261. package/dist/write-value-policy.d.ts.map +1 -0
  262. package/dist/write-value-policy.js +310 -0
  263. package/dist/write-value-policy.js.map +1 -0
  264. package/docs/ADDING-TOOLS.md +227 -0
  265. package/docs/CLIENT-SETUP.md +914 -0
  266. package/docs/CONTAINER-DEPLOYMENT.md +310 -0
  267. package/docs/CROSS-CLIENT-RELEASE-MATRIX.md +63 -0
  268. package/docs/ENTERPRISE-RELEASE-BOUNDARY.md +149 -0
  269. package/docs/OPERATIONS-RUNBOOK.md +383 -0
  270. package/docs/PRIVATE-CHATGPT-CONNECTIVITY.md +347 -0
  271. package/docs/PRODUCTION-SECURITY.md +368 -0
  272. package/docs/PROFILE-CREDENTIALS.md +126 -0
  273. package/docs/RELEASE-VALIDATION.md +140 -0
  274. package/docs/TESTING-OAUTH.md +101 -0
  275. package/docs/V2-MIGRATION.md +493 -0
  276. package/package.json +60 -13
  277. package/scripts/inspector.mjs +140 -0
  278. package/scripts/release-validate.mjs +201 -0
  279. package/scripts/smoke-test.mjs +274 -0
  280. package/tools/inspector/package-lock.json +3812 -0
  281. package/tools/inspector/package.json +12 -0
@@ -0,0 +1,347 @@
1
+ # Private ChatGPT connectivity through Secure MCP Tunnel
2
+
3
+ > [!IMPORTANT]
4
+ > **This document describes the dormant HTTP transport, not the shipped one.**
5
+ > The product exposes stdio only: an MCP client spawns `servicenow-mcp` and
6
+ > speaks JSON-RPC over that process's stdin and stdout. There is no endpoint to
7
+ > configure, no service to start, and no bearer token to set, and
8
+ > `servicenow-mcp-setup` registers every client that way. The HTTP runtime this
9
+ > document assumes still compiles and is still tested, but nothing on the CLI
10
+ > path reaches it — see
11
+ > [the dormant HTTP transport](ENTERPRISE-RELEASE-BOUNDARY.md#the-dormant-http-transport).
12
+ > Sections about profiles, credentials, table access, field policy, and tool
13
+ > behavior are transport-independent and remain accurate.
14
+
15
+ This guide is the SNSDK-42 operator contract for connecting the private,
16
+ single-owner ServiceNow MCP HTTP service to ChatGPT through an optional Secure
17
+ MCP Tunnel adapter. The adapter runs outside the application and starts an
18
+ outbound-only connection. It does not make `/mcp`, either health endpoint, or
19
+ the tunnel-client administration UI publicly reachable.
20
+
21
+ This repository change supplies a repeatable procedure and automated document
22
+ contracts only. It is **not live-validation evidence**: no tunnel, Platform
23
+ credential, ChatGPT app, public endpoint, or ServiceNow write is created by the
24
+ build or tests. SNSDK-42 remains blocked on an authorized private live run until
25
+ the evidence checklist below is completed in the intended Platform
26
+ organization, ChatGPT workspace, private staging environment, and disposable
27
+ ServiceNow test scope.
28
+
29
+ The current primary references are:
30
+
31
+ - [OpenAI Secure MCP Tunnel](https://developers.openai.com/api/docs/guides/secure-mcp-tunnels)
32
+ - [OpenAI tunnel-client configuration](https://github.com/openai/tunnel-client/blob/master/docs/configuration.md)
33
+ - [ChatGPT developer mode and MCP apps](https://help.openai.com/en/articles/12584461-developer-mode-apps-and-full-mcp-connectors-in-chatgpt-beta)
34
+ - [Platform tunnel settings](https://platform.openai.com/settings/organization/tunnels)
35
+ - [latest tunnel-client release](https://github.com/openai/tunnel-client/releases/latest)
36
+
37
+ Review the current versions before every live validation. Product availability,
38
+ UI labels, and workspace policy can change; do not treat a prior screenshot as
39
+ authority for a new run.
40
+
41
+ ## Boundary and ownership
42
+
43
+ The components have separate responsibilities:
44
+
45
+ 1. `servicenow-mcp` owns MCP Streamable HTTP, its bearer boundary, explicit
46
+ ServiceNow profiles, table/field policy, structured results, and audit data.
47
+ 2. `tunnel-client` runs as a separately installed provider adapter in the same
48
+ trust boundary that can already reach the private `/mcp` origin. It polls the
49
+ OpenAI tunnel control plane over outbound HTTPS and forwards MCP traffic to
50
+ that one configured origin.
51
+ 3. The OpenAI Platform organization owns the tunnel identity, runtime key,
52
+ permissions, and organization/workspace associations.
53
+ 4. The ChatGPT workspace owns developer-mode access, the draft app, action
54
+ permissions, confirmations, and who may test it.
55
+ 5. The ServiceNow test owner supplies an explicit least-privilege profile and
56
+ authorizes the exact read and controlled write.
57
+
58
+ Removing the ChatGPT draft app, stopping and removing `tunnel-client`, and
59
+ revoking its runtime key must leave the core server and the provider-neutral
60
+ client suite unchanged. No file under `src/`, server startup path, tool handler,
61
+ profile schema, Docker image, or required package dependency may import or
62
+ start `tunnel-client` or depend on ChatGPT.
63
+
64
+ ## Preconditions and permissions
65
+
66
+ Do not begin a live run until one named operator verifies all of these items:
67
+
68
+ - The target is ChatGPT web in a plan/workspace where the required full MCP
69
+ read and write actions are available. A read-only product entitlement cannot
70
+ satisfy the controlled-write acceptance case.
71
+ - Creating or editing a tunnel is performed by a principal with Platform
72
+ Tunnels **Read + Manage**. Running `tunnel-client` and selecting the tunnel
73
+ while creating the app require Tunnels **Read + Use**.
74
+ - Tunnel roles are granted at the Platform organization level by an
75
+ organization owner or RBAC administrator, not assumed from project access.
76
+ - ChatGPT developer mode is granted separately. For Enterprise/Edu, an admin
77
+ grants the appropriate Connected Data/developer-mode permission through
78
+ workspace RBAC and the authorized tester enables developer mode under the
79
+ current **Settings → Apps → Advanced Settings** surface. For Business, only
80
+ an admin/owner may enable developer mode and create the app. Follow the
81
+ current plan-specific Help Center path if UI labels have moved.
82
+ - The tunnel is associated with the exact Platform organization and target
83
+ ChatGPT workspace. Association with a personal or Platform organization alone
84
+ does not make it visible in an unrelated Enterprise/Edu workspace.
85
+ - A separately authorized private staging deployment is healthy and uses a
86
+ disposable or sub-production ServiceNow instance. Production records and
87
+ personal administrator credentials are prohibited.
88
+ - A dedicated ServiceNow integration identity has only the roles required by
89
+ the approved read and controlled-write cases. The table target catalog,
90
+ read/write allowlists, field policies, and explicit profile are reviewed.
91
+ - Change owner, tester, evidence reviewer, rollback owner, time window, and
92
+ incident contact are recorded before the run.
93
+
94
+ If organization/workspace association cannot be verified automatically, stop
95
+ and use the reviewed OpenAI account-team process described in the official
96
+ guide. Do not work around missing association or permissions with a public
97
+ tunnel, a personal workspace, a shared key, or a different organization.
98
+
99
+ ## Network requirements
100
+
101
+ Secure MCP Tunnel is outbound-only; it requires no new inbound internet rule.
102
+ Apply default-deny network policy and allow only:
103
+
104
+ | Source | Destination | Purpose |
105
+ | --- | --- | --- |
106
+ | `tunnel-client` host | `api.openai.com:443`, path `/v1/tunnel/*` | Default control-plane polling and response posting. |
107
+ | `tunnel-client` host | `mtls.api.openai.com:443`, path `/v1/tunnel/*` | Control-plane traffic only when the reviewed mTLS mode is configured. |
108
+ | `tunnel-client` process | The single configured private MCP origin, preferably `http://127.0.0.1:3000/mcp` in one host boundary | Forwarding MCP requests. |
109
+ | ServiceNow MCP process | The exact approved ServiceNow instance and required secret/log providers | Existing application dependencies, unchanged by the tunnel. |
110
+
111
+ Deny direct internet ingress to the MCP listener, `/health/live`,
112
+ `/health/ready`, tunnel-client `/healthz`, `/readyz`, `/metrics`, and `/ui`.
113
+ The tunnel-client health/admin listener remains on loopback. Do not use
114
+ `--allow-remote-ui`, `ALLOW_REMOTE_UI=true`, a public port-forward, or a
115
+ catch-all egress rule for this validation.
116
+
117
+ ## Prepare the private MCP server
118
+
119
+ Build and validate the same immutable artifact intended for staging:
120
+
121
+ ```sh
122
+ npm ci
123
+ npm run build
124
+ npm run container:build
125
+ npm run container:validate
126
+ ```
127
+
128
+ Inject all runtime values through the approved secret/config mechanism. For a
129
+ same-host adapter, bind the application to loopback and set `MCP_BEARER_TOKEN`.
130
+ HTTP authentication is opt-in as of 2.0, so the bearer boundary this adapter
131
+ depends on exists only because that variable is set; a deployment that omits it
132
+ serves the tunnel client and every other local process alike:
133
+
134
+ ```text
135
+ MCP_HOST=127.0.0.1
136
+ MCP_PORT=3000
137
+ MCP_ALLOWED_HOSTS=127.0.0.1:3000
138
+ MCP_BEARER_TOKEN=<runtime-secret-reference>
139
+ MCP_OWNER_ID=<approved-owner-id>
140
+ MCP_CLIENT_ID=<approved-private-client-id>
141
+ SN_PROFILE_NAME=<approved-test-profile>
142
+ SN_INSTANCE=<approved-sub-production-origin>
143
+ ```
144
+
145
+ Supply the authentication-specific `SN_*` values, table target catalog, and
146
+ read/write allowlists described by the deployment and security guides. Confirm
147
+ locally that `/health/live` and `/health/ready` are healthy and that an
148
+ authenticated provider-neutral client can initialize, list the release tool
149
+ manifest, reject a missing profile, and perform the approved read. Do not start
150
+ the tunnel while the local baseline is failing.
151
+
152
+ ## Install and verify tunnel-client
153
+
154
+ Download the binary from Platform tunnel settings or the latest official
155
+ `openai/tunnel-client` release. Record its version and release digest in the
156
+ private evidence record, then use the installed binary as the first source for
157
+ its exact supported options:
158
+
159
+ ```sh
160
+ tunnel-client --version
161
+ tunnel-client help quickstart
162
+ tunnel-client profiles samples list
163
+ tunnel-client profiles samples show sample_mcp_remote_no_auth
164
+ tunnel-client run --help
165
+ ```
166
+
167
+ The installed version must support an HTTP `main` channel, `mcp.extra_headers`
168
+ (or `--mcp.extra-headers` / `MCP_EXTRA_HEADERS`), `env:` or `file:` secret
169
+ references, `doctor --explain`, and the loopback health/admin surfaces. If any
170
+ required option is absent, stop. Do not guess a flag, downgrade the server to
171
+ unauthenticated mode, or place a secret literal in argv, a URL, or YAML.
172
+
173
+ ## Create the secret-backed adapter profile
174
+
175
+ Tunnel creation and retrieval are authorized external operations. An operator
176
+ with Tunnels Read + Manage creates or reuses the private tunnel in Platform
177
+ tunnel settings. A runtime principal with Tunnels Read + Use receives a
178
+ short-lived or separately managed `CONTROL_PLANE_API_KEY`; do not use a broad
179
+ admin key for the long-lived daemon.
180
+
181
+ Create a named profile without putting either secret on the command line:
182
+
183
+ ```sh
184
+ tunnel-client init \
185
+ --sample sample_mcp_remote_no_auth \
186
+ --profile servicenow-mcp-private \
187
+ --tunnel-id tunnel_0123456789abcdef0123456789abcdef \
188
+ --mcp-server-url http://127.0.0.1:3000/mcp
189
+
190
+ tunnel-client profiles edit servicenow-mcp-private
191
+ ```
192
+
193
+ The tunnel ID above is a format-only placeholder. The protected profile must
194
+ use secret references and keep both admin surfaces on loopback:
195
+
196
+ ```yaml
197
+ config_version: 1
198
+ control_plane:
199
+ tunnel_id: tunnel_0123456789abcdef0123456789abcdef
200
+ api_key: env:CONTROL_PLANE_API_KEY
201
+ mcp:
202
+ server_urls:
203
+ - channel: main
204
+ url: http://127.0.0.1:3000/mcp
205
+ extra_headers:
206
+ Authorization: env:MCP_BEARER_TOKEN
207
+ health:
208
+ listen_addr: 127.0.0.1:8080
209
+ admin_ui:
210
+ open_browser: false
211
+ log:
212
+ level: info
213
+ format: json
214
+ ```
215
+
216
+ `mcp.extra_headers` sends the static header only to the configured MCP origin;
217
+ it is not sent to the OpenAI control plane or unrelated authorization hosts.
218
+ Do not repeat the bearer in `mcp.discovery_extra_headers`: ordinary
219
+ `extra_headers` also supplies discovery/probe requests unless an explicit
220
+ discovery override is configured.
221
+
222
+ Connector-forwarded headers are applied last and override static headers
223
+ case-insensitively. Configure the ChatGPT draft app with no conflicting
224
+ `Authorization` mechanism for this static-bearer deployment, then prove during
225
+ validation that the MCP server receives the intended owner credential. If
226
+ workspace policy requires a different app authentication mode, stop and review
227
+ that design; never silently allow a connector header to replace the owner
228
+ bearer.
229
+
230
+ Store the named profile owner-only. Inject `CONTROL_PLANE_API_KEY` and
231
+ `MCP_BEARER_TOKEN` from the supervisor or secret manager at runtime. Never type
232
+ their values into shell history, commit them, place them in YAML, include them
233
+ in screenshots, or enable `--log.http-raw-unsafe`.
234
+
235
+ ## Doctor and run
236
+
237
+ With the private MCP server already healthy and both secret variables supplied
238
+ by the runtime secret mechanism, validate before starting the polling loop:
239
+
240
+ ```sh
241
+ tunnel-client doctor --profile servicenow-mcp-private --explain
242
+ tunnel-client run --profile servicenow-mcp-private
243
+ ```
244
+
245
+ `doctor` must identify the intended tunnel/profile and the healthy `main`
246
+ channel without printing credentials. Treat any authorization failure,
247
+ unexpected origin, workspace mismatch, TLS-verification failure, or missing
248
+ header option as a hard stop.
249
+
250
+ Keep `run` supervised and healthy throughout validation. Confirm `/healthz`,
251
+ `/readyz`, `/metrics`, and `/ui` only through the loopback listener. Raw HTTP
252
+ logging remains disabled. A redacted tunnel support export is still reviewed as
253
+ sensitive before it leaves the owner boundary.
254
+
255
+ ## Create the ChatGPT developer-mode app
256
+
257
+ Perform these steps in the associated ChatGPT workspace on ChatGPT web:
258
+
259
+ 1. Confirm the tester has the plan-specific developer-mode permission and has
260
+ enabled it for their account.
261
+ 2. Open **Apps → Create** from the current workspace or user-settings surface.
262
+ 3. Choose **Tunnel** under **Connection**, select the associated tunnel (or
263
+ paste its reviewed tunnel ID), and do not enter a public MCP URL.
264
+ 4. Configure no connector authentication that would override the
265
+ secret-backed static `Authorization` header described above.
266
+ 5. Select **Scan Tools**. Compare discovery with the frozen release tool
267
+ manifest: names, input/output schemas, and annotations, not a historical
268
+ hard-coded tool count.
269
+ 6. Keep the app as a private draft labeled for development. Do not publish it
270
+ to the workspace or submit it publicly during this story.
271
+ 7. Open a new chat, select only this draft app, and run the approved validation
272
+ cases below. Review each write confirmation before approval.
273
+
274
+ If the tunnel is not visible, verify its target ChatGPT workspace association,
275
+ the tester's Tunnels Read + Use role, developer-mode access, and propagation
276
+ time. If discovery or calls fail, keep `tunnel-client run` active and rerun
277
+ `doctor --explain`; do not replace the connection with an ad hoc public tunnel.
278
+
279
+ ## Live validation and redacted evidence
280
+
281
+ Use a single change record and record **PASS**, **FAIL**, or **BLOCKED** for
282
+ every case. A checkbox or this document is not evidence. Evidence must come
283
+ from the authorized live run and be reviewed by a second authorized person.
284
+
285
+ | Case | Required live observation | Redacted evidence |
286
+ | --- | --- | --- |
287
+ | Private path | `tunnel-client` is ready/polling; no inbound/public listener or remote admin UI exists. | Version/digest, timestamp, network-policy result, and sanitized readiness state. Omit tunnel ID, URLs, org/workspace names, keys, headers, and payloads. |
288
+ | Initialization and discovery | ChatGPT scans the release tool manifest through the tunnel. | Manifest hash or approved name/schema/annotation comparison and correlation ID; no screenshots containing identifiers or prompts. |
289
+ | Required-profile rejection | Invoke a harmless read-only tool without `profile`; it fails before profile credentials, client construction, or ServiceNow access. | Sanitized error category/correlation ID and audit outcome only. |
290
+ | Representative read | Invoke `sn_query` with the explicit test profile, approved table, narrow fields, structured filter, limit, and byte budget. | Tool, approved profile alias, record count, pagination outcome, and correlation ID. No query values, instance URL, record fields, or response body. |
291
+ | Controlled write | After separate human authorization and ChatGPT confirmation, invoke an approved dedicated write tool—prefer `sn_incident_add_comment` or `sn_incident_add_work_note` when present in the frozen manifest—against one designated disposable incident. | Change approval ID, tool name, approved profile alias, sanitized success category, target-record evidence alias, and correlation ID. Never capture journal text, sys_id, record body, or credential. |
292
+ | Result and audit binding | Successful read/write structured results identify the same explicit profile; the matching application audit events identify that profile and expected outcome. | Approved profile alias plus correlation IDs. Verify the instance privately by an approved alias/hash; omit the origin itself. |
293
+ | Provider-neutral second client | The official MCP SDK and independent JSON-RPC Fetch client pass against the same frozen server artifact without ChatGPT or tunnel code in the core. | `npm run container:validate` version/digest and pass summary, or equivalent frozen CI artifact. No environment or container inspection dump. |
294
+ | Teardown and decoupling | Draft app/tunnel adapter is removed and the provider-neutral clients still pass locally. | Sanitized teardown checklist and post-removal validation summary. |
295
+
296
+ For the controlled write, pre-record the exact tool, profile, instance alias,
297
+ table/record alias, permitted fields, expected effect, cleanup decision, and
298
+ approver. Stop if the release manifest lacks a suitable dedicated tool, if
299
+ ChatGPT does not present the expected confirmation, or if the record is not
300
+ disposable. Do not substitute generic journal updates, production data, batch
301
+ execution, ATF, scripts, or an unplanned write.
302
+
303
+ Never collect or attach:
304
+
305
+ - `CONTROL_PLANE_API_KEY`, `MCP_BEARER_TOKEN`, ServiceNow credentials, profile
306
+ encryption keys, OAuth/API-key material, secret references, or ciphertext;
307
+ - `Authorization`, cookie, API-key, connector, tunnel shard, or proxy headers;
308
+ - raw environment/config/profile files, argv/process dumps, complete tunnel
309
+ support exports, or container inspection output;
310
+ - tunnel IDs, organization/workspace IDs or names, private/public URLs, full
311
+ instance origins, usernames, or raw owner/client hashes;
312
+ - prompts, query values, journal text, sys_ids, record/attachment bodies, tool
313
+ response bodies, exception text, or raw HTTP logs.
314
+
315
+ Use approved aliases, hashes produced for this evidence purpose, counts,
316
+ categories, versions, timestamps, image digests, and correlation IDs. Store the
317
+ bundle with the access and retention controls in the operations runbook, have a
318
+ second authorized reviewer inspect it, then delete it on schedule.
319
+
320
+ ## Teardown and rollback
321
+
322
+ At the end of the window, or immediately on unexpected access or behavior:
323
+
324
+ 1. Stop new ChatGPT tests and disable or delete the private draft app. Do not
325
+ publish it.
326
+ 2. Stop `tunnel-client` and verify its `/readyz` no longer reports ready.
327
+ 3. Revoke the dedicated control-plane runtime API key and remove its secret
328
+ reference from the supervisor.
329
+ 4. An authorized Tunnels Read + Manage operator removes the temporary
330
+ organization/workspace association or deletes the temporary tunnel when the
331
+ change record calls for it.
332
+ 5. Remove the tunnel-client profile and any temporary local secret mount using
333
+ the owner-approved recoverable process. Retain no copied secret or raw log.
334
+ 6. Perform the pre-approved cleanup for the disposable ServiceNow test record;
335
+ do not improvise a delete.
336
+ 7. Verify no inbound/public listener, port-forward, remote `/ui`, public DNS,
337
+ proxy route, or firewall exception was created.
338
+ 8. Re-run the provider-neutral local client/container validation. The core MCP
339
+ service must initialize, discover, reject missing profiles, and perform its
340
+ safe read exactly as it did before the adapter existed.
341
+ 9. Record the sanitized result and close or escalate the change. Rotate the MCP
342
+ bearer or ServiceNow credential if exposure is suspected.
343
+
344
+ The tunnel is not a public-submission mechanism. This story must never create
345
+ or claim a public endpoint, publish the draft app, bake tunnel-client into the
346
+ server image, add provider behavior to tool handlers, weaken bearer/profile
347
+ policy, or claim live success from local tests alone.