servicenow-mcp-server 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 (52) hide show
  1. package/.claude/settings.local.json +70 -0
  2. package/CLAUDE.md +777 -0
  3. package/LICENSE +21 -0
  4. package/README.md +562 -0
  5. package/assets/logo.svg +385 -0
  6. package/config/servicenow-instances.json.example +28 -0
  7. package/docs/403_TROUBLESHOOTING.md +329 -0
  8. package/docs/API_REFERENCE.md +1142 -0
  9. package/docs/APPLICATION_SCOPE_VALIDATION.md +681 -0
  10. package/docs/CLAUDE_DESKTOP_SETUP.md +373 -0
  11. package/docs/CONVENIENCE_TOOLS.md +601 -0
  12. package/docs/CONVENIENCE_TOOLS_SUMMARY.md +371 -0
  13. package/docs/FLOW_DESIGNER_GUIDE.md +1021 -0
  14. package/docs/IMPLEMENTATION_COMPLETE.md +165 -0
  15. package/docs/INSTANCE_SWITCHING_GUIDE.md +219 -0
  16. package/docs/MULTI_INSTANCE_CONFIGURATION.md +185 -0
  17. package/docs/NATURAL_LANGUAGE_SEARCH_IMPLEMENTATION.md +221 -0
  18. package/docs/PUPPETEER_INTEGRATION_PROPOSAL.md +1322 -0
  19. package/docs/QUICK_REFERENCE.md +395 -0
  20. package/docs/README.md +75 -0
  21. package/docs/RESOURCES_ARCHITECTURE.md +392 -0
  22. package/docs/RESOURCES_IMPLEMENTATION.md +276 -0
  23. package/docs/RESOURCES_SUMMARY.md +104 -0
  24. package/docs/SETUP_GUIDE.md +104 -0
  25. package/docs/UI_OPERATIONS_ARCHITECTURE.md +1219 -0
  26. package/docs/UI_OPERATIONS_DECISION_MATRIX.md +542 -0
  27. package/docs/UI_OPERATIONS_SUMMARY.md +507 -0
  28. package/docs/UPDATE_SET_VALIDATION.md +598 -0
  29. package/docs/UPDATE_SET_VALIDATION_SUMMARY.md +209 -0
  30. package/docs/VALIDATION_SUMMARY.md +479 -0
  31. package/jest.config.js +24 -0
  32. package/package.json +61 -0
  33. package/scripts/background_script_2025-09-29T20-19-35-101Z.js +23 -0
  34. package/scripts/link_ui_policy_actions_2025-09-29T20-17-15-218Z.js +90 -0
  35. package/scripts/set_update_set_Integration_Governance_Framework_2025-09-29T19-47-06-790Z.js +30 -0
  36. package/scripts/set_update_set_Integration_Governance_Framework_2025-09-29T19-59-33-152Z.js +30 -0
  37. package/scripts/set_update_set_current_2025-09-29T20-16-59-675Z.js +24 -0
  38. package/scripts/test_sys_dictionary_403.js +85 -0
  39. package/setup/setup-report.json +5313 -0
  40. package/src/config/comprehensive-table-definitions.json +2575 -0
  41. package/src/config/instance-config.json +4693 -0
  42. package/src/config/prompts.md +59 -0
  43. package/src/config/table-definitions.json +4681 -0
  44. package/src/config-manager.js +146 -0
  45. package/src/mcp-server-consolidated.js +2894 -0
  46. package/src/natural-language.js +472 -0
  47. package/src/resources.js +326 -0
  48. package/src/script-sync.js +428 -0
  49. package/src/server.js +125 -0
  50. package/src/servicenow-client.js +1625 -0
  51. package/src/stdio-server.js +52 -0
  52. package/start-mcp.sh +7 -0
