@jupiterone/jupiterone-mcp 0.0.1

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 (67) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +89 -0
  3. package/dist/client/graphql/mutations.d.ts +11 -0
  4. package/dist/client/graphql/mutations.d.ts.map +1 -0
  5. package/dist/client/graphql/mutations.js +315 -0
  6. package/dist/client/graphql/mutations.js.map +1 -0
  7. package/dist/client/graphql/queries.d.ts +15 -0
  8. package/dist/client/graphql/queries.d.ts.map +1 -0
  9. package/dist/client/graphql/queries.js +692 -0
  10. package/dist/client/graphql/queries.js.map +1 -0
  11. package/dist/client/jupiterone-client.d.ts +106 -0
  12. package/dist/client/jupiterone-client.d.ts.map +1 -0
  13. package/dist/client/jupiterone-client.js +137 -0
  14. package/dist/client/jupiterone-client.js.map +1 -0
  15. package/dist/client/services/account-service.d.ts +17 -0
  16. package/dist/client/services/account-service.d.ts.map +1 -0
  17. package/dist/client/services/account-service.js +37 -0
  18. package/dist/client/services/account-service.js.map +1 -0
  19. package/dist/client/services/alert-service.d.ts +15 -0
  20. package/dist/client/services/alert-service.d.ts.map +1 -0
  21. package/dist/client/services/alert-service.js +56 -0
  22. package/dist/client/services/alert-service.js.map +1 -0
  23. package/dist/client/services/dashboard-service.d.ts +123 -0
  24. package/dist/client/services/dashboard-service.d.ts.map +1 -0
  25. package/dist/client/services/dashboard-service.js +74 -0
  26. package/dist/client/services/dashboard-service.js.map +1 -0
  27. package/dist/client/services/integration-service.d.ts +45 -0
  28. package/dist/client/services/integration-service.d.ts.map +1 -0
  29. package/dist/client/services/integration-service.js +114 -0
  30. package/dist/client/services/integration-service.js.map +1 -0
  31. package/dist/client/services/j1ql-service.d.ts +21 -0
  32. package/dist/client/services/j1ql-service.d.ts.map +1 -0
  33. package/dist/client/services/j1ql-service.js +29 -0
  34. package/dist/client/services/j1ql-service.js.map +1 -0
  35. package/dist/client/services/rule-service.d.ts +61 -0
  36. package/dist/client/services/rule-service.d.ts.map +1 -0
  37. package/dist/client/services/rule-service.js +140 -0
  38. package/dist/client/services/rule-service.js.map +1 -0
  39. package/dist/descriptions/create-dashboard-widget.md +325 -0
  40. package/dist/descriptions/create-dashboard.md +12 -0
  41. package/dist/descriptions/create-inline-question-rule.md +357 -0
  42. package/dist/descriptions/create-j1ql-from-natural-language.md +7 -0
  43. package/dist/descriptions/execute-j1ql-query.md +426 -0
  44. package/dist/descriptions/list-alerts.md +14 -0
  45. package/dist/descriptions/list-rules.md +14 -0
  46. package/dist/descriptions/update-dashboard.md +467 -0
  47. package/dist/index.d.ts +3 -0
  48. package/dist/index.d.ts.map +1 -0
  49. package/dist/index.js +48 -0
  50. package/dist/index.js.map +1 -0
  51. package/dist/server/mcp-server.d.ts +10 -0
  52. package/dist/server/mcp-server.d.ts.map +1 -0
  53. package/dist/server/mcp-server.js +1496 -0
  54. package/dist/server/mcp-server.js.map +1 -0
  55. package/dist/types/jupiterone.d.ts +752 -0
  56. package/dist/types/jupiterone.d.ts.map +1 -0
  57. package/dist/types/jupiterone.js +2 -0
  58. package/dist/types/jupiterone.js.map +1 -0
  59. package/dist/utils/description-loader.d.ts +2 -0
  60. package/dist/utils/description-loader.d.ts.map +1 -0
  61. package/dist/utils/description-loader.js +14 -0
  62. package/dist/utils/description-loader.js.map +1 -0
  63. package/dist/utils/load-description.d.ts +2 -0
  64. package/dist/utils/load-description.d.ts.map +1 -0
  65. package/dist/utils/load-description.js +9 -0
  66. package/dist/utils/load-description.js.map +1 -0
  67. package/package.json +64 -0
