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,395 @@
1
+ # ServiceNow MCP Tools - Quick Reference Card
2
+
3
+ ## 🚀 New Convenience Tools (10)
4
+
5
+ ### Incident Tools
6
+ ```javascript
7
+ // Add comment (customer-visible)
8
+ SN-Add-Comment({ incident_number: "INC0012345", comment: "..." })
9
+
10
+ // Add work notes (internal)
11
+ SN-Add-Work-Notes({ incident_number: "INC0012345", work_notes: "..." })
12
+
13
+ // Assign to user/group (auto-resolves names)
14
+ SN-Assign-Incident({ incident_number: "INC0012345", assigned_to: "John Smith", assignment_group: "IT Support" })
15
+
16
+ // Resolve (state → 6)
17
+ SN-Resolve-Incident({ incident_number: "INC0012345", resolution_notes: "...", resolution_code: "Solved (Permanently)" })
18
+
19
+ // Close (state → 7)
20
+ SN-Close-Incident({ incident_number: "INC0012345", close_notes: "...", close_code: "Solved (Permanently)" })
21
+ ```
22
+
23
+ ### Change Request Tools
24
+ ```javascript
25
+ // Add comment
26
+ SN-Add-Change-Comment({ change_number: "CHG0012345", comment: "..." })
27
+
28
+ // Assign to user/group
29
+ SN-Assign-Change({ change_number: "CHG0012345", assigned_to: "Jane Doe", assignment_group: "Change Advisory Board" })
30
+
31
+ // Approve
32
+ SN-Approve-Change({ change_number: "CHG0012345", approval_comments: "..." })
33
+ ```
34
+
35
+ ### Problem Tools
36
+ ```javascript
37
+ // Add comment
38
+ SN-Add-Problem-Comment({ problem_number: "PRB0012345", comment: "..." })
39
+
40
+ // Close (state → 3)
41
+ SN-Close-Problem({ problem_number: "PRB0012345", resolution_notes: "...", resolution_code: "..." })
42
+ ```
43
+
44
+ ---
45
+
46
+ ## 📋 Core CRUD Tools (6)
47
+
48
+ ```javascript
49
+ // Query any table
50
+ SN-Query-Table({ table_name: "incident", query: "state=1^priority=1", limit: 25 })
51
+
52
+ // Create record
53
+ SN-Create-Record({ table_name: "incident", data: { short_description: "..." } })
54
+
55
+ // Get single record
56
+ SN-Get-Record({ table_name: "incident", sys_id: "...", fields: "number,state,priority" })
57
+
58
+ // Update record
59
+ SN-Update-Record({ table_name: "incident", sys_id: "...", data: { state: 6 } })
60
+
61
+ // Get table schema
62
+ SN-Get-Table-Schema({ table_name: "incident" })
63
+
64
+ // List available tables
65
+ SN-List-Available-Tables({ category: "core_itsm" })
66
+ ```
67
+
68
+ ---
69
+
70
+ ## 🔄 Update Set Management (6)
71
+
72
+ ```javascript
73
+ // Set current update set (AUTOMATED!)
74
+ SN-Set-Update-Set({ update_set_sys_id: "..." })
75
+
76
+ // Get current update set
77
+ SN-Get-Current-Update-Set()
78
+
79
+ // List update sets
80
+ SN-List-Update-Sets({ query: "state=in progress", limit: 25 })
81
+
82
+ // Move records to update set
83
+ SN-Move-Records-To-Update-Set({ update_set_id: "...", source_update_set: "Default" })
84
+
85
+ // Clone update set
86
+ SN-Clone-Update-Set({ source_update_set_id: "...", new_name: "..." })
87
+
88
+ // Inspect update set contents
89
+ SN-Inspect-Update-Set({ update_set: "...", show_components: true })
90
+ ```
91
+
92
+ ---
93
+
94
+ ## 🔧 Workflow Tools (4)
95
+
96
+ ```javascript
97
+ // Create complete workflow
98
+ SN-Create-Workflow({
99
+ name: "My Workflow",
100
+ table: "incident",
101
+ activities: [...],
102
+ transitions: [...],
103
+ publish: true
104
+ })
105
+
106
+ // Create activity
107
+ SN-Create-Activity({ workflow_version_sys_id: "...", name: "...", script: "..." })
108
+
109
+ // Create transition
110
+ SN-Create-Transition({ from_activity_sys_id: "...", to_activity_sys_id: "..." })
111
+
112
+ // Publish workflow
113
+ SN-Publish-Workflow({ version_sys_id: "...", start_activity_sys_id: "..." })
114
+ ```
115
+
116
+ ---
117
+
118
+ ## 📦 Batch Operations (2)
119
+
120
+ ```javascript
121
+ // Batch create with references
122
+ SN-Batch-Create({
123
+ operations: [
124
+ { table: "sc_cat_item", data: {...}, save_as: "item" },
125
+ { table: "item_option_new", data: { cat_item: "${item}" } }
126
+ ],
127
+ transaction: true
128
+ })
129
+
130
+ // Batch update
131
+ SN-Batch-Update({
132
+ updates: [
133
+ { table: "incident", sys_id: "...", data: { state: 6 } },
134
+ { table: "incident", sys_id: "...", data: { state: 6 } }
135
+ ],
136
+ stop_on_error: false
137
+ })
138
+ ```
139
+
140
+ ---
141
+
142
+ ## 🎯 Specialized Tools (16)
143
+
144
+ ### ITSM Convenience
145
+ ```javascript
146
+ SN-List-Incidents({ state: "1", priority: 1, limit: 25 })
147
+ SN-Create-Incident({ short_description: "..." })
148
+ SN-Get-Incident({ sys_id: "..." })
149
+ SN-List-ChangeRequests({ state: "Pending Approval" })
150
+ SN-List-Problems({ state: "Open" })
151
+ ```
152
+
153
+ ### User/Group Management
154
+ ```javascript
155
+ SN-List-SysUsers({ query: "active=true", limit: 25 })
156
+ SN-List-SysUserGroups({ query: "active=true" })
157
+ SN-List-CmdbCis({ query: "..." })
158
+ ```
159
+
160
+ ### Application Scope
161
+ ```javascript
162
+ SN-Set-Current-Application({ app_sys_id: "..." })
163
+ ```
164
+
165
+ ### Schema Discovery
166
+ ```javascript
167
+ SN-Discover-Table-Schema({
168
+ table_name: "incident",
169
+ include_type_codes: true,
170
+ include_relationships: true
171
+ })
172
+
173
+ SN-Explain-Field({ table: "incident", field: "priority", include_examples: true })
174
+ ```
175
+
176
+ ### Configuration Validation
177
+ ```javascript
178
+ SN-Validate-Configuration({
179
+ catalog_item: "...",
180
+ checks: {
181
+ variables: { check_linked: true, check_types: true },
182
+ ui_policies: { check_conditions: true }
183
+ }
184
+ })
185
+ ```
186
+
187
+ ### Script Execution
188
+ ```javascript
189
+ // Execute background script (AUTOMATED via sys_trigger!)
190
+ SN-Execute-Background-Script({
191
+ script: "gs.info('Hello World');",
192
+ description: "Test script",
193
+ execution_method: "trigger" // Default, most reliable
194
+ })
195
+
196
+ // Create fix script (manual execution)
197
+ SN-Create-Fix-Script({
198
+ script_name: "fix_data",
199
+ script_content: "...",
200
+ auto_delete: false
201
+ })
202
+ ```
203
+
204
+ ---
205
+
206
+ ## 🌐 Multi-Instance Support
207
+
208
+ All tools support the `instance` parameter:
209
+
210
+ ```javascript
211
+ // Route to specific instance
212
+ SN-Query-Table({
213
+ table_name: "incident",
214
+ query: "state=1",
215
+ instance: "dev" // Routes to dev instance
216
+ })
217
+
218
+ // Default instance (from config)
219
+ SN-Query-Table({
220
+ table_name: "incident",
221
+ query: "state=1"
222
+ // Uses default instance
223
+ })
224
+
225
+ // Switch instance
226
+ SN-Set-Instance({ instance_name: "dev" })
227
+
228
+ // Get current instance
229
+ SN-Get-Current-Instance()
230
+ ```
231
+
232
+ ---
233
+
234
+ ## 📊 Tool Count Summary
235
+
236
+ | Category | Tools | Notes |
237
+ |----------|-------|-------|
238
+ | **Core CRUD** | 6 | Generic table operations |
239
+ | **Update Sets** | 6 | Automated set management |
240
+ | **Workflows** | 4 | Complete workflow creation |
241
+ | **Batch Ops** | 2 | Multi-record operations |
242
+ | **ITSM Convenience** | 10 | **NEW!** Incident/Change/Problem |
243
+ | **Specialized** | 16 | Users, schema, validation, scripts |
244
+ | **TOTAL** | **44** | Up from 34 |
245
+
246
+ ---
247
+
248
+ ## 🎯 Common Workflows
249
+
250
+ ### Complete Incident Resolution
251
+ ```javascript
252
+ // 1. List open incidents
253
+ SN-List-Incidents({ state: "1", limit: 10 })
254
+
255
+ // 2. Add work notes
256
+ SN-Add-Work-Notes({ incident_number: "INC0012345", work_notes: "Investigating..." })
257
+
258
+ // 3. Assign to engineer
259
+ SN-Assign-Incident({ incident_number: "INC0012345", assigned_to: "John Smith" })
260
+
261
+ // 4. Add customer comment
262
+ SN-Add-Comment({ incident_number: "INC0012345", comment: "Working on fix" })
263
+
264
+ // 5. Resolve
265
+ SN-Resolve-Incident({
266
+ incident_number: "INC0012345",
267
+ resolution_notes: "Fixed",
268
+ resolution_code: "Solved (Permanently)"
269
+ })
270
+
271
+ // 6. Close
272
+ SN-Close-Incident({
273
+ incident_number: "INC0012345",
274
+ close_notes: "Confirmed",
275
+ close_code: "Solved (Permanently)"
276
+ })
277
+ ```
278
+
279
+ ### Change Management
280
+ ```javascript
281
+ // 1. Assign for review
282
+ SN-Assign-Change({ change_number: "CHG0012345", assigned_to: "Jane Doe" })
283
+
284
+ // 2. Add review comment
285
+ SN-Add-Change-Comment({ change_number: "CHG0012345", comment: "Review complete" })
286
+
287
+ // 3. Approve
288
+ SN-Approve-Change({ change_number: "CHG0012345", approval_comments: "Approved" })
289
+ ```
290
+
291
+ ### Update Set Workflow
292
+ ```javascript
293
+ // 1. Create update set
294
+ SN-Create-Record({
295
+ table_name: "sys_update_set",
296
+ data: { name: "My Feature", description: "..." }
297
+ })
298
+
299
+ // 2. Set as current (AUTOMATED!)
300
+ SN-Set-Update-Set({ update_set_sys_id: "..." })
301
+
302
+ // 3. Make changes (auto-captured)
303
+ SN-Create-Record({ table_name: "sys_properties", data: {...} })
304
+
305
+ // 4. Verify capture
306
+ SN-Inspect-Update-Set({ update_set: "..." })
307
+
308
+ // 5. Clone for backup
309
+ SN-Clone-Update-Set({ source_update_set_id: "...", new_name: "Backup" })
310
+ ```
311
+
312
+ ---
313
+
314
+ ## ⚡ Performance Tips
315
+
316
+ ### Use Batch Operations
317
+ ```javascript
318
+ // ❌ Slow: 10 individual calls
319
+ for (let i = 0; i < 10; i++) {
320
+ SN-Update-Record({ table_name: "incident", sys_id: ids[i], data: { state: 6 } })
321
+ }
322
+
323
+ // ✅ Fast: 1 batch call
324
+ SN-Batch-Update({
325
+ updates: ids.map(id => ({ table: "incident", sys_id: id, data: { state: 6 } }))
326
+ })
327
+ ```
328
+
329
+ ### Limit Fields Returned
330
+ ```javascript
331
+ // ❌ Returns all fields
332
+ SN-Query-Table({ table_name: "incident", limit: 100 })
333
+
334
+ // ✅ Returns only needed fields
335
+ SN-Query-Table({
336
+ table_name: "incident",
337
+ fields: "number,state,priority,short_description",
338
+ limit: 100
339
+ })
340
+ ```
341
+
342
+ ### Use Convenience Tools
343
+ ```javascript
344
+ // ❌ 3 tool calls
345
+ SN-Query-Table({ table_name: "incident", query: "number=INC0012345" })
346
+ // Extract sys_id
347
+ SN-Update-Record({ table_name: "incident", sys_id: "...", data: { comments: "..." } })
348
+
349
+ // ✅ 1 tool call (66% faster)
350
+ SN-Add-Comment({ incident_number: "INC0012345", comment: "..." })
351
+ ```
352
+
353
+ ---
354
+
355
+ ## 🔍 Troubleshooting
356
+
357
+ ### Record Not Found
358
+ ```
359
+ Error: Incident INC0012345 not found
360
+ → Verify incident number is correct
361
+ → Check instance (dev vs prod)
362
+ → Ensure you have permissions
363
+ ```
364
+
365
+ ### User/Group Not Found
366
+ ```
367
+ Error: User "John Smith" not found
368
+ → Verify name exactly matches ServiceNow
369
+ → Try using sys_id instead
370
+ → Use SN-List-SysUsers to search
371
+ ```
372
+
373
+ ### Permission Denied
374
+ ```
375
+ Error: 403 Forbidden
376
+ → Check user roles (admin, itil, etc.)
377
+ → Verify table ACLs
378
+ → See docs/403_TROUBLESHOOTING.md
379
+ ```
380
+
381
+ ---
382
+
383
+ ## 📚 Documentation
384
+
385
+ - **Complete Guide:** `/docs/CONVENIENCE_TOOLS.md`
386
+ - **API Reference:** `/docs/API_REFERENCE.md`
387
+ - **Setup Guide:** `/docs/SETUP_GUIDE.md`
388
+ - **Quick Summary:** `/CONVENIENCE_TOOLS_SUMMARY.md`
389
+ - **This Card:** `/QUICK_REFERENCE.md`
390
+
391
+ ---
392
+
393
+ **Version:** 2.0
394
+ **Total Tools:** 44
395
+ **Last Updated:** 2025-10-06
package/docs/README.md ADDED
@@ -0,0 +1,75 @@
1
+ # ServiceNow MCP Server - Documentation
2
+
3
+ Complete documentation for the ServiceNow MCP Server v2.0.
4
+
5
+ ---
6
+
7
+ ## 📚 Documentation Index
8
+
9
+ ### Getting Started
10
+
11
+ - **[API Reference](API_REFERENCE.md)** - Complete reference for all MCP tools
12
+ - **[Setup Guide](SETUP_GUIDE.md)** - Installation and configuration
13
+ - **[Multi-Instance Configuration](MULTI_INSTANCE_CONFIGURATION.md)** - Connect to multiple ServiceNow instances
14
+
15
+ ### Guides
16
+
17
+ - **[Instance Switching Guide](INSTANCE_SWITCHING_GUIDE.md)** - How to route requests between instances
18
+ - **[403 Troubleshooting](403_TROUBLESHOOTING.md)** - Fix permission errors
19
+
20
+ ### Research & Technical Deep-Dives
21
+
22
+ The **[research/](research/)** folder contains technical research, breakthrough discoveries, and architectural analysis:
23
+
24
+ - **Flow Designer feasibility analysis**
25
+ - **Background script execution breakthroughs**
26
+ - **Workflow vs Flow Designer comparison**
27
+ - **Architecture evolution**
28
+ - **Change logs and testing recommendations**
29
+
30
+ ---
31
+
32
+ ## Quick Links
33
+
34
+ **Main Documentation:** `../README.md`
35
+ **Source Code:** `../src/`
36
+ **Configuration:** `../config/`
37
+
38
+ ---
39
+
40
+ ## Documentation Organization
41
+
42
+ ```
43
+ docs/
44
+ ├── README.md # This file
45
+ ├── API_REFERENCE.md # Complete API documentation
46
+ ├── SETUP_GUIDE.md # Setup instructions
47
+ ├── MULTI_INSTANCE_CONFIGURATION.md # Multi-instance setup
48
+ ├── INSTANCE_SWITCHING_GUIDE.md # Instance routing guide
49
+ ├── 403_TROUBLESHOOTING.md # Permission troubleshooting
50
+ └── research/ # Technical research & discoveries
51
+ ├── FLOW_DESIGNER_MCP_FEASIBILITY.md
52
+ ├── BACKGROUND_SCRIPT_EXECUTION.md
53
+ ├── UI_API_BREAKTHROUGH.md
54
+ ├── WORKFLOW_CREATION.md
55
+ └── ... (more research docs)
56
+ ```
57
+
58
+ ---
59
+
60
+ ## Contributing
61
+
62
+ When adding new documentation:
63
+
64
+ 1. **Operational Docs** → Place in `docs/` root
65
+ 2. **Research/Analysis** → Place in `docs/research/`
66
+ 3. **Update this README** with links to new docs
67
+
68
+ ---
69
+
70
+ ## Support
71
+
72
+ For issues or questions:
73
+ - Check the troubleshooting guides
74
+ - Review research docs for technical details
75
+ - See main README.md for project overview