@g99/lightrag-mcp-server 1.0.2 → 1.0.4
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/index.js +540 -0
- package/package.json +8 -6
- package/wrapper.js +0 -57
package/index.js
ADDED
|
@@ -0,0 +1,540 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* LightRAG MCP Server - Complete Node.js Implementation
|
|
5
|
+
*
|
|
6
|
+
* Model Context Protocol server for LightRAG with 30+ tools
|
|
7
|
+
*
|
|
8
|
+
* Author: Lalit Suryan
|
|
9
|
+
* License: MIT
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
const { Server } = require('@modelcontextprotocol/sdk/server/index.js');
|
|
13
|
+
const { StdioServerTransport } = require('@modelcontextprotocol/sdk/server/stdio.js');
|
|
14
|
+
const {
|
|
15
|
+
CallToolRequestSchema,
|
|
16
|
+
ListToolsRequestSchema,
|
|
17
|
+
} = require('@modelcontextprotocol/sdk/types.js');
|
|
18
|
+
const axios = require('axios');
|
|
19
|
+
|
|
20
|
+
// Environment configuration
|
|
21
|
+
const LIGHTRAG_SERVER_URL = process.env.LIGHTRAG_SERVER_URL || 'http://localhost:9621';
|
|
22
|
+
const LIGHTRAG_API_KEY = process.env.LIGHTRAG_API_KEY || '';
|
|
23
|
+
const LIGHTRAG_WORKSPACE = process.env.LIGHTRAG_WORKSPACE || 'default';
|
|
24
|
+
|
|
25
|
+
// Create HTTP client
|
|
26
|
+
const httpClient = axios.create({
|
|
27
|
+
baseURL: LIGHTRAG_SERVER_URL,
|
|
28
|
+
headers: {
|
|
29
|
+
'Content-Type': 'application/json',
|
|
30
|
+
...(LIGHTRAG_API_KEY && { 'Authorization': `Bearer ${LIGHTRAG_API_KEY}` }),
|
|
31
|
+
'X-Workspace': LIGHTRAG_WORKSPACE
|
|
32
|
+
},
|
|
33
|
+
timeout: 30000
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
// Create MCP server
|
|
37
|
+
const server = new Server(
|
|
38
|
+
{
|
|
39
|
+
name: '@g99/lightrag-mcp-server',
|
|
40
|
+
version: '1.0.4',
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
capabilities: {
|
|
44
|
+
tools: {},
|
|
45
|
+
},
|
|
46
|
+
}
|
|
47
|
+
);
|
|
48
|
+
|
|
49
|
+
// All 30+ Tool definitions
|
|
50
|
+
const tools = [
|
|
51
|
+
// ===== DOCUMENT MANAGEMENT TOOLS (10) =====
|
|
52
|
+
{
|
|
53
|
+
name: 'insert_text',
|
|
54
|
+
description: 'Insert a single text document into LightRAG',
|
|
55
|
+
inputSchema: {
|
|
56
|
+
type: 'object',
|
|
57
|
+
properties: {
|
|
58
|
+
text: { type: 'string', description: 'Text content to insert' },
|
|
59
|
+
description: { type: 'string', description: 'Description of the text' }
|
|
60
|
+
},
|
|
61
|
+
required: ['text']
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
name: 'insert_texts',
|
|
66
|
+
description: 'Insert multiple text documents into LightRAG in batch',
|
|
67
|
+
inputSchema: {
|
|
68
|
+
type: 'object',
|
|
69
|
+
properties: {
|
|
70
|
+
texts: {
|
|
71
|
+
type: 'array',
|
|
72
|
+
description: 'Array of text documents',
|
|
73
|
+
items: {
|
|
74
|
+
type: 'object',
|
|
75
|
+
properties: {
|
|
76
|
+
content: { type: 'string' },
|
|
77
|
+
title: { type: 'string' },
|
|
78
|
+
metadata: { type: 'object' }
|
|
79
|
+
},
|
|
80
|
+
required: ['content']
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
},
|
|
84
|
+
required: ['texts']
|
|
85
|
+
}
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
name: 'upload_document',
|
|
89
|
+
description: 'Upload a document file to LightRAG',
|
|
90
|
+
inputSchema: {
|
|
91
|
+
type: 'object',
|
|
92
|
+
properties: {
|
|
93
|
+
file_path: { type: 'string', description: 'Path to the file' },
|
|
94
|
+
chunk_size: { type: 'number', description: 'Custom chunk size' },
|
|
95
|
+
chunk_overlap: { type: 'number', description: 'Overlap between chunks' }
|
|
96
|
+
},
|
|
97
|
+
required: ['file_path']
|
|
98
|
+
}
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
name: 'upload_documents',
|
|
102
|
+
description: 'Upload multiple documents in batch',
|
|
103
|
+
inputSchema: {
|
|
104
|
+
type: 'object',
|
|
105
|
+
properties: {
|
|
106
|
+
file_paths: {
|
|
107
|
+
type: 'array',
|
|
108
|
+
items: { type: 'string' },
|
|
109
|
+
description: 'Array of file paths'
|
|
110
|
+
}
|
|
111
|
+
},
|
|
112
|
+
required: ['file_paths']
|
|
113
|
+
}
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
name: 'scan_documents',
|
|
117
|
+
description: 'Scan for new documents in the configured directory',
|
|
118
|
+
inputSchema: {
|
|
119
|
+
type: 'object',
|
|
120
|
+
properties: {}
|
|
121
|
+
}
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
name: 'get_documents',
|
|
125
|
+
description: 'Retrieve all documents from LightRAG',
|
|
126
|
+
inputSchema: {
|
|
127
|
+
type: 'object',
|
|
128
|
+
properties: {}
|
|
129
|
+
}
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
name: 'get_documents_paginated',
|
|
133
|
+
description: 'Retrieve documents with pagination',
|
|
134
|
+
inputSchema: {
|
|
135
|
+
type: 'object',
|
|
136
|
+
properties: {
|
|
137
|
+
page: { type: 'number', description: 'Page number (1-based)' },
|
|
138
|
+
page_size: { type: 'number', description: 'Items per page (1-100)' }
|
|
139
|
+
},
|
|
140
|
+
required: ['page', 'page_size']
|
|
141
|
+
}
|
|
142
|
+
},
|
|
143
|
+
{
|
|
144
|
+
name: 'delete_document',
|
|
145
|
+
description: 'Delete a specific document by ID',
|
|
146
|
+
inputSchema: {
|
|
147
|
+
type: 'object',
|
|
148
|
+
properties: {
|
|
149
|
+
document_id: { type: 'string', description: 'ID of document to delete' }
|
|
150
|
+
},
|
|
151
|
+
required: ['document_id']
|
|
152
|
+
}
|
|
153
|
+
},
|
|
154
|
+
{
|
|
155
|
+
name: 'clear_documents',
|
|
156
|
+
description: 'Clear all documents from LightRAG',
|
|
157
|
+
inputSchema: {
|
|
158
|
+
type: 'object',
|
|
159
|
+
properties: {}
|
|
160
|
+
}
|
|
161
|
+
},
|
|
162
|
+
{
|
|
163
|
+
name: 'document_status',
|
|
164
|
+
description: 'Get processing status for documents',
|
|
165
|
+
inputSchema: {
|
|
166
|
+
type: 'object',
|
|
167
|
+
properties: {
|
|
168
|
+
document_id: { type: 'string', description: 'Specific document ID' }
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
},
|
|
172
|
+
|
|
173
|
+
// ===== QUERY TOOLS (3) =====
|
|
174
|
+
{
|
|
175
|
+
name: 'query_text',
|
|
176
|
+
description: 'Query LightRAG with text using various retrieval modes',
|
|
177
|
+
inputSchema: {
|
|
178
|
+
type: 'object',
|
|
179
|
+
properties: {
|
|
180
|
+
query: { type: 'string', description: 'Query text' },
|
|
181
|
+
mode: {
|
|
182
|
+
type: 'string',
|
|
183
|
+
enum: ['naive', 'local', 'global', 'hybrid', 'mix'],
|
|
184
|
+
default: 'hybrid',
|
|
185
|
+
description: 'Query mode'
|
|
186
|
+
},
|
|
187
|
+
only_need_context: { type: 'boolean', description: 'Return only context' },
|
|
188
|
+
top_k: { type: 'number', description: 'Number of results' }
|
|
189
|
+
},
|
|
190
|
+
required: ['query']
|
|
191
|
+
}
|
|
192
|
+
},
|
|
193
|
+
{
|
|
194
|
+
name: 'query_text_stream',
|
|
195
|
+
description: 'Stream query results from LightRAG in real-time',
|
|
196
|
+
inputSchema: {
|
|
197
|
+
type: 'object',
|
|
198
|
+
properties: {
|
|
199
|
+
query: { type: 'string', description: 'Query text' },
|
|
200
|
+
mode: {
|
|
201
|
+
type: 'string',
|
|
202
|
+
enum: ['naive', 'local', 'global', 'hybrid', 'mix'],
|
|
203
|
+
default: 'hybrid'
|
|
204
|
+
}
|
|
205
|
+
},
|
|
206
|
+
required: ['query']
|
|
207
|
+
}
|
|
208
|
+
},
|
|
209
|
+
{
|
|
210
|
+
name: 'query_with_citation',
|
|
211
|
+
description: 'Query LightRAG and get results with source citations',
|
|
212
|
+
inputSchema: {
|
|
213
|
+
type: 'object',
|
|
214
|
+
properties: {
|
|
215
|
+
query: { type: 'string', description: 'Query text' },
|
|
216
|
+
mode: {
|
|
217
|
+
type: 'string',
|
|
218
|
+
enum: ['naive', 'local', 'global', 'hybrid', 'mix'],
|
|
219
|
+
default: 'hybrid'
|
|
220
|
+
}
|
|
221
|
+
},
|
|
222
|
+
required: ['query']
|
|
223
|
+
}
|
|
224
|
+
},
|
|
225
|
+
|
|
226
|
+
// ===== KNOWLEDGE GRAPH TOOLS (8) =====
|
|
227
|
+
{
|
|
228
|
+
name: 'get_knowledge_graph',
|
|
229
|
+
description: 'Retrieve the complete knowledge graph',
|
|
230
|
+
inputSchema: {
|
|
231
|
+
type: 'object',
|
|
232
|
+
properties: {}
|
|
233
|
+
}
|
|
234
|
+
},
|
|
235
|
+
{
|
|
236
|
+
name: 'get_graph_structure',
|
|
237
|
+
description: 'Get knowledge graph structure and statistics',
|
|
238
|
+
inputSchema: {
|
|
239
|
+
type: 'object',
|
|
240
|
+
properties: {}
|
|
241
|
+
}
|
|
242
|
+
},
|
|
243
|
+
{
|
|
244
|
+
name: 'get_entities',
|
|
245
|
+
description: 'Retrieve all entities from the knowledge graph',
|
|
246
|
+
inputSchema: {
|
|
247
|
+
type: 'object',
|
|
248
|
+
properties: {
|
|
249
|
+
limit: { type: 'number', description: 'Max entities to retrieve' }
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
},
|
|
253
|
+
{
|
|
254
|
+
name: 'get_relations',
|
|
255
|
+
description: 'Retrieve all relationships from the knowledge graph',
|
|
256
|
+
inputSchema: {
|
|
257
|
+
type: 'object',
|
|
258
|
+
properties: {
|
|
259
|
+
limit: { type: 'number', description: 'Max relations to retrieve' }
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
},
|
|
263
|
+
{
|
|
264
|
+
name: 'check_entity_exists',
|
|
265
|
+
description: 'Check if an entity exists in the knowledge graph',
|
|
266
|
+
inputSchema: {
|
|
267
|
+
type: 'object',
|
|
268
|
+
properties: {
|
|
269
|
+
entity_name: { type: 'string', description: 'Name of the entity' }
|
|
270
|
+
},
|
|
271
|
+
required: ['entity_name']
|
|
272
|
+
}
|
|
273
|
+
},
|
|
274
|
+
{
|
|
275
|
+
name: 'update_entity',
|
|
276
|
+
description: 'Update properties of an entity',
|
|
277
|
+
inputSchema: {
|
|
278
|
+
type: 'object',
|
|
279
|
+
properties: {
|
|
280
|
+
entity_id: { type: 'string', description: 'Entity ID' },
|
|
281
|
+
properties: { type: 'object', description: 'Properties to update' }
|
|
282
|
+
},
|
|
283
|
+
required: ['entity_id', 'properties']
|
|
284
|
+
}
|
|
285
|
+
},
|
|
286
|
+
{
|
|
287
|
+
name: 'delete_entity',
|
|
288
|
+
description: 'Delete an entity from the knowledge graph',
|
|
289
|
+
inputSchema: {
|
|
290
|
+
type: 'object',
|
|
291
|
+
properties: {
|
|
292
|
+
entity_id: { type: 'string', description: 'Entity ID' }
|
|
293
|
+
},
|
|
294
|
+
required: ['entity_id']
|
|
295
|
+
}
|
|
296
|
+
},
|
|
297
|
+
{
|
|
298
|
+
name: 'delete_relation',
|
|
299
|
+
description: 'Delete a relationship from the knowledge graph',
|
|
300
|
+
inputSchema: {
|
|
301
|
+
type: 'object',
|
|
302
|
+
properties: {
|
|
303
|
+
relation_id: { type: 'string', description: 'Relation ID' }
|
|
304
|
+
},
|
|
305
|
+
required: ['relation_id']
|
|
306
|
+
}
|
|
307
|
+
},
|
|
308
|
+
|
|
309
|
+
// ===== SYSTEM MANAGEMENT TOOLS (5) =====
|
|
310
|
+
{
|
|
311
|
+
name: 'get_health',
|
|
312
|
+
description: 'Check LightRAG server health status',
|
|
313
|
+
inputSchema: {
|
|
314
|
+
type: 'object',
|
|
315
|
+
properties: {}
|
|
316
|
+
}
|
|
317
|
+
},
|
|
318
|
+
{
|
|
319
|
+
name: 'get_status',
|
|
320
|
+
description: 'Get detailed system status and statistics',
|
|
321
|
+
inputSchema: {
|
|
322
|
+
type: 'object',
|
|
323
|
+
properties: {}
|
|
324
|
+
}
|
|
325
|
+
},
|
|
326
|
+
{
|
|
327
|
+
name: 'clear_cache',
|
|
328
|
+
description: 'Clear LightRAG internal cache',
|
|
329
|
+
inputSchema: {
|
|
330
|
+
type: 'object',
|
|
331
|
+
properties: {
|
|
332
|
+
cache_type: { type: 'string', description: 'Type of cache to clear' }
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
},
|
|
336
|
+
{
|
|
337
|
+
name: 'get_config',
|
|
338
|
+
description: 'Get current LightRAG server configuration',
|
|
339
|
+
inputSchema: {
|
|
340
|
+
type: 'object',
|
|
341
|
+
properties: {}
|
|
342
|
+
}
|
|
343
|
+
},
|
|
344
|
+
{
|
|
345
|
+
name: 'get_workspace_info',
|
|
346
|
+
description: 'Get information about the current workspace',
|
|
347
|
+
inputSchema: {
|
|
348
|
+
type: 'object',
|
|
349
|
+
properties: {}
|
|
350
|
+
}
|
|
351
|
+
}
|
|
352
|
+
];
|
|
353
|
+
|
|
354
|
+
// List tools handler
|
|
355
|
+
server.setRequestHandler(ListToolsRequestSchema, async () => {
|
|
356
|
+
return { tools };
|
|
357
|
+
});
|
|
358
|
+
|
|
359
|
+
// Call tool handler with all 30+ implementations
|
|
360
|
+
server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
361
|
+
const { name, arguments: args } = request.params;
|
|
362
|
+
|
|
363
|
+
try {
|
|
364
|
+
let response;
|
|
365
|
+
|
|
366
|
+
switch (name) {
|
|
367
|
+
// DOCUMENT MANAGEMENT
|
|
368
|
+
case 'insert_text':
|
|
369
|
+
response = await httpClient.post('/insert', {
|
|
370
|
+
text: args.text,
|
|
371
|
+
description: args.description
|
|
372
|
+
});
|
|
373
|
+
break;
|
|
374
|
+
|
|
375
|
+
case 'insert_texts':
|
|
376
|
+
response = await httpClient.post('/insert_batch', {
|
|
377
|
+
texts: args.texts
|
|
378
|
+
});
|
|
379
|
+
break;
|
|
380
|
+
|
|
381
|
+
case 'upload_document':
|
|
382
|
+
response = await httpClient.post('/upload', {
|
|
383
|
+
file_path: args.file_path,
|
|
384
|
+
chunk_size: args.chunk_size,
|
|
385
|
+
chunk_overlap: args.chunk_overlap
|
|
386
|
+
});
|
|
387
|
+
break;
|
|
388
|
+
|
|
389
|
+
case 'upload_documents':
|
|
390
|
+
response = await httpClient.post('/upload_batch', {
|
|
391
|
+
file_paths: args.file_paths
|
|
392
|
+
});
|
|
393
|
+
break;
|
|
394
|
+
|
|
395
|
+
case 'scan_documents':
|
|
396
|
+
response = await httpClient.post('/scan');
|
|
397
|
+
break;
|
|
398
|
+
|
|
399
|
+
case 'get_documents':
|
|
400
|
+
response = await httpClient.get('/documents');
|
|
401
|
+
break;
|
|
402
|
+
|
|
403
|
+
case 'get_documents_paginated':
|
|
404
|
+
response = await httpClient.get(`/documents?page=${args.page}&page_size=${args.page_size}`);
|
|
405
|
+
break;
|
|
406
|
+
|
|
407
|
+
case 'delete_document':
|
|
408
|
+
response = await httpClient.delete(`/documents/${args.document_id}`);
|
|
409
|
+
break;
|
|
410
|
+
|
|
411
|
+
case 'clear_documents':
|
|
412
|
+
response = await httpClient.delete('/documents');
|
|
413
|
+
break;
|
|
414
|
+
|
|
415
|
+
case 'document_status':
|
|
416
|
+
response = await httpClient.get(`/status/${args.document_id || ''}`);
|
|
417
|
+
break;
|
|
418
|
+
|
|
419
|
+
// QUERY OPERATIONS
|
|
420
|
+
case 'query_text':
|
|
421
|
+
response = await httpClient.post('/query', {
|
|
422
|
+
query: args.query,
|
|
423
|
+
mode: args.mode || 'hybrid',
|
|
424
|
+
only_need_context: args.only_need_context,
|
|
425
|
+
top_k: args.top_k
|
|
426
|
+
});
|
|
427
|
+
break;
|
|
428
|
+
|
|
429
|
+
case 'query_text_stream':
|
|
430
|
+
response = await httpClient.post('/query/stream', {
|
|
431
|
+
query: args.query,
|
|
432
|
+
mode: args.mode || 'hybrid'
|
|
433
|
+
});
|
|
434
|
+
break;
|
|
435
|
+
|
|
436
|
+
case 'query_with_citation':
|
|
437
|
+
response = await httpClient.post('/query/citation', {
|
|
438
|
+
query: args.query,
|
|
439
|
+
mode: args.mode || 'hybrid'
|
|
440
|
+
});
|
|
441
|
+
break;
|
|
442
|
+
|
|
443
|
+
// KNOWLEDGE GRAPH
|
|
444
|
+
case 'get_knowledge_graph':
|
|
445
|
+
response = await httpClient.get('/graph');
|
|
446
|
+
break;
|
|
447
|
+
|
|
448
|
+
case 'get_graph_structure':
|
|
449
|
+
response = await httpClient.get('/graph/structure');
|
|
450
|
+
break;
|
|
451
|
+
|
|
452
|
+
case 'get_entities':
|
|
453
|
+
response = await httpClient.get(`/graph/entities?limit=${args.limit || 100}`);
|
|
454
|
+
break;
|
|
455
|
+
|
|
456
|
+
case 'get_relations':
|
|
457
|
+
response = await httpClient.get(`/graph/relations?limit=${args.limit || 100}`);
|
|
458
|
+
break;
|
|
459
|
+
|
|
460
|
+
case 'check_entity_exists':
|
|
461
|
+
response = await httpClient.get(`/graph/entity/exists?name=${encodeURIComponent(args.entity_name)}`);
|
|
462
|
+
break;
|
|
463
|
+
|
|
464
|
+
case 'update_entity':
|
|
465
|
+
response = await httpClient.put(`/graph/entity/${args.entity_id}`, args.properties);
|
|
466
|
+
break;
|
|
467
|
+
|
|
468
|
+
case 'delete_entity':
|
|
469
|
+
response = await httpClient.delete(`/graph/entity/${args.entity_id}`);
|
|
470
|
+
break;
|
|
471
|
+
|
|
472
|
+
case 'delete_relation':
|
|
473
|
+
response = await httpClient.delete(`/graph/relation/${args.relation_id}`);
|
|
474
|
+
break;
|
|
475
|
+
|
|
476
|
+
// SYSTEM MANAGEMENT
|
|
477
|
+
case 'get_health':
|
|
478
|
+
response = await httpClient.get('/health');
|
|
479
|
+
break;
|
|
480
|
+
|
|
481
|
+
case 'get_status':
|
|
482
|
+
response = await httpClient.get('/status');
|
|
483
|
+
break;
|
|
484
|
+
|
|
485
|
+
case 'clear_cache':
|
|
486
|
+
response = await httpClient.post('/cache/clear', {
|
|
487
|
+
cache_type: args.cache_type || 'all'
|
|
488
|
+
});
|
|
489
|
+
break;
|
|
490
|
+
|
|
491
|
+
case 'get_config':
|
|
492
|
+
response = await httpClient.get('/config');
|
|
493
|
+
break;
|
|
494
|
+
|
|
495
|
+
case 'get_workspace_info':
|
|
496
|
+
response = await httpClient.get('/workspace/info');
|
|
497
|
+
break;
|
|
498
|
+
|
|
499
|
+
default:
|
|
500
|
+
throw new Error(`Unknown tool: ${name}`);
|
|
501
|
+
}
|
|
502
|
+
|
|
503
|
+
return {
|
|
504
|
+
content: [
|
|
505
|
+
{
|
|
506
|
+
type: 'text',
|
|
507
|
+
text: JSON.stringify(response.data, null, 2)
|
|
508
|
+
}
|
|
509
|
+
]
|
|
510
|
+
};
|
|
511
|
+
} catch (error) {
|
|
512
|
+
return {
|
|
513
|
+
content: [
|
|
514
|
+
{
|
|
515
|
+
type: 'text',
|
|
516
|
+
text: `Error: ${error.message}\n${error.response?.data ? `\nServer error: ${JSON.stringify(error.response.data, null, 2)}` : ''}`
|
|
517
|
+
}
|
|
518
|
+
],
|
|
519
|
+
isError: true
|
|
520
|
+
};
|
|
521
|
+
}
|
|
522
|
+
});
|
|
523
|
+
|
|
524
|
+
// Start server
|
|
525
|
+
async function main() {
|
|
526
|
+
const transport = new StdioServerTransport();
|
|
527
|
+
await server.connect(transport);
|
|
528
|
+
console.error('╔════════════════════════════════════════════════════════╗');
|
|
529
|
+
console.error('║ LightRAG MCP Server v1.0.4 - Started Successfully ║');
|
|
530
|
+
console.error('╚════════════════════════════════════════════════════════╝');
|
|
531
|
+
console.error(`Server: ${LIGHTRAG_SERVER_URL}`);
|
|
532
|
+
console.error(`Workspace: ${LIGHTRAG_WORKSPACE}`);
|
|
533
|
+
console.error(`Tools: 30+ tools available`);
|
|
534
|
+
console.error('Ready for connections...\n');
|
|
535
|
+
}
|
|
536
|
+
|
|
537
|
+
main().catch((error) => {
|
|
538
|
+
console.error('Fatal error:', error);
|
|
539
|
+
process.exit(1);
|
|
540
|
+
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@g99/lightrag-mcp-server",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.4",
|
|
4
4
|
"description": "Model Context Protocol (MCP) server for LightRAG - Complete RAG and Knowledge Graph integration with 30+ tools",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"mcp",
|
|
@@ -27,17 +27,19 @@
|
|
|
27
27
|
"publishConfig": {
|
|
28
28
|
"access": "public"
|
|
29
29
|
},
|
|
30
|
-
"
|
|
31
|
-
"postinstall": "node wrapper.js"
|
|
32
|
-
},
|
|
30
|
+
"main": "index.js",
|
|
33
31
|
"bin": {
|
|
34
|
-
"lightrag-mcp-server": "
|
|
32
|
+
"lightrag-mcp-server": "index.js"
|
|
35
33
|
},
|
|
36
34
|
"files": [
|
|
37
|
-
"
|
|
35
|
+
"index.js",
|
|
38
36
|
"README.md",
|
|
39
37
|
"LICENSE"
|
|
40
38
|
],
|
|
39
|
+
"dependencies": {
|
|
40
|
+
"@modelcontextprotocol/sdk": "^0.5.0",
|
|
41
|
+
"axios": "^1.6.0"
|
|
42
|
+
},
|
|
41
43
|
"engines": {
|
|
42
44
|
"node": ">=18.0.0"
|
|
43
45
|
}
|
package/wrapper.js
DELETED
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* LightRAG MCP Server - npm Package
|
|
5
|
-
*
|
|
6
|
-
* This package provides easy installation via npm/npx for the LightRAG MCP Server.
|
|
7
|
-
* The actual implementation requires a running LightRAG server.
|
|
8
|
-
*
|
|
9
|
-
* Author: Lalit Suryan
|
|
10
|
-
* License: MIT
|
|
11
|
-
*/
|
|
12
|
-
|
|
13
|
-
console.log('╔═══════════════════════════════════════════════════════╗');
|
|
14
|
-
console.log('║ LightRAG MCP Server - @g99/lightrag-mcp-server ║');
|
|
15
|
-
console.log('╚═══════════════════════════════════════════════════════╝');
|
|
16
|
-
console.log('');
|
|
17
|
-
console.log('📦 Package Information:');
|
|
18
|
-
console.log(' • Version: 1.0.1');
|
|
19
|
-
console.log(' • Author: Lalit Suryan');
|
|
20
|
-
console.log(' • Repository: https://github.com/lalitsuryan/lightragmcp');
|
|
21
|
-
console.log('');
|
|
22
|
-
console.log('⚠️ Installation Notice:');
|
|
23
|
-
console.log('');
|
|
24
|
-
console.log('This is an npm wrapper package for the LightRAG MCP Server.');
|
|
25
|
-
console.log('To use this server, you need:');
|
|
26
|
-
console.log('');
|
|
27
|
-
console.log('1. A running LightRAG server');
|
|
28
|
-
console.log(' Install: pip install "lightrag-hku[api]"');
|
|
29
|
-
console.log(' Run: lightrag-server');
|
|
30
|
-
console.log('');
|
|
31
|
-
console.log('2. Configure your MCP client (e.g., Claude Desktop):');
|
|
32
|
-
console.log('');
|
|
33
|
-
console.log(' {');
|
|
34
|
-
console.log(' "mcpServers": {');
|
|
35
|
-
console.log(' "lightrag": {');
|
|
36
|
-
console.log(' "command": "npx",');
|
|
37
|
-
console.log(' "args": ["@g99/lightrag-mcp-server"],');
|
|
38
|
-
console.log(' "env": {');
|
|
39
|
-
console.log(' "LIGHTRAG_SERVER_URL": "http://localhost:9621"');
|
|
40
|
-
console.log(' }');
|
|
41
|
-
console.log(' }');
|
|
42
|
-
console.log(' }');
|
|
43
|
-
console.log(' }');
|
|
44
|
-
console.log('');
|
|
45
|
-
console.log('📚 Documentation:');
|
|
46
|
-
console.log(' • https://github.com/lalitsuryan/lightragmcp#readme');
|
|
47
|
-
console.log('');
|
|
48
|
-
console.log('❓ Support:');
|
|
49
|
-
console.log(' • Issues: https://github.com/lalitsuryan/lightragmcp/issues');
|
|
50
|
-
console.log('');
|
|
51
|
-
console.log('════════════════════════════════════════════════════════');
|
|
52
|
-
console.log('');
|
|
53
|
-
console.log('⚠️ This package is currently in setup mode.');
|
|
54
|
-
console.log(' Please configure it in your MCP client to use it.');
|
|
55
|
-
console.log('');
|
|
56
|
-
|
|
57
|
-
process.exit(0);
|