@graphite-atlas/mcp-server 1.2.2 → 1.3.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/dist/client.js +1 -1
- package/dist/index.js +16 -1
- package/dist/index.js.map +1 -1
- package/dist/prompts.d.ts +32 -0
- package/dist/prompts.d.ts.map +1 -0
- package/dist/prompts.js +75 -0
- package/dist/prompts.js.map +1 -0
- package/dist/tools/query.d.ts.map +1 -1
- package/dist/tools/query.js +5 -6
- 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.3",
|
|
16
16
|
"X-Graphite-Source": "mcp",
|
|
17
17
|
},
|
|
18
18
|
timeout: 30000, // 30 second timeout
|
package/dist/index.js
CHANGED
|
@@ -14,9 +14,10 @@
|
|
|
14
14
|
*/
|
|
15
15
|
import { Server } from '@modelcontextprotocol/sdk/server/index.js';
|
|
16
16
|
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
|
|
17
|
-
import { CallToolRequestSchema, ListToolsRequestSchema, } from '@modelcontextprotocol/sdk/types.js';
|
|
17
|
+
import { CallToolRequestSchema, ListToolsRequestSchema, ListPromptsRequestSchema, GetPromptRequestSchema, } from '@modelcontextprotocol/sdk/types.js';
|
|
18
18
|
import { GraphiteAtlasClient } from './client.js';
|
|
19
19
|
import { setupTools } from './tools/index.js';
|
|
20
|
+
import { PROMPTS, getPromptMessages } from './prompts.js';
|
|
20
21
|
// Server configuration
|
|
21
22
|
const SERVER_NAME = 'graphite-atlas';
|
|
22
23
|
const SERVER_VERSION = '1.0.0';
|
|
@@ -199,6 +200,7 @@ async function main() {
|
|
|
199
200
|
}, {
|
|
200
201
|
capabilities: {
|
|
201
202
|
tools: {},
|
|
203
|
+
prompts: {},
|
|
202
204
|
},
|
|
203
205
|
instructions: SERVER_INSTRUCTIONS,
|
|
204
206
|
});
|
|
@@ -252,6 +254,19 @@ async function main() {
|
|
|
252
254
|
};
|
|
253
255
|
}
|
|
254
256
|
});
|
|
257
|
+
// Handle prompt listing
|
|
258
|
+
server.setRequestHandler(ListPromptsRequestSchema, async () => {
|
|
259
|
+
return await Promise.resolve({ prompts: PROMPTS });
|
|
260
|
+
});
|
|
261
|
+
// Handle prompt retrieval
|
|
262
|
+
server.setRequestHandler(GetPromptRequestSchema, async (request) => {
|
|
263
|
+
const { name, arguments: args } = request.params;
|
|
264
|
+
const messages = getPromptMessages(name, args);
|
|
265
|
+
if (!messages) {
|
|
266
|
+
throw new Error(`Unknown prompt: ${name}`);
|
|
267
|
+
}
|
|
268
|
+
return await Promise.resolve({ messages });
|
|
269
|
+
});
|
|
255
270
|
// Start server with stdio transport
|
|
256
271
|
const transport = new StdioServerTransport();
|
|
257
272
|
await server.connect(transport);
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AACnE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EACL,qBAAqB,EACrB,sBAAsB,GACvB,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2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,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AAC3E,CAAC;AAED,aAAa;AACb,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;IACrB,OAAO,CAAC,KAAK,CAAC,cAAc,EAAE,KAAK,CAAC,CAAC;IACrC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MCP Prompts for Graphite Atlas
|
|
3
|
+
*
|
|
4
|
+
* Prompts are user-invocable slash commands that inject structured
|
|
5
|
+
* instructions into the conversation. They trigger workflows that
|
|
6
|
+
* use the existing Atlas tools.
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* Prompt definitions exposed via prompts/list
|
|
10
|
+
*/
|
|
11
|
+
export declare const PROMPTS: {
|
|
12
|
+
name: string;
|
|
13
|
+
title: string;
|
|
14
|
+
description: string;
|
|
15
|
+
arguments: {
|
|
16
|
+
name: string;
|
|
17
|
+
description: string;
|
|
18
|
+
required: boolean;
|
|
19
|
+
}[];
|
|
20
|
+
}[];
|
|
21
|
+
/**
|
|
22
|
+
* Get prompt messages for a given prompt name and arguments.
|
|
23
|
+
* Returns null if the prompt name is not recognized.
|
|
24
|
+
*/
|
|
25
|
+
export declare function getPromptMessages(name: string, args?: Record<string, string>): Array<{
|
|
26
|
+
role: 'user' | 'assistant';
|
|
27
|
+
content: {
|
|
28
|
+
type: 'text';
|
|
29
|
+
text: string;
|
|
30
|
+
};
|
|
31
|
+
}> | null;
|
|
32
|
+
//# sourceMappingURL=prompts.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prompts.d.ts","sourceRoot":"","sources":["../src/prompts.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH;;GAEG;AACH,eAAO,MAAM,OAAO;;;;;;;;;GAcnB,CAAC;AAEF;;;GAGG;AACH,wBAAgB,iBAAiB,CAC/B,IAAI,EAAE,MAAM,EACZ,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAC5B,KAAK,CAAC;IAAE,IAAI,EAAE,MAAM,GAAG,WAAW,CAAC;IAAC,OAAO,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAA;CAAE,CAAC,GAAG,IAAI,CAOvF"}
|
package/dist/prompts.js
ADDED
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MCP Prompts for Graphite Atlas
|
|
3
|
+
*
|
|
4
|
+
* Prompts are user-invocable slash commands that inject structured
|
|
5
|
+
* instructions into the conversation. They trigger workflows that
|
|
6
|
+
* use the existing Atlas tools.
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* Prompt definitions exposed via prompts/list
|
|
10
|
+
*/
|
|
11
|
+
export const PROMPTS = [
|
|
12
|
+
{
|
|
13
|
+
name: 'mapit',
|
|
14
|
+
title: 'Map to Atlas',
|
|
15
|
+
description: 'Extract business concepts from the conversation and model them in your Atlas knowledge graph. Proposes points, paths, and view assignments for your approval before committing.',
|
|
16
|
+
arguments: [
|
|
17
|
+
{
|
|
18
|
+
name: 'atlas_id',
|
|
19
|
+
description: 'The atlas to commit to. Use list_atlases to find available atlases.',
|
|
20
|
+
required: true,
|
|
21
|
+
},
|
|
22
|
+
],
|
|
23
|
+
},
|
|
24
|
+
];
|
|
25
|
+
/**
|
|
26
|
+
* Get prompt messages for a given prompt name and arguments.
|
|
27
|
+
* Returns null if the prompt name is not recognized.
|
|
28
|
+
*/
|
|
29
|
+
export function getPromptMessages(name, args) {
|
|
30
|
+
switch (name) {
|
|
31
|
+
case 'mapit':
|
|
32
|
+
return getMapitMessages(args?.atlas_id);
|
|
33
|
+
default:
|
|
34
|
+
return null;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
function getMapitMessages(atlasId) {
|
|
38
|
+
const atlasContext = atlasId
|
|
39
|
+
? `The target atlas ID is: ${atlasId}`
|
|
40
|
+
: 'Ask the user which atlas to commit to, or use list_atlases to find available atlases.';
|
|
41
|
+
return [
|
|
42
|
+
{
|
|
43
|
+
role: 'user',
|
|
44
|
+
content: {
|
|
45
|
+
type: 'text',
|
|
46
|
+
text: `Map the business concepts we just discussed to my Atlas knowledge graph.
|
|
47
|
+
|
|
48
|
+
${atlasContext}
|
|
49
|
+
|
|
50
|
+
Follow these steps:
|
|
51
|
+
|
|
52
|
+
1. EXTRACT — Review our conversation and identify business entities (people, organizations, processes, systems, products, etc.) and how they relate to each other.
|
|
53
|
+
|
|
54
|
+
2. VERIFY TYPES — Use \`lookup_ontology\` to confirm valid point types and path types for everything you plan to create. Never guess a type.
|
|
55
|
+
|
|
56
|
+
3. CHECK DUPLICATES — Use \`find_similar_points\` for each proposed point to avoid creating duplicates. Reference existing points by name instead of recreating them.
|
|
57
|
+
|
|
58
|
+
4. CHECK VIEWS — Use \`list_views\` and \`get_view_hierarchy\` to find existing views where these points belong. If no existing view fits, propose a new one.
|
|
59
|
+
|
|
60
|
+
5. PRESENT THE PLAN — Show me:
|
|
61
|
+
- **New points** to create (name, type, description)
|
|
62
|
+
- **Existing points** that will be referenced (name, type)
|
|
63
|
+
- **New paths** to create (source → type → target)
|
|
64
|
+
- **View assignments** — which view(s) to add the new points to, or a new view to create
|
|
65
|
+
|
|
66
|
+
6. WAIT FOR APPROVAL — Do not create anything until I confirm. I may correct domain details.
|
|
67
|
+
|
|
68
|
+
7. EXECUTE — After I approve, use \`batch_create\` to create all points and paths. Then use \`add_points_to_view\` to organize them into the right view(s).
|
|
69
|
+
|
|
70
|
+
Keep descriptions factual and specific. Put metadata (status, aliases, dates) in the description field. Present the plan clearly so I can review it at a glance.`,
|
|
71
|
+
},
|
|
72
|
+
},
|
|
73
|
+
];
|
|
74
|
+
}
|
|
75
|
+
//# sourceMappingURL=prompts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prompts.js","sourceRoot":"","sources":["../src/prompts.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH;;GAEG;AACH,MAAM,CAAC,MAAM,OAAO,GAAG;IACrB;QACE,IAAI,EAAE,OAAO;QACb,KAAK,EAAE,cAAc;QACrB,WAAW,EACT,iLAAiL;QACnL,SAAS,EAAE;YACT;gBACE,IAAI,EAAE,UAAU;gBAChB,WAAW,EAAE,qEAAqE;gBAClF,QAAQ,EAAE,IAAI;aACf;SACF;KACF;CACF,CAAC;AAEF;;;GAGG;AACH,MAAM,UAAU,iBAAiB,CAC/B,IAAY,EACZ,IAA6B;IAE7B,QAAQ,IAAI,EAAE,CAAC;QACb,KAAK,OAAO;YACV,OAAO,gBAAgB,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;QAC1C;YACE,OAAO,IAAI,CAAC;IAChB,CAAC;AACH,CAAC;AAED,SAAS,gBAAgB,CAAC,OAAgB;IACxC,MAAM,YAAY,GAAG,OAAO;QAC1B,CAAC,CAAC,2BAA2B,OAAO,EAAE;QACtC,CAAC,CAAC,uFAAuF,CAAC;IAE5F,OAAO;QACL;YACE,IAAI,EAAE,MAAe;YACrB,OAAO,EAAE;gBACP,IAAI,EAAE,MAAe;gBACrB,IAAI,EAAE;;EAEZ,YAAY;;;;;;;;;;;;;;;;;;;;;;iKAsBmJ;aAC1J;SACF;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -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,CA4GvE"}
|
package/dist/tools/query.js
CHANGED
|
@@ -51,7 +51,7 @@ Cypher labels (used in MATCH patterns):
|
|
|
51
51
|
- :Class — ontology type definitions (internal, rarely needed)
|
|
52
52
|
|
|
53
53
|
Cypher relationship types (used in path patterns):
|
|
54
|
-
- :PATH — all paths between points (has_role, reports_to, has_step, etc.). The specific path type is stored in the '
|
|
54
|
+
- :PATH — all paths between points (has_role, reports_to, has_step, etc.). The specific path type is stored in the 'name' property (not 'type'), NOT as a separate Cypher type.
|
|
55
55
|
- :CONTAINS — structural link from Atlas to its Points (every point belongs to an atlas)
|
|
56
56
|
- :INSTANCE_OF — links a Point to its ontology Class (internal, rarely needed)
|
|
57
57
|
|
|
@@ -72,8 +72,7 @@ Point properties:
|
|
|
72
72
|
|
|
73
73
|
Path properties:
|
|
74
74
|
- id (string) — unique identifier
|
|
75
|
-
-
|
|
76
|
-
- name (string) — same as type
|
|
75
|
+
- name (string) — path type from ontology (has_role, reports_to, followed_by, etc.). NOTE: the path type is in 'name', not 'type'.
|
|
77
76
|
- description (string, optional) — context for this specific path
|
|
78
77
|
- properties (JSON string, optional) — arbitrary key-value pairs
|
|
79
78
|
- createdAt, updatedAt, deletedAt — same as points
|
|
@@ -81,7 +80,7 @@ Path properties:
|
|
|
81
80
|
IMPORTANT PATTERNS:
|
|
82
81
|
- Always scope to the atlas: MATCH (p:Point {atlasId: $atlasId})
|
|
83
82
|
- Always exclude soft-deleted: WHERE p.deletedAt IS NULL
|
|
84
|
-
- Filter paths by type: WHERE r.
|
|
83
|
+
- Filter paths by type: WHERE r.name = 'has_role'
|
|
85
84
|
- The standard traversal: MATCH (a:Atlas {id: $atlasId})-[:CONTAINS]->(p:Point)
|
|
86
85
|
- No result size limit is enforced server-side — use LIMIT in your queries to avoid large result sets
|
|
87
86
|
|
|
@@ -91,10 +90,10 @@ Count points by type:
|
|
|
91
90
|
MATCH (p:Point {atlasId: $atlasId}) WHERE p.deletedAt IS NULL RETURN p.type as type, count(p) as count ORDER BY count DESC
|
|
92
91
|
|
|
93
92
|
Find people and their roles:
|
|
94
|
-
MATCH (p:Point {atlasId: $atlasId, type: 'Person'})-[r:PATH {
|
|
93
|
+
MATCH (p:Point {atlasId: $atlasId, type: 'Person'})-[r:PATH {name: 'has_role'}]->(pos:Point {type: 'Position'}) WHERE p.deletedAt IS NULL RETURN p.name as person, pos.name as role
|
|
95
94
|
|
|
96
95
|
Walk a process step by step:
|
|
97
|
-
MATCH (proc:Point {atlasId: $atlasId, type: 'Process', name: 'Monthly Close'})-[h:PATH {
|
|
96
|
+
MATCH (proc:Point {atlasId: $atlasId, type: 'Process', name: 'Monthly Close'})-[h:PATH {name: 'has_step'}]->(step:Point) WHERE step.deletedAt IS NULL OPTIONAL MATCH (step)-[f:PATH {name: 'followed_by'}]->(next:Point) RETURN step.name as step, next.name as next_step
|
|
98
97
|
|
|
99
98
|
Multi-hop traversal:
|
|
100
99
|
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`,
|
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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