@@ -0,0 +1,373 @@
1
+ # Claude Desktop Setup Guide
2
+
3
+ **Complete guide for integrating ServiceNow MCP Server with Claude Desktop**
4
+
5
+ ---
6
+
7
+ ## ✅ Current Working Configuration
8
+
9
+ Your Claude Desktop is configured with **Option A: Multi-Instance with Runtime Switching** ⭐
10
+
11
+ **Config File:** `~/Library/Application Support/Claude/claude_desktop_config.json`
12
+
13
+ ```json
14
+ {
15
+ "mcpServers": {
16
+ "servicenow-nodejs": {
17
+ "command": "node",
18
+ "args": ["/Users/nczitzer/WebstormProjects/mcp-servicenow-nodejs/src/stdio-server.js"],
19
+ "cwd": "/Users/nczitzer/WebstormProjects/mcp-servicenow-nodejs"
20
+ }
21
+ }
22
+ }
23
+ ```
24
+
25
+ **Instance Configuration:** `config/servicenow-instances.json`
26
+
27
+ The server automatically loads your instances from the config file. You can switch between instances during your conversation without restarting!
28
+
29
+ ---
30
+
31
+ ## 🔧 Setup Steps (If Not Already Configured)
32
+
33
+ ### 1. Open Claude Desktop Config
34
+
35
+ ```bash
36
+ # Open in your default editor
37
+ open ~/Library/Application\ Support/Claude/claude_desktop_config.json
38
+
39
+ # Or use nano
40
+ nano ~/Library/Application\ Support/Claude/claude_desktop_config.json
41
+ ```
42
+
43
+ ### 2. Choose Configuration Method
44
+
45
+ **You have TWO options - choose ONE:**
46
+
47
+ #### Option A: Multi-Instance with Runtime Switching (Recommended) ⭐
48
+
49
+ **Step 1:** Create `config/servicenow-instances.json`:
50
+ ```bash
51
+ cd /Users/YOUR_USERNAME/WebstormProjects/mcp-servicenow-nodejs
52
+ nano config/servicenow-instances.json
53
+ ```
54
+
55
+ ```json
56
+ {
57
+ "instances": [
58
+ {
59
+ "name": "dev",
60
+ "url": "https://dev123456.service-now.com",
61
+ "username": "admin",
62
+ "password": "password",
63
+ "default": true
64
+ }
65
+ ]
66
+ }
67
+ ```
68
+
69
+ **Step 2:** Add to Claude Desktop config (NO env section):
70
+ ```json
71
+ {
72
+ "mcpServers": {
73
+ "servicenow-nodejs": {
74
+ "command": "node",
75
+ "args": ["/Users/YOUR_USERNAME/WebstormProjects/mcp-servicenow-nodejs/src/stdio-server.js"],
76
+ "cwd": "/Users/YOUR_USERNAME/WebstormProjects/mcp-servicenow-nodejs"
77
+ }
78
+ }
79
+ }
80
+ ```
81
+
82
+ **Benefits:** ✅ One config file, ✅ Runtime switching, ✅ Easy to add instances
83
+
84
+ ---
85
+
86
+ #### Option B: Single Instance (Simple)
87
+
88
+ Add to Claude Desktop config (WITH env section):
89
+ ```json
90
+ {
91
+ "mcpServers": {
92
+ "servicenow-nodejs": {
93
+ "command": "node",
94
+ "args": ["/Users/YOUR_USERNAME/WebstormProjects/mcp-servicenow-nodejs/src/stdio-server.js"],
95
+ "cwd": "/Users/YOUR_USERNAME/WebstormProjects/mcp-servicenow-nodejs",
96
+ "env": {
97
+ "SERVICENOW_INSTANCE_URL": "https://your-instance.service-now.com",
98
+ "SERVICENOW_USERNAME": "your-username",
99
+ "SERVICENOW_PASSWORD": "your-password"
100
+ }
101
+ }
102
+ }
103
+ }
104
+ ```
105
+
106
+ **Benefits:** ✅ Simple, ✅ Everything in one file
107
+
108
+ **Limitations:** ❌ No instance switching, ❌ Restart required to change instances
109
+
110
+ ---
111
+
112
+ **Important:** Replace `YOUR_USERNAME` with your actual username
113
+
114
+ ### 3. Restart Claude Desktop
115
+
116
+ **Complete restart required:**
117
+ 1. Quit Claude Desktop (⌘Q)
118
+ 2. Wait 2-3 seconds
119
+ 3. Reopen Claude Desktop
120
+
121
+ ---
122
+
123
+ ## 🌐 Multi-Instance Setup with Runtime Switching (Recommended!)
124
+
125
+ **Feature:** Switch between instances **during your conversation** without restarting!
126
+
127
+ To enable this, use the JSON config file instead of ENV variables:
128
+
129
+ ### 1. Create Config File
130
+
131
+ ```bash
132
+ # Copy example config
133
+ cp config/servicenow-instances.example.json config/servicenow-instances.json
134
+
135
+ # Edit with your instances
136
+ nano config/servicenow-instances.json
137
+ ```
138
+
139
+ ### 2. Configure Instances
140
+
141
+ ```json
142
+ {
143
+ "instances": [
144
+ {
145
+ "name": "dev",
146
+ "url": "https://dev123456.service-now.com",
147
+ "username": "admin",
148
+ "password": "password",
149
+ "default": true
150
+ },
151
+ {
152
+ "name": "prod",
153
+ "url": "https://prod789012.service-now.com",
154
+ "username": "integration_user",
155
+ "password": "password"
156
+ }
157
+ ]
158
+ }
159
+ ```
160
+
161
+ ### 3. Remove ENV Variables from Claude Config
162
+
163
+ When using multi-instance config, remove the `env` section:
164
+
165
+ ```json
166
+ {
167
+ "mcpServers": {
168
+ "servicenow-nodejs": {
169
+ "command": "node",
170
+ "args": ["/Users/YOUR_USERNAME/WebstormProjects/mcp-servicenow-nodejs/src/stdio-server.js"],
171
+ "cwd": "/Users/YOUR_USERNAME/WebstormProjects/mcp-servicenow-nodejs"
172
+ }
173
+ }
174
+ }
175
+ ```
176
+
177
+ The server will automatically load from `config/servicenow-instances.json`.
178
+
179
+ ### 4. Use Instance Switching in Claude Desktop
180
+
181
+ **During your conversation**, you can now switch instances:
182
+
183
+ ```
184
+ You: "Switch to prod instance"
185
+ Claude: Uses SN-Set-Instance({ instance_name: "prod" })
186
+ ✅ Switched successfully!
187
+
188
+ You: "List incidents"
189
+ Claude: Uses SN-List-Incidents()
190
+ → Queries PROD instance
191
+
192
+ You: "Switch back to dev"
193
+ Claude: Uses SN-Set-Instance({ instance_name: "dev" })
194
+ ✅ Switched to dev
195
+
196
+ You: "Create a test incident"
197
+ Claude: Uses SN-Create-Incident()
198
+ → Creates in DEV instance
199
+ ```
200
+
201
+ **Benefits:**
202
+ - ✅ No restart required
203
+ - ✅ Switch anytime during conversation
204
+ - ✅ All tools automatically use current instance
205
+ - ✅ Can compare data across instances
206
+ - ✅ Safe multi-environment workflows
207
+
208
+ ---
209
+
210
+ ## ✅ Verification
211
+
212
+ ### 1. Check Tools Are Loaded
213
+
214
+ After restarting Claude Desktop, you should see:
215
+ - "ServiceNow" as an available context
216
+ - 34 MCP tools available
217
+ - Tools like `SN-Query-Table`, `SN-Create-Record`, etc.
218
+
219
+ ### 2. Test a Tool
220
+
221
+ Try this in Claude Desktop:
222
+
223
+ ```
224
+ List 5 incidents from ServiceNow
225
+ ```
226
+
227
+ Claude should use `SN-List-Incidents` automatically.
228
+
229
+ ### 3. Test Instance Switching (Multi-Instance Only)
230
+
231
+ If you have multiple instances configured:
232
+
233
+ ```
234
+ Show me available ServiceNow instances
235
+ ```
236
+
237
+ Claude uses: `SN-Set-Instance()` (no params = list instances)
238
+
239
+ ```
240
+ Switch to prod instance
241
+ ```
242
+
243
+ Claude uses: `SN-Set-Instance({ instance_name: "prod" })`
244
+
245
+ ```
246
+ What instance am I on?
247
+ ```
248
+
249
+ Claude uses: `SN-Get-Current-Instance()`
250
+
251
+ **All subsequent operations will use the switched instance!**
252
+
253
+ ### 3. Check Server Logs
254
+
255
+ If issues occur, check the server logs:
256
+
257
+ ```bash
258
+ # The stdio server logs to stderr, which Claude Desktop captures
259
+ # Check Claude Desktop's developer console:
260
+ # Help → Developer → Open Developer Console
261
+ ```
262
+
263
+ ---
264
+
265
+ ## 🔍 Troubleshooting
266
+
267
+ ### Claude Desktop Doesn't Show ServiceNow Tools
268
+
269
+ **Cause:** Config file has errors or Claude hasn't restarted properly
270
+
271
+ **Fix:**
272
+ 1. Validate JSON syntax: `cat ~/Library/Application\ Support/Claude/claude_desktop_config.json | jq`
273
+ 2. Kill all Claude processes: `pkill -9 Claude`
274
+ 3. Restart Claude Desktop
275
+ 4. Wait 5-10 seconds for tools to load
276
+
277
+ ---
278
+
279
+ ### "Command not found" Error
280
+
281
+ **Cause:** Node.js not in PATH or wrong path to stdio-server.js
282
+
283
+ **Fix:**
284
+ 1. Verify Node.js is installed: `which node`
285
+ 2. Verify path exists: `ls /Users/nczitzer/WebstormProjects/mcp-servicenow-nodejs/src/stdio-server.js`
286
+ 3. Use full path to node: `/usr/local/bin/node` (or wherever `which node` shows)
287
+
288
+ ```json
289
+ {
290
+ "command": "/usr/local/bin/node",
291
+ "args": ["/full/path/to/src/stdio-server.js"]
292
+ }
293
+ ```
294
+
295
+ ---
296
+
297
+ ### Authentication Errors
298
+
299
+ **Cause:** Wrong credentials or instance URL
300
+
301
+ **Fix:**
302
+ 1. Test credentials manually:
303
+ ```bash
304
+ curl -u username:password https://your-instance.service-now.com/api/now/table/incident?sysparm_limit=1
305
+ ```
306
+ 2. If works, update Claude Desktop config with same credentials
307
+ 3. Make sure password special characters are not breaking JSON (escape if needed)
308
+
309
+ ---
310
+
311
+ ### Tools Work But Return Errors
312
+
313
+ **Cause:** ServiceNow permissions or instance issues
314
+
315
+ **Fix:**
316
+ 1. Check user has required roles (admin, rest_api_explorer)
317
+ 2. Verify instance is accessible
318
+ 3. Check ServiceNow system logs for API errors
319
+
320
+ ---
321
+
322
+ ## 📋 Comparison: Claude Desktop vs Claude Code
323
+
324
+ | Feature | Claude Desktop | Claude Code |
325
+ |---------|---------------|-------------|
326
+ | **Transport** | STDIO | HTTP (SSE) |
327
+ | **Configuration** | JSON config file | Not needed (uses HTTP) |
328
+ | **Server Start** | Auto-starts on demand | Manual (`npm run dev`) |
329
+ | **Port** | None (stdio) | 3000 (HTTP) |
330
+ | **Credentials** | In config file | In `.env` or `config/servicenow-instances.json` |
331
+ | **Multi-Instance** | Via config file | Via HTTP endpoint |
332
+
333
+ Both can run **simultaneously** without conflict!
334
+
335
+ ---
336
+
337
+ ## 🚀 Quick Reference
338
+
339
+ ### Config File Location
340
+ ```bash
341
+ ~/Library/Application Support/Claude/claude_desktop_config.json
342
+ ```
343
+
344
+ ### Edit Config
345
+ ```bash
346
+ nano ~/Library/Application\ Support/Claude/claude_desktop_config.json
347
+ ```
348
+
349
+ ### Restart Claude
350
+ ```bash
351
+ pkill -9 Claude && open -a Claude
352
+ ```
353
+
354
+ ### Validate JSON
355
+ ```bash
356
+ cat ~/Library/Application\ Support/Claude/claude_desktop_config.json | jq
357
+ ```
358
+
359
+ ### Test Server Manually
360
+ ```bash
361
+ cd /Users/nczitzer/WebstormProjects/mcp-servicenow-nodejs
362
+ node src/stdio-server.js
363
+ # Should wait for MCP JSON-RPC messages on stdin
364
+ ```
365
+
366
+ ---
367
+
368
+ ## 📚 Additional Resources
369
+
370
+ - **Main README:** `../README.md`
371
+ - **API Reference:** `API_REFERENCE.md`
372
+ - **Multi-Instance Config:** `MULTI_INSTANCE_CONFIGURATION.md`
373
+ - **Troubleshooting:** `403_TROUBLESHOOTING.md`