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.
- package/.claude/settings.local.json +70 -0
- package/CLAUDE.md +777 -0
- package/LICENSE +21 -0
- package/README.md +562 -0
- package/assets/logo.svg +385 -0
- package/config/servicenow-instances.json.example +28 -0
- package/docs/403_TROUBLESHOOTING.md +329 -0
- package/docs/API_REFERENCE.md +1142 -0
- package/docs/APPLICATION_SCOPE_VALIDATION.md +681 -0
- package/docs/CLAUDE_DESKTOP_SETUP.md +373 -0
- package/docs/CONVENIENCE_TOOLS.md +601 -0
- package/docs/CONVENIENCE_TOOLS_SUMMARY.md +371 -0
- package/docs/FLOW_DESIGNER_GUIDE.md +1021 -0
- package/docs/IMPLEMENTATION_COMPLETE.md +165 -0
- package/docs/INSTANCE_SWITCHING_GUIDE.md +219 -0
- package/docs/MULTI_INSTANCE_CONFIGURATION.md +185 -0
- package/docs/NATURAL_LANGUAGE_SEARCH_IMPLEMENTATION.md +221 -0
- package/docs/PUPPETEER_INTEGRATION_PROPOSAL.md +1322 -0
- package/docs/QUICK_REFERENCE.md +395 -0
- package/docs/README.md +75 -0
- package/docs/RESOURCES_ARCHITECTURE.md +392 -0
- package/docs/RESOURCES_IMPLEMENTATION.md +276 -0
- package/docs/RESOURCES_SUMMARY.md +104 -0
- package/docs/SETUP_GUIDE.md +104 -0
- package/docs/UI_OPERATIONS_ARCHITECTURE.md +1219 -0
- package/docs/UI_OPERATIONS_DECISION_MATRIX.md +542 -0
- package/docs/UI_OPERATIONS_SUMMARY.md +507 -0
- package/docs/UPDATE_SET_VALIDATION.md +598 -0
- package/docs/UPDATE_SET_VALIDATION_SUMMARY.md +209 -0
- package/docs/VALIDATION_SUMMARY.md +479 -0
- package/jest.config.js +24 -0
- package/package.json +61 -0
- package/scripts/background_script_2025-09-29T20-19-35-101Z.js +23 -0
- package/scripts/link_ui_policy_actions_2025-09-29T20-17-15-218Z.js +90 -0
- package/scripts/set_update_set_Integration_Governance_Framework_2025-09-29T19-47-06-790Z.js +30 -0
- package/scripts/set_update_set_Integration_Governance_Framework_2025-09-29T19-59-33-152Z.js +30 -0
- package/scripts/set_update_set_current_2025-09-29T20-16-59-675Z.js +24 -0
- package/scripts/test_sys_dictionary_403.js +85 -0
- package/setup/setup-report.json +5313 -0
- package/src/config/comprehensive-table-definitions.json +2575 -0
- package/src/config/instance-config.json +4693 -0
- package/src/config/prompts.md +59 -0
- package/src/config/table-definitions.json +4681 -0
- package/src/config-manager.js +146 -0
- package/src/mcp-server-consolidated.js +2894 -0
- package/src/natural-language.js +472 -0
- package/src/resources.js +326 -0
- package/src/script-sync.js +428 -0
- package/src/server.js +125 -0
- package/src/servicenow-client.js +1625 -0
- package/src/stdio-server.js +52 -0
- package/start-mcp.sh +7 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Happy Technologies LLC
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,562 @@
|
|
|
1
|
+
<div align="center">
|
|
2
|
+
<img src="assets/logo.svg" alt="ServiceNow MCP Server" width="200"/>
|
|
3
|
+
|
|
4
|
+
# ServiceNow MCP Server v2.1
|
|
5
|
+
|
|
6
|
+
**Multi-Instance Intelligent Architecture**
|
|
7
|
+
|
|
8
|
+
A revolutionary metadata-driven ServiceNow MCP server that supports multiple ServiceNow instances simultaneously with automatic schema discovery and optimized tool generation.
|
|
9
|
+
|
|
10
|
+
*Part of the [Happy Technologies](https://happy-tech.biz) composable service ecosystem*
|
|
11
|
+
|
|
12
|
+
[](LICENSE)
|
|
13
|
+
[](https://nodejs.org)
|
|
14
|
+
[](https://www.servicenow.com)
|
|
15
|
+
|
|
16
|
+
</div>
|
|
17
|
+
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
## 🚀 Revolutionary Features
|
|
21
|
+
|
|
22
|
+
- **🌐 Multi-Instance Support**: Connect to multiple ServiceNow instances simultaneously with instance-specific tool routing
|
|
23
|
+
- **🧠 Intelligent Schema Discovery**: Automatically discovers table structures and relationships from your ServiceNow instances
|
|
24
|
+
- **📊 160+ ServiceNow Tables**: Complete coverage including ITSM, CMDB, Service Catalog, Platform Development, and Flow Designer
|
|
25
|
+
- **⚙️ Generic CRUD Operations**: 44 powerful MCP tools that work on **any** ServiceNow table
|
|
26
|
+
- **🔧 Dynamic Schema Loading**: Table metadata discovered at runtime - no hardcoded definitions
|
|
27
|
+
- **📱 Instance-Adaptive**: Automatically handles custom fields, modified tables, and different ServiceNow editions
|
|
28
|
+
- **🎯 Batch Operations**: 43+ parallel operations tested successfully
|
|
29
|
+
- **🎨 Local Script Development**: Sync scripts with Git, watch mode for continuous development
|
|
30
|
+
- **🗣️ Natural Language Search**: Query ServiceNow using plain English queries
|
|
31
|
+
- **📚 MCP Resources**: 8 read-only resource URIs for quick lookups and documentation
|
|
32
|
+
|
|
33
|
+
## 🆕 What's New in v2.1
|
|
34
|
+
|
|
35
|
+
**October 2025 Release**
|
|
36
|
+
|
|
37
|
+
- 🎨 **Local Script Development**: Sync scripts with Git, watch mode for continuous development, full version control integration
|
|
38
|
+
- 🗣️ **Natural Language Search**: Query ServiceNow using plain English (15+ supported patterns)
|
|
39
|
+
- ⚡ **10 Convenience Tools**: Specialized ITSM operations (Add-Comment, Add-Work-Notes, Assign, Resolve, Close incidents/changes/problems)
|
|
40
|
+
- 📚 **MCP Resources**: 8 read-only resource URIs for quick table lookups and API documentation
|
|
41
|
+
- 📊 **Progress Reporting**: Real-time feedback for batch operations and long-running tasks
|
|
42
|
+
- ✅ **Validated Features**: Application scope and update set management thoroughly tested in production environments
|
|
43
|
+
|
|
44
|
+
## ⚡ Quick Start (2-3 Minutes)
|
|
45
|
+
|
|
46
|
+
### Prerequisites
|
|
47
|
+
- Node.js 18+
|
|
48
|
+
- ServiceNow instance(s) with API access
|
|
49
|
+
- Valid ServiceNow credentials
|
|
50
|
+
|
|
51
|
+
**Note:** Version 2.1 includes new local development features. See `CLAUDE.md` for complete workflow documentation.
|
|
52
|
+
|
|
53
|
+
### 🎯 Setup Instructions
|
|
54
|
+
|
|
55
|
+
1. **Clone and install:**
|
|
56
|
+
```bash
|
|
57
|
+
git clone <repository-url>
|
|
58
|
+
cd mcp-servicenow-nodejs
|
|
59
|
+
npm install
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
2. **Configure your ServiceNow instance(s):**
|
|
63
|
+
|
|
64
|
+
**Option A: Multi-Instance Setup (Recommended)**
|
|
65
|
+
```bash
|
|
66
|
+
# Create config file
|
|
67
|
+
cp config/servicenow-instances.example.json config/servicenow-instances.json
|
|
68
|
+
|
|
69
|
+
# Edit with your instances
|
|
70
|
+
nano config/servicenow-instances.json
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
Example multi-instance config:
|
|
74
|
+
```json
|
|
75
|
+
{
|
|
76
|
+
"instances": [
|
|
77
|
+
{
|
|
78
|
+
"name": "dev",
|
|
79
|
+
"url": "https://dev123456.service-now.com",
|
|
80
|
+
"username": "admin",
|
|
81
|
+
"password": "your-password",
|
|
82
|
+
"default": true
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
"name": "prod",
|
|
86
|
+
"url": "https://prod789012.service-now.com",
|
|
87
|
+
"username": "integration_user",
|
|
88
|
+
"password": "your-password"
|
|
89
|
+
}
|
|
90
|
+
]
|
|
91
|
+
}
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
**Option B: Single Instance Setup (Legacy)**
|
|
95
|
+
```bash
|
|
96
|
+
# Copy environment template
|
|
97
|
+
cp .env.example .env
|
|
98
|
+
|
|
99
|
+
# Edit with your credentials
|
|
100
|
+
nano .env
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
3. **Start the server:**
|
|
104
|
+
```bash
|
|
105
|
+
npm run dev
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
4. **Verify connection:**
|
|
109
|
+
```bash
|
|
110
|
+
# Health check
|
|
111
|
+
curl http://localhost:3000/health
|
|
112
|
+
|
|
113
|
+
# List instances
|
|
114
|
+
curl http://localhost:3000/instances
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
5. **Connect your AI assistant:**
|
|
118
|
+
- **HTTP Transport:** `http://localhost:3000/mcp`
|
|
119
|
+
- **Stdio Transport:** Use `npm run stdio` (for Claude Desktop)
|
|
120
|
+
- Test with MCP Inspector: `npm run inspector`
|
|
121
|
+
|
|
122
|
+
## 🌐 Multi-Instance Support
|
|
123
|
+
|
|
124
|
+
### Instance-Specific Tool Routing
|
|
125
|
+
|
|
126
|
+
All tools automatically support multi-instance operations:
|
|
127
|
+
|
|
128
|
+
```bash
|
|
129
|
+
# Default instance (marked with "default": true in config)
|
|
130
|
+
SN-List-Incidents { "limit": 10 }
|
|
131
|
+
|
|
132
|
+
# Specific instance
|
|
133
|
+
SN-List-Incidents { "instance": "prod", "limit": 10 }
|
|
134
|
+
|
|
135
|
+
# List all configured instances
|
|
136
|
+
curl http://localhost:3000/instances
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
### Tool Naming Convention
|
|
140
|
+
|
|
141
|
+
**Without Instance Parameter:**
|
|
142
|
+
- Uses default instance from config
|
|
143
|
+
- Example: `SN-Create-Incident` → creates in default instance
|
|
144
|
+
|
|
145
|
+
**With Instance Parameter:**
|
|
146
|
+
- Routes to specified instance
|
|
147
|
+
- Example: `SN-Create-Incident { "instance": "prod", ... }` → creates in prod instance
|
|
148
|
+
|
|
149
|
+
## 📊 Comprehensive ServiceNow Coverage
|
|
150
|
+
|
|
151
|
+
### 🎯 **44 MCP Tools** Supporting **160+ ServiceNow Tables**
|
|
152
|
+
|
|
153
|
+
*Generic tools work on any ServiceNow table through dynamic schema discovery*
|
|
154
|
+
|
|
155
|
+
| **Tool Category** | **Tools** | **What They Do** |
|
|
156
|
+
|-------------------|-----------|------------------|
|
|
157
|
+
| **Generic CRUD** | 7 tools | Query, Create, Get, Update on **any** table |
|
|
158
|
+
| **Specialized ITSM** | 8 tools | Incident, Change, Problem convenience wrappers |
|
|
159
|
+
| **Convenience Tools** | 10 tools | Add-Comment, Add-Work-Notes, Assign, Resolve, Close operations |
|
|
160
|
+
| **Natural Language** | 1 tool | Query using plain English instead of encoded queries |
|
|
161
|
+
| **Update Set Management** | 6 tools | Set, list, move, clone, inspect update sets |
|
|
162
|
+
| **Background Scripts** | 2 tools | Execute scripts, create fix scripts |
|
|
163
|
+
| **Script Synchronization** | 3 tools | Sync scripts with local files, watch mode, Git integration |
|
|
164
|
+
| **Workflows** | 4 tools | Create workflows, activities, transitions |
|
|
165
|
+
| **Batch Operations** | 2 tools | Batch create/update across tables |
|
|
166
|
+
| **Schema Discovery** | 3 tools | Get table schemas, field info, relationships |
|
|
167
|
+
| **Multi-Instance** | 2 tools | Switch instances, get current instance |
|
|
168
|
+
| **MCP Resources** | 8 resources | Read-only URIs for table lists, common tables, field info |
|
|
169
|
+
|
|
170
|
+
### 📋 **Supported Table Categories (160+ Total)**
|
|
171
|
+
|
|
172
|
+
| **Category** | **Example Tables** |
|
|
173
|
+
|--------------|-------------------|
|
|
174
|
+
| **🏆 Core ITSM** | incident, change_request, problem, sc_request, sc_req_item |
|
|
175
|
+
| **📦 Service Catalog** | sc_cat_item, catalog_ui_policy, item_option_new |
|
|
176
|
+
| **👥 User Management** | sys_user, sys_user_group, sys_user_role |
|
|
177
|
+
| **🔧 CMDB & Assets** | cmdb_ci, alm_asset, cmdb_rel_ci |
|
|
178
|
+
| **⚙️ Platform Development** | sys_script, sys_ui_policy, sys_update_set, sys_update_xml |
|
|
179
|
+
| **🔄 Flow Designer** | sys_hub_flow, sys_hub_flow_logic, sys_hub_flow_variable |
|
|
180
|
+
| **🌊 Workflows** | wf_workflow, wf_activity, wf_transition |
|
|
181
|
+
| **🔗 Integration** | sys_rest_message, sys_ws_definition, sys_import_set |
|
|
182
|
+
|
|
183
|
+
### 🧠 **Tool Examples**
|
|
184
|
+
|
|
185
|
+
**Standard CRUD Operations (Every Table):**
|
|
186
|
+
```javascript
|
|
187
|
+
// List records with filtering
|
|
188
|
+
SN-List-Incidents({ "query": "state=1^priority=1", "limit": 10 })
|
|
189
|
+
|
|
190
|
+
// Create new record
|
|
191
|
+
SN-Create-Incident({ "short_description": "Email down", "urgency": 1 })
|
|
192
|
+
|
|
193
|
+
// Get single record
|
|
194
|
+
SN-Get-Incident({ "sys_id": "abc123..." })
|
|
195
|
+
|
|
196
|
+
// Update record
|
|
197
|
+
SN-Update-Record({ "table_name": "incident", "sys_id": "abc123...", "data": {...} })
|
|
198
|
+
|
|
199
|
+
// Query with complex filters
|
|
200
|
+
SN-Query-Table({ "table_name": "incident", "query": "active=true", "fields": "number,short_description" })
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
**Specialized Tools:**
|
|
204
|
+
```javascript
|
|
205
|
+
// Background script execution (automated via sys_trigger)
|
|
206
|
+
SN-Execute-Background-Script({ "script": "gs.info('Hello');" })
|
|
207
|
+
|
|
208
|
+
// Update set management
|
|
209
|
+
SN-Get-Current-Update-Set()
|
|
210
|
+
SN-Set-Update-Set({ "update_set_sys_id": "abc123..." })
|
|
211
|
+
SN-Move-Records-To-Update-Set({ "update_set_id": "xyz789...", "source_update_set": "Default" })
|
|
212
|
+
|
|
213
|
+
// Table schema introspection
|
|
214
|
+
SN-Get-Table-Schema({ "table_name": "incident" })
|
|
215
|
+
SN-Discover-Table-Schema({ "table_name": "sys_hub_flow", "include_relationships": true })
|
|
216
|
+
|
|
217
|
+
// Batch operations
|
|
218
|
+
SN-Batch-Create({ "operations": [...] })
|
|
219
|
+
SN-Batch-Update({ "updates": [...] })
|
|
220
|
+
|
|
221
|
+
// Workflow creation
|
|
222
|
+
SN-Create-Workflow({ "name": "Auto-Approve", "table": "change_request", "activities": [...] })
|
|
223
|
+
```
|
|
224
|
+
|
|
225
|
+
### 🎨 **Local Development Workflow (NEW!)**
|
|
226
|
+
|
|
227
|
+
Develop ServiceNow scripts locally with Git integration and automatic synchronization:
|
|
228
|
+
|
|
229
|
+
```javascript
|
|
230
|
+
// Sync local script to ServiceNow
|
|
231
|
+
SN-Sync-Script-From-Local({
|
|
232
|
+
"local_path": "./scripts/my_business_rule.js",
|
|
233
|
+
"table": "sys_script",
|
|
234
|
+
"sys_id": "abc123...",
|
|
235
|
+
"instance": "dev"
|
|
236
|
+
})
|
|
237
|
+
|
|
238
|
+
// Watch directory for changes (continuous development)
|
|
239
|
+
SN-Watch-Scripts({
|
|
240
|
+
"directory": "./scripts",
|
|
241
|
+
"instance": "dev",
|
|
242
|
+
"auto_sync": true
|
|
243
|
+
})
|
|
244
|
+
|
|
245
|
+
// Sync entire directory
|
|
246
|
+
SN-Sync-Scripts-Directory({
|
|
247
|
+
"directory": "./scripts",
|
|
248
|
+
"instance": "dev",
|
|
249
|
+
"dry_run": false
|
|
250
|
+
})
|
|
251
|
+
```
|
|
252
|
+
|
|
253
|
+
**Benefits:**
|
|
254
|
+
- Version control your ServiceNow scripts with Git
|
|
255
|
+
- Local IDE development with syntax highlighting
|
|
256
|
+
- Automatic sync on file save
|
|
257
|
+
- Backup and restore scripts easily
|
|
258
|
+
- Team collaboration via Git workflows
|
|
259
|
+
|
|
260
|
+
See **CLAUDE.md** for complete local development workflow.
|
|
261
|
+
|
|
262
|
+
### 🗣️ **Natural Language Search (NEW!)**
|
|
263
|
+
|
|
264
|
+
Query ServiceNow using plain English instead of encoded queries:
|
|
265
|
+
|
|
266
|
+
```javascript
|
|
267
|
+
// Natural language queries
|
|
268
|
+
SN-Natural-Language-Search({
|
|
269
|
+
"table": "incident",
|
|
270
|
+
"nl_query": "all high priority incidents assigned to me",
|
|
271
|
+
"instance": "dev"
|
|
272
|
+
})
|
|
273
|
+
|
|
274
|
+
SN-Natural-Language-Search({
|
|
275
|
+
"table": "change_request",
|
|
276
|
+
"nl_query": "emergency changes created this week",
|
|
277
|
+
"instance": "prod"
|
|
278
|
+
})
|
|
279
|
+
|
|
280
|
+
SN-Natural-Language-Search({
|
|
281
|
+
"table": "problem",
|
|
282
|
+
"nl_query": "unresolved problems from network team",
|
|
283
|
+
"instance": "dev"
|
|
284
|
+
})
|
|
285
|
+
```
|
|
286
|
+
|
|
287
|
+
**Supported Patterns (15+):**
|
|
288
|
+
- "high priority incidents assigned to me"
|
|
289
|
+
- "emergency changes created this week"
|
|
290
|
+
- "open problems from database team"
|
|
291
|
+
- "resolved incidents updated yesterday"
|
|
292
|
+
- "active change requests for production"
|
|
293
|
+
|
|
294
|
+
**When to Use:**
|
|
295
|
+
- Use NL search for quick exploratory queries
|
|
296
|
+
- Use encoded queries for complex automation
|
|
297
|
+
- NL search translates to encoded queries automatically
|
|
298
|
+
|
|
299
|
+
### ⚡ **Convenience Tools (NEW!)**
|
|
300
|
+
|
|
301
|
+
Specialized operations for common ITSM tasks:
|
|
302
|
+
|
|
303
|
+
```javascript
|
|
304
|
+
// Add comments (visible to users)
|
|
305
|
+
SN-Incident-Add-Comment({
|
|
306
|
+
"sys_id": "abc123...",
|
|
307
|
+
"comment": "Issue resolved, monitoring for 24 hours",
|
|
308
|
+
"instance": "dev"
|
|
309
|
+
})
|
|
310
|
+
|
|
311
|
+
// Add work notes (internal)
|
|
312
|
+
SN-Incident-Add-Work-Notes({
|
|
313
|
+
"sys_id": "abc123...",
|
|
314
|
+
"work_notes": "Restarted application server, logs attached",
|
|
315
|
+
"instance": "dev"
|
|
316
|
+
})
|
|
317
|
+
|
|
318
|
+
// Assign incident
|
|
319
|
+
SN-Incident-Assign({
|
|
320
|
+
"sys_id": "abc123...",
|
|
321
|
+
"assigned_to": "user_sys_id",
|
|
322
|
+
"assignment_group": "group_sys_id",
|
|
323
|
+
"instance": "dev"
|
|
324
|
+
})
|
|
325
|
+
|
|
326
|
+
// Resolve incident
|
|
327
|
+
SN-Incident-Resolve({
|
|
328
|
+
"sys_id": "abc123...",
|
|
329
|
+
"resolution_code": "Solved (Permanently)",
|
|
330
|
+
"resolution_notes": "Fixed configuration error",
|
|
331
|
+
"instance": "dev"
|
|
332
|
+
})
|
|
333
|
+
|
|
334
|
+
// Close incident
|
|
335
|
+
SN-Incident-Close({
|
|
336
|
+
"sys_id": "abc123...",
|
|
337
|
+
"close_code": "Solved (Permanently)",
|
|
338
|
+
"close_notes": "User confirmed resolution",
|
|
339
|
+
"instance": "dev"
|
|
340
|
+
})
|
|
341
|
+
```
|
|
342
|
+
|
|
343
|
+
**Available for:** Incidents, Change Requests, Problems
|
|
344
|
+
|
|
345
|
+
**Operations:** Add-Comment, Add-Work-Notes, Assign, Resolve, Close
|
|
346
|
+
|
|
347
|
+
### 📋 **Complete Table Coverage**
|
|
348
|
+
|
|
349
|
+
**Core Service Management:**
|
|
350
|
+
`incident` • `change_request` • `change_task` • `problem` • `problem_task` • `sc_request` • `sc_req_item` • `sysapproval_approver`
|
|
351
|
+
|
|
352
|
+
**Service Catalog:**
|
|
353
|
+
`sc_cat_item` • `sc_category` • `item_option_new` • `catalog_ui_policy` • `catalog_ui_policy_action`
|
|
354
|
+
|
|
355
|
+
**CMDB & Assets:**
|
|
356
|
+
`cmdb_ci` • `cmdb_ci_*` (all CI types) • `cmdb_rel_ci` • `alm_asset` • `ast_contract`
|
|
357
|
+
|
|
358
|
+
**Platform Development:**
|
|
359
|
+
`sys_script` • `sys_script_client` • `sys_script_include` • `sys_ui_script` • `sys_ui_policy` • `sys_update_set` • `sys_update_xml`
|
|
360
|
+
|
|
361
|
+
**Flow Designer (NEW!):**
|
|
362
|
+
`sys_hub_flow` • `sys_hub_flow_base` • `sys_hub_flow_logic` • `sys_hub_flow_variable` • `sys_hub_flow_stage`
|
|
363
|
+
|
|
364
|
+
**Workflows:**
|
|
365
|
+
`wf_workflow` • `wf_activity` • `wf_transition` • `wf_version`
|
|
366
|
+
|
|
367
|
+
**Integration & APIs:**
|
|
368
|
+
`sys_rest_message` • `sys_ws_definition` • `sys_import_set` • `sys_transform_map`
|
|
369
|
+
|
|
370
|
+
**160+ total tables** including UI/UX development, user management, knowledge bases, and more!
|
|
371
|
+
|
|
372
|
+
## Testing with MCP Inspector
|
|
373
|
+
|
|
374
|
+
1. **Start the MCP server:**
|
|
375
|
+
```bash
|
|
376
|
+
npm run dev
|
|
377
|
+
```
|
|
378
|
+
|
|
379
|
+
2. **Launch MCP Inspector in a new terminal:**
|
|
380
|
+
```bash
|
|
381
|
+
npm run inspector
|
|
382
|
+
```
|
|
383
|
+
|
|
384
|
+
3. **Configure connection:**
|
|
385
|
+
- Transport Type: **Streamable HTTP (SSE)**
|
|
386
|
+
- URL: `http://localhost:3000/mcp`
|
|
387
|
+
- Click **Connect**
|
|
388
|
+
|
|
389
|
+
4. **Test tools:**
|
|
390
|
+
- Browse available tools in the Tools tab
|
|
391
|
+
- Execute tool calls with parameters
|
|
392
|
+
- View responses and errors
|
|
393
|
+
|
|
394
|
+
## Claude Desktop Integration
|
|
395
|
+
|
|
396
|
+
Add to your Claude Desktop config (`~/Library/Application Support/Claude/claude_desktop_config.json`):
|
|
397
|
+
|
|
398
|
+
```json
|
|
399
|
+
{
|
|
400
|
+
"mcpServers": {
|
|
401
|
+
"servicenow-nodejs": {
|
|
402
|
+
"command": "node",
|
|
403
|
+
"args": ["/Users/YOUR_USERNAME/WebstormProjects/mcp-servicenow-nodejs/src/stdio-server.js"],
|
|
404
|
+
"cwd": "/Users/YOUR_USERNAME/WebstormProjects/mcp-servicenow-nodejs",
|
|
405
|
+
"env": {
|
|
406
|
+
"SERVICENOW_INSTANCE_URL": "https://your-instance.service-now.com",
|
|
407
|
+
"SERVICENOW_USERNAME": "your-username",
|
|
408
|
+
"SERVICENOW_PASSWORD": "your-password",
|
|
409
|
+
"SERVICENOW_AUTH_TYPE": "basic"
|
|
410
|
+
}
|
|
411
|
+
}
|
|
412
|
+
}
|
|
413
|
+
}
|
|
414
|
+
```
|
|
415
|
+
|
|
416
|
+
**Important:** Replace `YOUR_USERNAME` with your actual username and update credentials.
|
|
417
|
+
|
|
418
|
+
Then restart Claude Desktop (⌘Q and reopen) to see ServiceNow tools appear.
|
|
419
|
+
|
|
420
|
+
**Detailed setup guide:** `docs/CLAUDE_DESKTOP_SETUP.md`
|
|
421
|
+
|
|
422
|
+
## Architecture
|
|
423
|
+
|
|
424
|
+
```
|
|
425
|
+
src/
|
|
426
|
+
├── server.js # Express HTTP server with SSE transport
|
|
427
|
+
├── stdio-server.js # Stdio transport for Claude Desktop
|
|
428
|
+
├── mcp-server-consolidated.js # MCP tool registration & routing
|
|
429
|
+
├── servicenow-client.js # ServiceNow REST API client
|
|
430
|
+
└── config-manager.js # Multi-instance configuration manager
|
|
431
|
+
|
|
432
|
+
config/
|
|
433
|
+
└── servicenow-instances.json # Multi-instance configuration
|
|
434
|
+
|
|
435
|
+
docs/
|
|
436
|
+
├── FLOW_DESIGNER_MCP_FEASIBILITY.md # Flow Designer feasibility analysis
|
|
437
|
+
└── MCP_Tool_Limitations.md # API limitation documentation
|
|
438
|
+
```
|
|
439
|
+
|
|
440
|
+
**Key Features:**
|
|
441
|
+
- **Multi-Instance Routing:** Single server connects to multiple ServiceNow instances
|
|
442
|
+
- **Dynamic Tool Generation:** Tools auto-generate from table metadata
|
|
443
|
+
- **Metadata-Driven:** No hardcoded table definitions
|
|
444
|
+
- **Instance Fallback:** Supports `.env` for single-instance backward compatibility
|
|
445
|
+
- **Session Management:** Separate MCP sessions per client connection
|
|
446
|
+
- **Error Handling:** Comprehensive error reporting with context
|
|
447
|
+
|
|
448
|
+
## Key Features & Improvements
|
|
449
|
+
|
|
450
|
+
### ✅ **Multi-Instance Support**
|
|
451
|
+
- Connect to multiple ServiceNow instances simultaneously
|
|
452
|
+
- Instance-specific tool routing with `instance` parameter
|
|
453
|
+
- Centralized configuration in `config/servicenow-instances.json`
|
|
454
|
+
- Fallback to `.env` for single-instance backward compatibility
|
|
455
|
+
|
|
456
|
+
### ✅ **Background Script Execution**
|
|
457
|
+
- **Automated execution** via `sys_trigger` table (runs in ~1 second)
|
|
458
|
+
- No manual copy-paste required for most scripts
|
|
459
|
+
- Automatic trigger cleanup after execution
|
|
460
|
+
- Fallback to fix script generation if execution fails
|
|
461
|
+
|
|
462
|
+
### ✅ **Advanced Update Set Management**
|
|
463
|
+
- Set current update set programmatically
|
|
464
|
+
- Move records between update sets (including from "Default")
|
|
465
|
+
- Clone entire update sets with all records
|
|
466
|
+
- Inspect update set contents and dependencies
|
|
467
|
+
|
|
468
|
+
### ✅ **Comprehensive Table Operations**
|
|
469
|
+
- 480+ auto-generated tools across 160+ tables
|
|
470
|
+
- Generic CRUD operations work on **any** ServiceNow table
|
|
471
|
+
- Schema introspection with relationships and constraints
|
|
472
|
+
- Batch create/update operations for efficiency
|
|
473
|
+
|
|
474
|
+
### ✅ **Workflow & Flow Designer Support**
|
|
475
|
+
- Create workflows with activities and transitions
|
|
476
|
+
- Read Flow Designer flows (sys_hub_flow tables)
|
|
477
|
+
- Create flow variables, stages, and components
|
|
478
|
+
- See `docs/FLOW_DESIGNER_MCP_FEASIBILITY.md` for details
|
|
479
|
+
|
|
480
|
+
## Known Limitations
|
|
481
|
+
|
|
482
|
+
See `docs/MCP_Tool_Limitations.md` for comprehensive documentation. Key limitations:
|
|
483
|
+
|
|
484
|
+
**Cannot Be Done via REST API:**
|
|
485
|
+
- ❌ Flow Designer logic block creation (use UI or templates)
|
|
486
|
+
- ❌ Flow compilation/validation (flows compile in UI)
|
|
487
|
+
- ⚠️ UI Policy Actions linking (requires background script with setValue())
|
|
488
|
+
|
|
489
|
+
**Workarounds Available:**
|
|
490
|
+
- ✅ Background scripts execute automatically via `sys_trigger`
|
|
491
|
+
- ✅ Update set operations fully automated
|
|
492
|
+
- ✅ Generic table operations work on custom tables
|
|
493
|
+
- ✅ Workflow creation fully supported
|
|
494
|
+
|
|
495
|
+
## Troubleshooting
|
|
496
|
+
|
|
497
|
+
### Connection Issues
|
|
498
|
+
|
|
499
|
+
```bash
|
|
500
|
+
# Test ServiceNow connectivity
|
|
501
|
+
curl -u username:password https://your-instance.service-now.com/api/now/table/incident?sysparm_limit=1
|
|
502
|
+
|
|
503
|
+
# Check server health
|
|
504
|
+
curl http://localhost:3000/health
|
|
505
|
+
|
|
506
|
+
# List configured instances
|
|
507
|
+
curl http://localhost:3000/instances
|
|
508
|
+
```
|
|
509
|
+
|
|
510
|
+
### Configuration Issues
|
|
511
|
+
|
|
512
|
+
**Multi-instance not working:**
|
|
513
|
+
- Verify `config/servicenow-instances.json` exists and is valid JSON
|
|
514
|
+
- Check that at least one instance has `"default": true`
|
|
515
|
+
- Restart server after config changes
|
|
516
|
+
|
|
517
|
+
**Tools not appearing:**
|
|
518
|
+
- Verify MCP connection in Inspector
|
|
519
|
+
- Check server logs for registration errors
|
|
520
|
+
- Ensure ServiceNow credentials are correct
|
|
521
|
+
|
|
522
|
+
**Authentication failures:**
|
|
523
|
+
- Verify username/password in config file
|
|
524
|
+
- Check ServiceNow user has required roles
|
|
525
|
+
- Test credentials in browser first
|
|
526
|
+
|
|
527
|
+
### Debug Mode
|
|
528
|
+
|
|
529
|
+
```bash
|
|
530
|
+
# Enable verbose logging
|
|
531
|
+
DEBUG=true npm run dev
|
|
532
|
+
|
|
533
|
+
# Check background script execution logs
|
|
534
|
+
# ServiceNow: System Logs → System Log → All
|
|
535
|
+
# Filter by source: "Script execution"
|
|
536
|
+
```
|
|
537
|
+
|
|
538
|
+
## Performance & Statistics
|
|
539
|
+
|
|
540
|
+
- **Cold start:** ~1-2 seconds
|
|
541
|
+
- **Tool execution:** ~200-500ms average (depends on ServiceNow instance)
|
|
542
|
+
- **Memory usage:** ~50MB baseline per instance
|
|
543
|
+
- **Concurrent sessions:** 100+ supported
|
|
544
|
+
- **Background scripts:** Execute in ~1 second via sys_trigger
|
|
545
|
+
- **MCP Tools:** 44 total (34 tools + 10 convenience tools)
|
|
546
|
+
- **MCP Resources:** 8 read-only resource URIs
|
|
547
|
+
- **Natural Language Patterns:** 15+ supported query patterns
|
|
548
|
+
- **Convenience Operations:** 10+ specialized ITSM operations (5 operations × 3 table types)
|
|
549
|
+
- **Tables Supported:** 160+ ServiceNow tables via generic tools
|
|
550
|
+
- **Batch Operations:** 43+ parallel calls tested successfully
|
|
551
|
+
|
|
552
|
+
## 📄 License
|
|
553
|
+
|
|
554
|
+
This project is licensed under the **MIT License** - see the [LICENSE](LICENSE) file for details.
|
|
555
|
+
|
|
556
|
+
**Copyright © 2025 Happy Technologies LLC**
|
|
557
|
+
|
|
558
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
559
|
+
|
|
560
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
561
|
+
|
|
562
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|