@@ -0,0 +1,426 @@
1
+ # JupiterOne J1QL Query Executor
2
+
3
+ **Purpose**: Executes JupiterOne Query Language (J1QL) queries against your JupiterOne data and returns the results. This tool is used to directly run J1QL queries that have been created, either manually or through the natural language converter.
4
+
5
+ This tool should be used when:
6
+ - You need to validate the data of a query
7
+ - You need to get results from a previously generated query
8
+ - You want to test a query before using it in a rule or widget
9
+ - You need to analyze data directly using J1QL
10
+
11
+ The tool supports various query parameters including:
12
+ - Including/excluding deleted entities
13
+ - Returning row metadata
14
+ - Returning computed properties
15
+ - Applying scope filters
16
+ - Pagination using cursors
17
+
18
+ ### JupiterOne Query Language (J1QL) Guide for AI Agents
19
+
20
+ > **CRITICAL:** Follow this guide strictly. Any deviation may result in query failure. Do not use operators not documented here.
21
+
22
+ #### Core Concepts
23
+
24
+ **Entity and Relationship Structure**
25
+ - **Entities**: Assets in your environment with specific classes and types
26
+ - **Entity Class**: Always `TitleCase` (e.g., `User`, `Host`, `Application`)
27
+ - **Entity Type**: Always `snake_case` (e.g., `aws_iam_user`, `github_user`)
28
+ - **Relationships**: Connections between entities
29
+ - **Relationship Class**: Always `ALLCAPS` (e.g., `HAS`, `USES`, `PROTECTS`)
30
+ - **Default Returns**: Queries return the first entity after FIND unless explicitly modified with RETURN
31
+ - **Unified Entities**: Deduplicated repersentation of assets seen in JupiterOne have a `_type: unified_entity`
32
+
33
+ #### Unified Entities
34
+
35
+ Unified entities are the deduplicated "real-world" repersentation of data seen by JupiterOne. All Unified entities have a `_type = unified_entity`, and this is often the entity the user wants referenced.
36
+
37
+ Unified Entities currently supported:
38
+ - **UnifiedDevice**: Deduplicated representation of devices in the inventory
39
+ - **UnifiedIdentity**: Deduplicated representation of identities in the inventory
40
+ - **UnifiedVulnerability**: Deduplicated representation of vulnerabilities in the inventory
41
+
42
+ Unified entities typically also have additional enrichment making them valuable assets to search off of or reference back to. Unified entities only have relationships to the entities that they deduplicate, and you need to query off of their source components to get more context - for example a list of all devices related to users would look like:
43
+
44
+ ```
45
+ FIND UnifiedIdentity AS identity
46
+ THAT IS << User
47
+ THAT RELATES TO AS rel (Device|Host)
48
+ THAT IS >> UnifiedDevice AS device
49
+ RETURN identity.displayName, rel._class, device.displayName
50
+ ```
51
+
52
+ **IMPORTANT**: Whenever answering questions about entities that have a unified entity representation, answer the question in terms of unified entities.
53
+
54
+ #### MANDATORY Query Structure
55
+
56
+ ```
57
+ FIND <entity> [WITH <property_filter>] [AS <alias>]
58
+ [THAT <relationship> [<direction>] <entity> [WITH <property_filter>] [AS <alias>]]
59
+ [WHERE <condition>]
60
+ [RETURN <field_selection>]
61
+ [ORDER BY <field>]
62
+ [SKIP <number>]
63
+ [LIMIT <number>]
64
+ ```
65
+
66
+ #### ⚠️ CRITICAL SYNTAX RULES ⚠️ ALL QUERIES MUST ADHERE TO THESE RULES
67
+
68
+ 1. **Alias Placement**: Aliases MUST follow the WITH statement when filtering
69
+ ✅ `FIND Device WITH name~='TEST' AS dev`
70
+ ❌ `FIND Device AS dev WITH name~='TEST'`
71
+
72
+ 2. **String Values**: ALWAYS use single quotes for strings, NEVER double quotes
73
+ ✅ `name ~= 'john'`
74
+ ❌ `name ~= "john"`
75
+
76
+ 3. **WITH vs WHERE**: Use WITH for entity properties, WHERE only for relationship properties or cross-entity comparisons
77
+ ✅ `FIND User WITH active = true`
78
+ ✅ `FIND User AS u THAT HAS Device AS d WHERE u.active = true AND d.platform = 'darwin'`
79
+ ❌ `FIND User WHERE active = true`
80
+
81
+ 4. **LIMIT Usage**: ALWAYS include LIMIT (5-100) or use COUNT for discovery
82
+ ✅ `FIND User LIMIT 50`
83
+ ✅ `FIND User AS u RETURN u._type, count(u)`
84
+ ❌ `FIND User` (no limit specified)
85
+
86
+ 5. **Relationship Direction**: Direction arrows MUST follow the relationship verb
87
+ ✅ `FIND User THAT HAS >> Device`
88
+ ❌ `FIND User THAT >> HAS Device`
89
+
90
+ 6. **Optional Traversals**: Use parentheses and question mark
91
+ ✅ `FIND User AS u (THAT IS Person AS p)?`
92
+ ❌ `FIND User AS u THAT IS? Person AS p`
93
+
94
+ 7. **Using Aggregates For Discovery**: Alias COUNT and use ORDER BY
95
+ ✅ `FIND * AS ent RETURN ent._class, COUNT(ent) AS cnt ORDER BY cnt DESC LIMIT 50`
96
+ ❌ `FIND * AS ent RETURN ent._class, COUNT(ent) LIMIT 50`
97
+
98
+ #### Entity Selection
99
+
100
+ **Finding by class or type**:
101
+ ```j1ql
102
+ FIND User LIMIT 10 # Find entities with _class = 'User'
103
+ FIND aws_iam_user LIMIT 10 # Find entities with _type = 'aws_iam_user'
104
+ FIND * WITH _type='aws_instance' LIMIT 10 # Filter any entity by type
105
+ ```
106
+
107
+ **Finding multiple entity types**:
108
+ ```j1ql
109
+ FIND (User | Host) LIMIT 10 # Find entities with _class = 'User' OR _class = 'Host'
110
+ ```
111
+
112
+ #### Property Filtering (WITH)
113
+
114
+ **Basic property filtering**:
115
+ ```j1ql
116
+ FIND User WITH active = true LIMIT 10
117
+ FIND DataStore WITH encrypted = false LIMIT 10
118
+ ```
119
+
120
+ **WITH filtering with alias** (CORRECT ORDER):
121
+ ```j1ql
122
+ FIND User WITH active = true AS u LIMIT 10
123
+ FIND DataStore WITH encrypted = false AS ds LIMIT 10
124
+ ```
125
+
126
+ **WITH filtering with alias AND Advanced fiiltering** (CORRECT ORDER):
127
+ ```j1ql
128
+ FIND User WITH accountCount > 0 AS u RETURN u.displayName
129
+ FIND DataStore WITH name~='ROOT' OR name=/iam/i AS ds RETURN ds.name, ds.encrypted LIMIT 10
130
+ ```
131
+
132
+ **Multiple property filters**:
133
+ ```j1ql
134
+ FIND User WITH active = true AND mfaEnabled = false LIMIT 10
135
+ FIND Host WITH platform = 'darwin' OR platform = 'linux' LIMIT 10
136
+ ```
137
+
138
+ **Multiple value matching**:
139
+ ```j1ql
140
+ FIND Host WITH platform = ('darwin' OR 'linux') LIMIT 10
141
+ ```
142
+
143
+ **Property existence check**:
144
+ ```j1ql
145
+ FIND DataStore WITH encrypted = undefined LIMIT 10
146
+ ```
147
+
148
+ **Special character property names**:
149
+ ```j1ql
150
+ FIND Host WITH [tag.special-name] = 'value' LIMIT 10
151
+ ```
152
+
153
+ #### String Comparisons
154
+
155
+ J1QL comparison operators:
156
+ - `=` : equals (exact match)
157
+ - `!=` : not equals
158
+ - `~=` : contains
159
+ - `^=` : starts with
160
+ - `$=` : ends with
161
+ - `!~=` : does not contain
162
+ - `!^=` : does not start with
163
+ - `!$=` : does not end with
164
+
165
+ ```j1ql
166
+ FIND User WITH username ~= 'john' LIMIT 10
167
+ FIND Host WITH name ^= 'web' LIMIT 10
168
+ ```
169
+
170
+ #### Case-Insensitive Matching (Regex)
171
+
172
+ ```j1ql
173
+ FIND User WITH username=/john/ LIMIT 10 # Case-insensitive match
174
+ ```
175
+
176
+ #### Traversing Relationships (THAT)
177
+
178
+ ## Important: Don't assume relationship VERBS, either do discovery to determine the correct relationship or use the wild card relationship "THAT RELATES TO"
179
+
180
+ **Any relationship traversal (i.e. wildcard)**:
181
+ ```j1ql
182
+ FIND User THAT RELATES TO Application LIMIT 10
183
+ ```
184
+
185
+ **Basic traversal**:
186
+ ```j1ql
187
+ FIND User THAT HAS Device LIMIT 10
188
+ ```
189
+
190
+ **Multiple traversal steps**:
191
+ ```j1ql
192
+ FIND User THAT HAS Device THAT INSTALLED Application LIMIT 10
193
+ ```
194
+
195
+ **Multi-step traversal with filtering**:
196
+ ```j1ql
197
+ FIND User WITH active = true THAT HAS Device THAT INSTALLED Application WITH vendor = 'Microsoft' LIMIT 10
198
+ ```
199
+
200
+ **Multiple relationship types**:
201
+ ```j1ql
202
+ FIND HostAgent THAT (MONITORS|PROTECTS) Host LIMIT 10
203
+ ```
204
+
205
+ **Negating relationships**:
206
+ ```j1ql
207
+ FIND User THAT !HAS Device LIMIT 10 # Find users that don't have devices
208
+ ```
209
+
210
+ **Relationship direction** (arrows MUST follow relationship):
211
+ ```j1ql
212
+ FIND User THAT HAS >> Device LIMIT 10 # Direction from User to Device
213
+ FIND Device THAT HAS << User LIMIT 10 # Direction from User to Device
214
+ ```
215
+
216
+ #### Using Aliases (AS) - ALWAYS AFTER WITH CLAUSE
217
+
218
+ ```j1ql
219
+ FIND User WITH active = true AS u
220
+ THAT HAS AS relationship Device WITH platform = 'darwin' AS d
221
+ RETURN u._type, relationship._class, d._type, COUNT(relationship)
222
+ LIMIT 10
223
+ ```
224
+
225
+ #### Post-Traversal Filtering (WHERE) - ONLY FOR RELATIONSHIPS OR CROSS-ENTITY COMPARISON
226
+
227
+ **Example of filtering on relationship properties**
228
+ ```j1ql
229
+ FIND Firewall AS fw
230
+ THAT ALLOWS AS rule * AS n
231
+ WHERE rule.ingress = true
232
+ LIMIT 10
233
+ ```
234
+
235
+ ```j1ql
236
+ FIND User AS u
237
+ THAT HAS Device AS d
238
+ WHERE u.active = true AND d.platform = 'darwin'
239
+ LIMIT 10
240
+ ```
241
+
242
+ #### Selecting Return Values (RETURN)
243
+
244
+ ```j1ql
245
+ FIND User AS u
246
+ THAT HAS Device AS d
247
+ RETURN u.username, d.name
248
+ LIMIT 10
249
+ ```
250
+
251
+ Return all properties:
252
+ ```j1ql
253
+ FIND User AS u RETURN u.* LIMIT 10
254
+ ```
255
+
256
+ #### Aggregation Functions (USE FOR DISCOVERY)
257
+
258
+ Available aggregations:
259
+ - `count(selector)`
260
+ - `min(selector.field)`
261
+ - `max(selector.field)`
262
+ - `avg(selector.field)`
263
+ - `sum(selector.field)`
264
+
265
+ ```j1ql
266
+ # Basic count
267
+ FIND User AS u RETURN count(u)
268
+
269
+ # Group by with count
270
+ FIND User AS u RETURN u._type, count(u)
271
+
272
+ # Multiple aggregations
273
+ FIND Account AS acct THAT HAS User AS user
274
+ RETURN acct.name, count(user), avg(user.lastLoginOn)
275
+ ```
276
+
277
+ #### Date Comparisons
278
+
279
+ ```j1ql
280
+ FIND User WITH createdOn > date.now - 7 days LIMIT 10
281
+ ```
282
+
283
+ Supported units: `hour(s)`, `day(s)`, `month(s)`, `year(s)`
284
+
285
+ #### Math Operations
286
+
287
+ ```j1ql
288
+ FIND aws_instance AS i
289
+ RETURN i.name, i.memorySize * 0.001 AS memoryGB
290
+ LIMIT 10
291
+ ```
292
+
293
+ #### Sorting and Pagination
294
+
295
+ ```j1ql
296
+ FIND User AS u
297
+ ORDER BY u.username
298
+ SKIP 10
299
+ LIMIT 5
300
+ ```
301
+
302
+ #### Optional Traversals (PROPER SYNTAX)
303
+
304
+ ```j1ql
305
+ FIND User AS u
306
+ (THAT IS Person AS p)?
307
+ THAT HAS Device AS d
308
+ LIMIT 10
309
+ ```
310
+
311
+ Optional traversal with property access:
312
+ ```j1ql
313
+ FIND User AS u
314
+ (THAT IS Person AS p)?
315
+ THAT HAS Device AS d
316
+ RETURN u.username, p.email, d.name
317
+ LIMIT 10
318
+ ```
319
+
320
+ #### Discovery Techniques (ALWAYS USE THESE FIRST)
321
+
322
+ FIRST:
323
+ **Identify entity classes and counts**:
324
+ ```j1ql
325
+ FIND * AS ent RETURN ent._class, COUNT(ent)
326
+ ```
327
+
328
+ SECOND:
329
+ **Discover properties on an entity**:
330
+ ```j1ql
331
+ FIND User AS ent RETURN ent.* LIMIT 100
332
+ ```
333
+
334
+ THIRD:
335
+ **Find how entities are related**:
336
+ ```j1ql
337
+ FIND User THAT RELATES TO AS rel * AS ent RETURN rel._class, ent._type, COUNT(ent)
338
+ ```
339
+
340
+ FORTH:
341
+ **Discover property values**:
342
+ ```j1ql
343
+ FIND User AS ent RETURN ent.status, COUNT(ent)
344
+ ```
345
+
346
+ ADDITIONAL:
347
+
348
+ **Identify properties on related entities**:
349
+ ```j1ql
350
+ FIND User THAT RELATES TO Device AS ent RETURN ent.* LIMIT 100
351
+ ```
352
+
353
+ **Find related entity types**:
354
+ ```j1ql
355
+ FIND User THAT RELATES TO * AS ent RETURN ent._type, COUNT(ent)
356
+ ```
357
+
358
+ **Identify relationship classes**:
359
+ ```j1ql
360
+ FIND User THAT RELATES TO AS rel * AS ent RETURN rel._class, ent._type, COUNT(ent)
361
+ ```
362
+
363
+ #### ⚠️ QUERY VALIDATION CHECKLIST ⚠️
364
+
365
+ Before running any J1QL query, verify:
366
+
367
+ 1. ✓ FIND statement specifies entity class or type
368
+ 2. ✓ All string values use single quotes, not double quotes
369
+ 3. ✓ Aliases are placed AFTER the WITH statement
370
+ 4. ✓ All queries include either LIMIT or use COUNT aggregation
371
+ 5. ✓ WITH is used for entity properties, WHERE only for relationship properties or cross-entity comparisons
372
+ 6. ✓ Direction arrows (>> or <<) are placed after relationship verbs
373
+ 7. ✓ Optional traversals use proper parentheses and question mark syntax
374
+ 8. ✓ All aliases referenced in RETURN or WHERE are properly defined earlier
375
+
376
+ #### Common Errors to Avoid
377
+
378
+ 1. **Syntax Errors**:
379
+ - ❌ Using LIKE comparison (use ~= instead)
380
+ - ❌ Using IS to test for undefined (use property=undefined instead)
381
+ - ❌ Placing alias before WITH statement
382
+ - ❌ Using double quotes for strings
383
+ - ❌ Missing LIMIT clause
384
+
385
+ 2. **Structure Errors**:
386
+ - ❌ Using WHERE for basic entity filtering
387
+ - ❌ Incorrectly placing direction arrows
388
+ - ❌ Referencing undefined aliases
389
+ - ❌ Using improper optional traversal syntax
390
+
391
+ 3. **No Results**
392
+ - ❌ No results may be expected, validate with the context of the query
393
+ - ❌ Use wildcard relationship (i.e. THAT RELATES TO)
394
+ - ❌ Confirm the property being filtered exists
395
+ - ❌ Confirm the value being used for the filtered property exists
396
+ - ❌ Never assume _type, _class, relationship verbs or properties, only use what has been found in discovery
397
+
398
+ #### Query Development Process
399
+
400
+ 1. **Start with discovery queries** to understand the data model:
401
+ ```j1ql
402
+ FIND * AS ent RETURN ent._class, COUNT(ent)
403
+ ```
404
+
405
+ 2. **Examine specific entity properties**:
406
+ ```j1ql
407
+ FIND User AS ent RETURN ent.* LIMIT 100
408
+ ```
409
+
410
+ 3. **Determine what and how the entity relates to other entities**:
411
+ ```j1ql
412
+ FIND User THAT RELATES TO AS rel * AS ent RETURN rel._class, ent._type, COUNT(ent)
413
+ ```
414
+
415
+ 4. **Incrementally build complexity**:
416
+ - Start with basic entity queries
417
+ - Add property filters
418
+ - Add relationship traversals
419
+ - Add specific return fields
420
+ - Add aggregations if needed
421
+ - Rinse and repeat until you have a query doing what you need
422
+ - IMPORTANT: Don't assume _type, _class, relationship verbs or properties, only use values found during discovery!
423
+
424
+ 5. **Troubleshoot by simplifying** - if a complex query fails, break it into smaller parts
425
+
426
+ By following these strict guide `plines, AI agents can effectively create valid J1QL queries that provide accurate security insights across the organization's digital environment.
@@ -0,0 +1,14 @@
1
+ # List Alerts Tool
2
+
3
+ List all currently active alerts in your JupiterOne account. This tool returns a list of active alert instances, including their IDs, names, descriptions, levels, statuses, timestamps, and related rule information. You can optionally specify a limit to restrict the number of alerts returned. If a user is looking for configuration behind an alert, then list out the rules or get the details of the rule associated with an alert. If they are looking for alert data or then use this tool rather than listing rules.
4
+
5
+ ## Parameters
6
+ - `limit` (optional): Maximum number of alerts to return (between 1 and 1000).
7
+
8
+ ## Example Usage
9
+ Request the first 5 active alerts:
10
+ ```json
11
+ {
12
+ "limit": 5
13
+ }
14
+ ```
@@ -0,0 +1,14 @@
1
+ # List Rules Tool
2
+
3
+ List all rules in your JupiterOne account. This tool returns a list of rule instances, including their IDs, names, descriptions, versions, polling intervals, and other metadata. You can optionally specify a limit to restrict the number of rules returned. This does not get alerts, but rather the configuration behind what may generate an alert, or other workflow action.
4
+
5
+ ## Parameters
6
+ - `limit` (optional): Maximum number of rules to return (between 1 and 1000).
7
+
8
+ ## Example Usage
9
+ Request the first 10 rules:
10
+ ```json
11
+ {
12
+ "limit": 10
13
+ }
14
+ ```