@graphite-atlas/mcp-server 1.2.0 → 1.2.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.
- package/dist/client.js +1 -1
- package/dist/tools/query.d.ts.map +1 -1
- package/dist/tools/query.js +51 -20
- package/dist/tools/query.js.map +1 -1
- package/package.json +1 -1
package/dist/client.js
CHANGED
|
@@ -12,7 +12,7 @@ export class GraphiteAtlasClient {
|
|
|
12
12
|
headers: {
|
|
13
13
|
Authorization: `Bearer ${config.accessToken}`,
|
|
14
14
|
"Content-Type": "application/json",
|
|
15
|
-
"User-Agent": "graphite-atlas-mcp/1.2.
|
|
15
|
+
"User-Agent": "graphite-atlas-mcp/1.2.1",
|
|
16
16
|
"X-Graphite-Source": "mcp",
|
|
17
17
|
},
|
|
18
18
|
timeout: 30000, // 30 second timeout
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"query.d.ts","sourceRoot":"","sources":["../../src/tools/query.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AACnD,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAoCrC,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,mBAAmB,GAAG,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"query.d.ts","sourceRoot":"","sources":["../../src/tools/query.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AACnD,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAoCrC,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,mBAAmB,GAAG,OAAO,EAAE,CA6GvE"}
|
package/dist/tools/query.js
CHANGED
|
@@ -39,34 +39,65 @@ export function createQueryTools(client) {
|
|
|
39
39
|
name: 'query_cypher',
|
|
40
40
|
description: `Execute a read-only Cypher query against the graph database. Useful for complex traversals, aggregations, and pattern matching that go beyond the standard tools.
|
|
41
41
|
|
|
42
|
-
The atlas_id is automatically injected as the $atlasId parameter
|
|
42
|
+
The atlas_id is automatically injected as the $atlasId parameter — use it in your queries to scope to the correct atlas.
|
|
43
43
|
|
|
44
44
|
Only read-only queries are allowed (MATCH, RETURN, WITH, WHERE, ORDER BY, LIMIT, UNWIND, OPTIONAL MATCH). Write operations (CREATE, MERGE, DELETE, SET) are blocked.
|
|
45
45
|
|
|
46
|
-
|
|
46
|
+
GRAPH SCHEMA:
|
|
47
|
+
|
|
48
|
+
Node labels:
|
|
49
|
+
- :Point — all data nodes (people, processes, systems, etc.)
|
|
50
|
+
- :Atlas — the atlas container node (one per atlas)
|
|
51
|
+
- :Class — schema/ontology type definitions (internal)
|
|
52
|
+
|
|
53
|
+
Edge labels:
|
|
54
|
+
- :PATH — all user-created relationships between points (has_role, reports_to, has_step, etc.). The relationship type is stored in the 'type' property on the edge, NOT as a separate label.
|
|
55
|
+
- :CONTAINS — structural edge from Atlas → Point (every point is linked to its atlas)
|
|
56
|
+
- :INSTANCE_OF — links a Point to its Class definition (internal)
|
|
57
|
+
|
|
58
|
+
Point properties:
|
|
59
|
+
- id (string) — unique identifier
|
|
60
|
+
- name (string) — display name
|
|
61
|
+
- type (string) — ontology type (Person, Process, Step, System, etc.)
|
|
62
|
+
- description (string) — text description
|
|
63
|
+
- category (string, optional) — ontology category (Actor, Action, Resource, etc.)
|
|
64
|
+
- tags (string[], optional) — user-defined tags
|
|
65
|
+
- aliases (string[], optional) — alternate names
|
|
66
|
+
- properties (JSON string) — arbitrary key-value pairs
|
|
67
|
+
- layer (string) — DATA or SCHEMA
|
|
68
|
+
- atlasId (string) — which atlas this belongs to
|
|
69
|
+
- createdAt (string) — ISO timestamp
|
|
70
|
+
- updatedAt (string) — ISO timestamp
|
|
71
|
+
- deletedAt (string, optional) — soft delete timestamp (filter with WHERE p.deletedAt IS NULL)
|
|
47
72
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
73
|
+
PATH (edge) properties:
|
|
74
|
+
- id (string) — unique identifier
|
|
75
|
+
- type (string) — relationship type from ontology (has_role, reports_to, followed_by, etc.)
|
|
76
|
+
- name (string) — same as type
|
|
77
|
+
- description (string, optional) — context for this specific relationship
|
|
78
|
+
- properties (JSON string, optional) — arbitrary key-value pairs
|
|
79
|
+
- createdAt, updatedAt, deletedAt — same as points
|
|
80
|
+
|
|
81
|
+
IMPORTANT PATTERNS:
|
|
82
|
+
- Always filter by atlasId: MATCH (p:Point {atlasId: $atlasId})
|
|
83
|
+
- Always exclude soft-deleted: WHERE p.deletedAt IS NULL
|
|
84
|
+
- Filter edges by type: WHERE r.type = 'has_role'
|
|
85
|
+
- The standard traversal: MATCH (a:Atlas {id: $atlasId})-[:CONTAINS]->(p:Point)
|
|
86
|
+
- No result size limit is enforced server-side — use LIMIT in your queries to avoid huge result sets
|
|
87
|
+
|
|
88
|
+
Example queries:
|
|
52
89
|
|
|
53
90
|
Count points by type:
|
|
54
|
-
MATCH (p:Point {atlasId: $atlasId})
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
91
|
+
MATCH (p:Point {atlasId: $atlasId}) WHERE p.deletedAt IS NULL RETURN p.type as type, count(p) as count ORDER BY count DESC
|
|
92
|
+
|
|
93
|
+
Find people and their roles:
|
|
94
|
+
MATCH (p:Point {atlasId: $atlasId, type: 'Person'})-[r:PATH {type: 'has_role'}]->(pos:Point {type: 'Position'}) WHERE p.deletedAt IS NULL RETURN p.name as person, pos.name as role
|
|
58
95
|
|
|
59
|
-
|
|
60
|
-
MATCH
|
|
61
|
-
RETURN p.name, [n IN nodes(path) | n.name] as chain
|
|
62
|
-
LIMIT 20
|
|
96
|
+
Walk a process step by step:
|
|
97
|
+
MATCH (proc:Point {atlasId: $atlasId, type: 'Process', name: 'Monthly Close'})-[h:PATH {type: 'has_step'}]->(step:Point) WHERE step.deletedAt IS NULL OPTIONAL MATCH (step)-[f:PATH {type: 'followed_by'}]->(next:Point) RETURN step.name as step, next.name as next_step
|
|
63
98
|
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
- Aggregations (counts, grouping)
|
|
67
|
-
- Complex filtering
|
|
68
|
-
- Pattern matching across relationship types
|
|
69
|
-
- Any query that would require multiple list/search calls`,
|
|
99
|
+
Multi-hop traversal:
|
|
100
|
+
MATCH path = (p:Point {atlasId: $atlasId, type: 'Person'})-[:PATH*1..3]-(connected:Point) WHERE p.deletedAt IS NULL AND connected.deletedAt IS NULL RETURN p.name, [n IN nodes(path) | n.name] as chain LIMIT 20`,
|
|
70
101
|
inputSchema: {
|
|
71
102
|
type: 'object',
|
|
72
103
|
properties: {
|
package/dist/tools/query.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"query.js","sourceRoot":"","sources":["../../src/tools/query.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;GAEG;AACH,MAAM,oBAAoB,GAAG;IAC3B,QAAQ;IACR,OAAO;IACP,QAAQ;IACR,QAAQ;IACR,KAAK;IACL,QAAQ;IACR,MAAM;IACN,MAAM;IACN,MAAM;IACN,SAAS;CACV,CAAC;AAEF,SAAS,gBAAgB,CAAC,KAAa;IACrC,MAAM,UAAU,GAAG,KAAK,CAAC,WAAW,EAAE,CAAC;IAEvC,KAAK,MAAM,EAAE,IAAI,oBAAoB,EAAE,CAAC;QACtC,+EAA+E;QAC/E,MAAM,KAAK,GAAG,IAAI,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;QACxC,IAAI,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,EAAE,CAAC;YAC3B,OAAO;gBACL,KAAK,EAAE,KAAK;gBACZ,MAAM,EAAE,uCAAuC,EAAE,qFAAqF;aACvI,CAAC;QACJ,CAAC;IACH,CAAC;IAED,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AACzB,CAAC;AAED,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