langflow-mcp-server 3.1.1 → 4.12.2
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/.env.example +19 -1
- package/README.md +350 -82
- package/dist/__tests__/fixtures/advanced-execution.d.ts.map +1 -1
- package/dist/__tests__/fixtures/advanced-execution.js +7 -4
- package/dist/__tests__/fixtures/advanced-execution.js.map +1 -1
- package/dist/__tests__/fixtures/api-keys.js.map +1 -1
- package/dist/__tests__/fixtures/auth.d.ts.map +1 -1
- package/dist/__tests__/fixtures/components.d.ts.map +1 -1
- package/dist/__tests__/fixtures/custom-components.js.map +1 -1
- package/dist/__tests__/fixtures/files.d.ts.map +1 -1
- package/dist/__tests__/fixtures/files.js.map +1 -1
- package/dist/__tests__/fixtures/flows.js.map +1 -1
- package/dist/__tests__/fixtures/folders.js.map +1 -1
- package/dist/__tests__/fixtures/knowledge-bases.d.ts.map +1 -1
- package/dist/__tests__/fixtures/knowledge-bases.js.map +1 -1
- package/dist/__tests__/fixtures/misc.js.map +1 -1
- package/dist/__tests__/fixtures/monitoring.js.map +1 -1
- package/dist/__tests__/fixtures/projects.js.map +1 -1
- package/dist/__tests__/fixtures/run.d.ts.map +1 -1
- package/dist/__tests__/fixtures/store.d.ts.map +1 -1
- package/dist/__tests__/fixtures/store.js.map +1 -1
- package/dist/__tests__/fixtures/users.js.map +1 -1
- package/dist/__tests__/fixtures/variables.js.map +1 -1
- package/dist/__tests__/fixtures/vertices.d.ts +1 -2
- package/dist/__tests__/fixtures/vertices.d.ts.map +1 -1
- package/dist/__tests__/fixtures/vertices.js +1 -5
- package/dist/__tests__/fixtures/vertices.js.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -1
- package/dist/index.js.map +1 -1
- package/dist/mcp/http.d.ts +69 -0
- package/dist/mcp/http.d.ts.map +1 -0
- package/dist/mcp/http.js +595 -0
- package/dist/mcp/http.js.map +1 -0
- package/dist/mcp/index.js +39 -5
- package/dist/mcp/index.js.map +1 -1
- package/dist/mcp/prompts.js.map +1 -1
- package/dist/mcp/resources.d.ts.map +1 -1
- package/dist/mcp/resources.js +6 -17
- package/dist/mcp/resources.js.map +1 -1
- package/dist/mcp/server-consolidated.d.ts +16 -0
- package/dist/mcp/server-consolidated.d.ts.map +1 -1
- package/dist/mcp/server-consolidated.js +771 -18
- package/dist/mcp/server-consolidated.js.map +1 -1
- package/dist/mcp/server.d.ts +2 -0
- package/dist/mcp/server.d.ts.map +1 -1
- package/dist/mcp/server.js +827 -20
- package/dist/mcp/server.js.map +1 -1
- package/dist/mcp/tools-consolidated.d.ts.map +1 -1
- package/dist/mcp/tools-consolidated.js +813 -47
- package/dist/mcp/tools-consolidated.js.map +1 -1
- package/dist/mcp/tools.d.ts.map +1 -1
- package/dist/mcp/tools.js +1998 -83
- package/dist/mcp/tools.js.map +1 -1
- package/dist/mcp/validation-consolidated.d.ts +876 -18
- package/dist/mcp/validation-consolidated.d.ts.map +1 -1
- package/dist/mcp/validation-consolidated.js +758 -21
- package/dist/mcp/validation-consolidated.js.map +1 -1
- package/dist/mcp/validation.d.ts +966 -19
- package/dist/mcp/validation.d.ts.map +1 -1
- package/dist/mcp/validation.js +722 -18
- package/dist/mcp/validation.js.map +1 -1
- package/dist/services/langflow-client.d.ts +154 -52
- package/dist/services/langflow-client.d.ts.map +1 -1
- package/dist/services/langflow-client.js +1305 -155
- package/dist/services/langflow-client.js.map +1 -1
- package/dist/types/index.d.ts +536 -10
- package/dist/types/index.d.ts.map +1 -1
- package/dist/utils/logger.d.ts.map +1 -1
- package/dist/utils/logger.js +2 -3
- package/dist/utils/logger.js.map +1 -1
- package/package.json +17 -15
|
@@ -73,7 +73,7 @@ class LangflowMCPServerConsolidated {
|
|
|
73
73
|
'x-api-key', 'x-store-api-key', 'set-cookie',
|
|
74
74
|
'bearer', 'session', 'session_id', 'cookie',
|
|
75
75
|
'private_key', 'secret', 'credentials', 'api-key',
|
|
76
|
-
'file_content', 'file', 'content', 'payload', 'data'
|
|
76
|
+
'file_content', 'file', 'content', 'payload', 'data', 'auth_settings', 'input_value', 'instruction'
|
|
77
77
|
]);
|
|
78
78
|
if (depth > MAX_DEPTH)
|
|
79
79
|
return { __error: 'max depth exceeded' };
|
|
@@ -152,6 +152,10 @@ class LangflowMCPServerConsolidated {
|
|
|
152
152
|
if (!base64Regex.test(fileContent)) {
|
|
153
153
|
throw new Error('Invalid base64 format');
|
|
154
154
|
}
|
|
155
|
+
if (fileContent.length % 4 !== 0 ||
|
|
156
|
+
Buffer.from(fileContent, 'base64').toString('base64') !== fileContent) {
|
|
157
|
+
throw new Error('Invalid base64 format');
|
|
158
|
+
}
|
|
155
159
|
const estimatedSize = (fileContent.length * 3) / 4;
|
|
156
160
|
if (estimatedSize > maxSizeBytes) {
|
|
157
161
|
throw new Error(`File size exceeds maximum allowed size of ${maxSizeBytes} bytes (10MB)`);
|
|
@@ -249,6 +253,34 @@ class LangflowMCPServerConsolidated {
|
|
|
249
253
|
return await this.handleValidationTool(args);
|
|
250
254
|
case 'system':
|
|
251
255
|
return await this.handleSystemTool(args);
|
|
256
|
+
case 'flow_version':
|
|
257
|
+
return await this.handleFlowVersionTool(args);
|
|
258
|
+
case 'file_v2':
|
|
259
|
+
return await this.handleFileV2Tool(args);
|
|
260
|
+
case 'model':
|
|
261
|
+
return await this.handleModelTool(args);
|
|
262
|
+
case 'agentic':
|
|
263
|
+
return await this.handleAgenticTool(args);
|
|
264
|
+
case 'workflow':
|
|
265
|
+
return await this.handleWorkflowTool(args);
|
|
266
|
+
case 'a2a':
|
|
267
|
+
return await this.handleA2aTool(args);
|
|
268
|
+
case 'governance':
|
|
269
|
+
return await this.handleGovernanceTool(args);
|
|
270
|
+
case 'mcp_server':
|
|
271
|
+
return await this.handleMcpServerTool(args);
|
|
272
|
+
case 'mcp_project':
|
|
273
|
+
return await this.handleMcpProjectTool(args);
|
|
274
|
+
case 'trace':
|
|
275
|
+
return await this.handleTraceTool(args);
|
|
276
|
+
case 'response':
|
|
277
|
+
return await this.handleResponseTool(args);
|
|
278
|
+
case 'authz':
|
|
279
|
+
return await this.handleAuthzTool(args);
|
|
280
|
+
case 'memory':
|
|
281
|
+
return await this.handleMemoryTool(args);
|
|
282
|
+
case 'extension':
|
|
283
|
+
return await this.handleExtensionTool(args);
|
|
252
284
|
default:
|
|
253
285
|
throw new Error(`Unknown tool: ${name}`);
|
|
254
286
|
}
|
|
@@ -312,14 +344,27 @@ class LangflowMCPServerConsolidated {
|
|
|
312
344
|
const starters = await this.client.listStarterProjects();
|
|
313
345
|
return this.formatSuccessResponse(starters);
|
|
314
346
|
}
|
|
347
|
+
case 'replace': {
|
|
348
|
+
const { action: _, flow_id, ...body } = validated;
|
|
349
|
+
const result = await this.client.replaceFlow(flow_id, body);
|
|
350
|
+
return this.formatSuccessResponse(result);
|
|
351
|
+
}
|
|
352
|
+
case 'expand': {
|
|
353
|
+
const result = await this.client.expandFlows(validated.body);
|
|
354
|
+
return this.formatSuccessResponse(result);
|
|
355
|
+
}
|
|
356
|
+
case 'note_translations': {
|
|
357
|
+
const result = await this.client.getFlowNoteTranslations(validated.flow_id);
|
|
358
|
+
return this.formatSuccessResponse(result);
|
|
359
|
+
}
|
|
315
360
|
}
|
|
316
361
|
}
|
|
317
362
|
async handleFlowExecutionTool(args) {
|
|
318
363
|
const validated = validation_consolidated_1.FlowExecutionToolSchema.parse(args);
|
|
319
364
|
switch (validated.action) {
|
|
320
365
|
case 'run': {
|
|
321
|
-
const { action: _, flow_id_or_name, stream, ...inputRequest } = validated;
|
|
322
|
-
const result = await this.client.runFlow(flow_id_or_name, inputRequest, stream);
|
|
366
|
+
const { action: _, flow_id_or_name, stream, context, ...inputRequest } = validated;
|
|
367
|
+
const result = await this.client.runFlow(flow_id_or_name, inputRequest, stream, context);
|
|
323
368
|
return this.formatSuccessResponse(result);
|
|
324
369
|
}
|
|
325
370
|
case 'run_advanced': {
|
|
@@ -357,23 +402,32 @@ class LangflowMCPServerConsolidated {
|
|
|
357
402
|
const result = await this.client.buildFlow(flow_id, { inputs, data, files }, params);
|
|
358
403
|
return this.formatSuccessResponse(result);
|
|
359
404
|
}
|
|
405
|
+
case 'public_start': {
|
|
406
|
+
const { action: _, flow_id, inputs, files, ...params } = validated;
|
|
407
|
+
const result = await this.client.buildPublicFlow(flow_id, { inputs, files }, params);
|
|
408
|
+
return this.formatSuccessResponse(result);
|
|
409
|
+
}
|
|
360
410
|
case 'status': {
|
|
361
411
|
const result = await this.client.getBuildStatus(validated.job_id, validated.event_delivery);
|
|
362
412
|
return this.formatSuccessResponse(result);
|
|
363
413
|
}
|
|
414
|
+
case 'public_events': {
|
|
415
|
+
const result = await this.client.getPublicBuildEvents(validated.job_id, validated.event_delivery);
|
|
416
|
+
return this.formatSuccessResponse(result);
|
|
417
|
+
}
|
|
364
418
|
case 'cancel': {
|
|
365
419
|
const result = await this.client.cancelBuild(validated.job_id);
|
|
366
420
|
return this.formatSuccessResponse(result);
|
|
367
421
|
}
|
|
422
|
+
case 'public_cancel': {
|
|
423
|
+
const result = await this.client.cancelPublicBuild(validated.job_id);
|
|
424
|
+
return this.formatSuccessResponse(result);
|
|
425
|
+
}
|
|
368
426
|
case 'vertices': {
|
|
369
427
|
const { action: _, flow_id, ...request } = validated;
|
|
370
428
|
const result = await this.client.buildVertices(flow_id, request);
|
|
371
429
|
return this.formatSuccessResponse(result);
|
|
372
430
|
}
|
|
373
|
-
case 'get_vertex': {
|
|
374
|
-
const result = await this.client.getVertex({ flow_id: validated.flow_id, vertex_id: validated.vertex_id });
|
|
375
|
-
return this.formatSuccessResponse(result);
|
|
376
|
-
}
|
|
377
431
|
case 'stream_vertex': {
|
|
378
432
|
const result = await this.client.streamVertexBuild({ flow_id: validated.flow_id, vertex_id: validated.vertex_id });
|
|
379
433
|
return this.formatSuccessResponse(result);
|
|
@@ -446,6 +500,11 @@ class LangflowMCPServerConsolidated {
|
|
|
446
500
|
const updated = await this.client.updateProject(project_id, updates);
|
|
447
501
|
return this.formatSuccessResponse(updated);
|
|
448
502
|
}
|
|
503
|
+
case 'upsert': {
|
|
504
|
+
const { action: _, project_id, ...body } = validated;
|
|
505
|
+
const updated = await this.client.upsertProject(project_id, body);
|
|
506
|
+
return this.formatSuccessResponse(updated);
|
|
507
|
+
}
|
|
449
508
|
case 'delete': {
|
|
450
509
|
await this.client.deleteProject(validated.project_id);
|
|
451
510
|
return this.formatSuccessResponse({ success: true, message: 'Project deleted successfully' });
|
|
@@ -481,6 +540,10 @@ class LangflowMCPServerConsolidated {
|
|
|
481
540
|
await this.client.deleteVariable(validated.variable_id);
|
|
482
541
|
return this.formatSuccessResponse({ success: true, message: 'Variable deleted successfully' });
|
|
483
542
|
}
|
|
543
|
+
case 'detect': {
|
|
544
|
+
const result = await this.client.detectVariables({ flow_version_ids: validated.flow_version_ids });
|
|
545
|
+
return this.formatSuccessResponse(result);
|
|
546
|
+
}
|
|
484
547
|
}
|
|
485
548
|
}
|
|
486
549
|
async handleKnowledgeBaseTool(args) {
|
|
@@ -507,6 +570,66 @@ class LangflowMCPServerConsolidated {
|
|
|
507
570
|
const result = await this.client.uploadKnowledgeBase(validated.kb_name, fileBuffer, validated.file_name);
|
|
508
571
|
return this.formatSuccessResponse(result);
|
|
509
572
|
}
|
|
573
|
+
case 'create': {
|
|
574
|
+
const { action: _, ...body } = validated;
|
|
575
|
+
const result = await this.client.createKnowledgeBase(body);
|
|
576
|
+
return this.formatSuccessResponse(result);
|
|
577
|
+
}
|
|
578
|
+
case 'list_detailed': {
|
|
579
|
+
const result = await this.client.listKnowledgeBasesDetailed();
|
|
580
|
+
return this.formatSuccessResponse(result);
|
|
581
|
+
}
|
|
582
|
+
case 'list_chunks': {
|
|
583
|
+
const { action: _, kb_name, ...params } = validated;
|
|
584
|
+
const result = await this.client.listKnowledgeBaseChunks(kb_name, params);
|
|
585
|
+
return this.formatSuccessResponse(result);
|
|
586
|
+
}
|
|
587
|
+
case 'ingest': {
|
|
588
|
+
const fileBuffer = this.validateFileSize(validated.file_content);
|
|
589
|
+
const result = await this.client.ingestKnowledgeBase(validated.kb_name, [{ buffer: fileBuffer, filename: validated.file_name }], validated.params);
|
|
590
|
+
return this.formatSuccessResponse(result);
|
|
591
|
+
}
|
|
592
|
+
case 'preview_chunks': {
|
|
593
|
+
const fileBuffer = this.validateFileSize(validated.file_content);
|
|
594
|
+
const result = await this.client.previewKnowledgeBaseChunks([{ buffer: fileBuffer, filename: validated.file_name }], validated.params);
|
|
595
|
+
return this.formatSuccessResponse(result);
|
|
596
|
+
}
|
|
597
|
+
case 'cancel_ingest': {
|
|
598
|
+
const result = await this.client.cancelKnowledgeBaseIngest(validated.kb_name);
|
|
599
|
+
return this.formatSuccessResponse(result);
|
|
600
|
+
}
|
|
601
|
+
case 'test_connection': {
|
|
602
|
+
const { action: _, ...body } = validated;
|
|
603
|
+
const result = await this.client.testKnowledgeBaseConnection(body);
|
|
604
|
+
return this.formatSuccessResponse(result);
|
|
605
|
+
}
|
|
606
|
+
case 'list_connectors': {
|
|
607
|
+
const result = await this.client.listKnowledgeBaseConnectors();
|
|
608
|
+
return this.formatSuccessResponse(result);
|
|
609
|
+
}
|
|
610
|
+
case 'ingest_folder': {
|
|
611
|
+
const { action: _, kb_name, ...body } = validated;
|
|
612
|
+
const result = await this.client.ingestKnowledgeBaseFolder(kb_name, body);
|
|
613
|
+
return this.formatSuccessResponse(result);
|
|
614
|
+
}
|
|
615
|
+
case 'ingest_connector': {
|
|
616
|
+
const { action: _, kb_name, ...body } = validated;
|
|
617
|
+
const result = await this.client.ingestKnowledgeBaseConnector(kb_name, body);
|
|
618
|
+
return this.formatSuccessResponse(result);
|
|
619
|
+
}
|
|
620
|
+
case 'metadata_keys': {
|
|
621
|
+
const result = await this.client.getKnowledgeBaseMetadataKeys(validated.kb_name);
|
|
622
|
+
return this.formatSuccessResponse(result);
|
|
623
|
+
}
|
|
624
|
+
case 'list_runs': {
|
|
625
|
+
const { action: _, kb_name, ...params } = validated;
|
|
626
|
+
const result = await this.client.listKnowledgeBaseRuns(kb_name, params);
|
|
627
|
+
return this.formatSuccessResponse(result);
|
|
628
|
+
}
|
|
629
|
+
case 'get_run': {
|
|
630
|
+
const result = await this.client.getKnowledgeBaseRun(validated.kb_name, validated.run_id);
|
|
631
|
+
return this.formatSuccessResponse(result);
|
|
632
|
+
}
|
|
510
633
|
}
|
|
511
634
|
}
|
|
512
635
|
async handleFileTool(args) {
|
|
@@ -530,7 +653,7 @@ class LangflowMCPServerConsolidated {
|
|
|
530
653
|
flow_id: validated.flow_id,
|
|
531
654
|
file_name: validated.file_name
|
|
532
655
|
});
|
|
533
|
-
if (!fileData)
|
|
656
|
+
if (!fileData || (fileData.byteLength ?? fileData.length) === 0)
|
|
534
657
|
throw new Error('No file data received from server');
|
|
535
658
|
const base64Data = Buffer.from(fileData).toString('base64');
|
|
536
659
|
return this.formatSuccessResponse({ file_name: validated.file_name, content: base64Data });
|
|
@@ -547,7 +670,7 @@ class LangflowMCPServerConsolidated {
|
|
|
547
670
|
flow_id: validated.flow_id,
|
|
548
671
|
file_name: validated.file_name
|
|
549
672
|
});
|
|
550
|
-
if (!imageData)
|
|
673
|
+
if (!imageData || (imageData.byteLength ?? imageData.length) === 0)
|
|
551
674
|
throw new Error('No image data received from server');
|
|
552
675
|
const base64Data = Buffer.from(imageData).toString('base64');
|
|
553
676
|
return this.formatSuccessResponse({ file_name: validated.file_name, content: base64Data });
|
|
@@ -599,6 +722,48 @@ class LangflowMCPServerConsolidated {
|
|
|
599
722
|
const result = await this.client.getMonitorTransactions({ flow_id: flow_id, ...params });
|
|
600
723
|
return this.formatSuccessResponse(result);
|
|
601
724
|
}
|
|
725
|
+
case 'update_message': {
|
|
726
|
+
const { action: _, message_id, ...body } = validated;
|
|
727
|
+
const result = await this.client.updateMonitorMessage(message_id, body);
|
|
728
|
+
return this.formatSuccessResponse(result);
|
|
729
|
+
}
|
|
730
|
+
case 'delete_session_messages': {
|
|
731
|
+
const result = await this.client.deleteMonitorSessionMessages(validated.session_id);
|
|
732
|
+
return this.formatSuccessResponse(result);
|
|
733
|
+
}
|
|
734
|
+
case 'delete_sessions': {
|
|
735
|
+
const result = await this.client.deleteMonitorSessions(validated.session_ids);
|
|
736
|
+
return this.formatSuccessResponse(result);
|
|
737
|
+
}
|
|
738
|
+
case 'get_shared': {
|
|
739
|
+
const { action: _, ...params } = validated;
|
|
740
|
+
const result = await this.client.getSharedMessages(params);
|
|
741
|
+
return this.formatSuccessResponse(result);
|
|
742
|
+
}
|
|
743
|
+
case 'get_shared_sessions': {
|
|
744
|
+
const result = await this.client.getSharedSessions(validated.source_flow_id);
|
|
745
|
+
return this.formatSuccessResponse(result);
|
|
746
|
+
}
|
|
747
|
+
case 'update_shared': {
|
|
748
|
+
const { action: _, message_id, source_flow_id, ...body } = validated;
|
|
749
|
+
const result = await this.client.updateSharedMessage(message_id, source_flow_id, body);
|
|
750
|
+
return this.formatSuccessResponse(result);
|
|
751
|
+
}
|
|
752
|
+
case 'migrate_shared_session': {
|
|
753
|
+
const result = await this.client.migrateSharedSession(validated.session_id, {
|
|
754
|
+
new_session_id: validated.new_session_id,
|
|
755
|
+
source_flow_id: validated.source_flow_id
|
|
756
|
+
});
|
|
757
|
+
return this.formatSuccessResponse(result);
|
|
758
|
+
}
|
|
759
|
+
case 'delete_shared_session': {
|
|
760
|
+
const result = await this.client.deleteSharedSession(validated.session_id, validated.source_flow_id);
|
|
761
|
+
return this.formatSuccessResponse(result);
|
|
762
|
+
}
|
|
763
|
+
case 'job_queue': {
|
|
764
|
+
const result = await this.client.getJobQueueMetrics();
|
|
765
|
+
return this.formatSuccessResponse(result);
|
|
766
|
+
}
|
|
602
767
|
}
|
|
603
768
|
}
|
|
604
769
|
async handleUserTool(args) {
|
|
@@ -611,10 +776,6 @@ class LangflowMCPServerConsolidated {
|
|
|
611
776
|
const result = await this.client.listUsers(params);
|
|
612
777
|
return this.formatSuccessResponse(result);
|
|
613
778
|
}
|
|
614
|
-
case 'get': {
|
|
615
|
-
const result = await this.client.getUser(validated.user_id);
|
|
616
|
-
return this.formatSuccessResponse(result);
|
|
617
|
-
}
|
|
618
779
|
case 'get_current': {
|
|
619
780
|
const result = await this.client.getCurrentUser();
|
|
620
781
|
return this.formatSuccessResponse(result);
|
|
@@ -628,6 +789,11 @@ class LangflowMCPServerConsolidated {
|
|
|
628
789
|
const result = await this.client.resetUserPassword(validated.user_id, validated.new_password);
|
|
629
790
|
return this.formatSuccessResponse(result);
|
|
630
791
|
}
|
|
792
|
+
case 'create': {
|
|
793
|
+
const { action: _, ...body } = validated;
|
|
794
|
+
const result = await this.client.createUser(body);
|
|
795
|
+
return this.formatSuccessResponse(result);
|
|
796
|
+
}
|
|
631
797
|
}
|
|
632
798
|
}
|
|
633
799
|
async handleAuthTool(args) {
|
|
@@ -664,6 +830,10 @@ class LangflowMCPServerConsolidated {
|
|
|
664
830
|
await this.client.deleteApiKey(validated.api_key_id);
|
|
665
831
|
return this.formatSuccessResponse({ success: true, message: 'API key deleted successfully' });
|
|
666
832
|
}
|
|
833
|
+
case 'save_store_key': {
|
|
834
|
+
const result = await this.client.saveStoreApiKey(validated.api_key);
|
|
835
|
+
return this.formatSuccessResponse(result);
|
|
836
|
+
}
|
|
667
837
|
}
|
|
668
838
|
}
|
|
669
839
|
async handleStoreTool(args) {
|
|
@@ -673,10 +843,6 @@ class LangflowMCPServerConsolidated {
|
|
|
673
843
|
const components = await this.client.listComponents();
|
|
674
844
|
return this.formatSuccessResponse(components);
|
|
675
845
|
}
|
|
676
|
-
case 'list_custom': {
|
|
677
|
-
const result = await this.client.listCustomComponents();
|
|
678
|
-
return this.formatSuccessResponse(result);
|
|
679
|
-
}
|
|
680
846
|
case 'create_custom': {
|
|
681
847
|
const result = await this.client.createCustomComponent({ name: validated.name, code: validated.code });
|
|
682
848
|
return this.formatSuccessResponse(result);
|
|
@@ -706,6 +872,25 @@ class LangflowMCPServerConsolidated {
|
|
|
706
872
|
const likes = await this.client.getUserLikes();
|
|
707
873
|
return this.formatSuccessResponse(likes);
|
|
708
874
|
}
|
|
875
|
+
case 'create_store': {
|
|
876
|
+
const { action: _, ...body } = validated;
|
|
877
|
+
const result = await this.client.createStoreComponent({
|
|
878
|
+
description: null,
|
|
879
|
+
tags: null,
|
|
880
|
+
is_component: null,
|
|
881
|
+
...body
|
|
882
|
+
});
|
|
883
|
+
return this.formatSuccessResponse(result);
|
|
884
|
+
}
|
|
885
|
+
case 'like': {
|
|
886
|
+
const result = await this.client.likeStoreComponent(validated.component_id);
|
|
887
|
+
return this.formatSuccessResponse(result);
|
|
888
|
+
}
|
|
889
|
+
case 'update_custom': {
|
|
890
|
+
const { action: _, ...body } = validated;
|
|
891
|
+
const result = await this.client.updateCustomComponentCode(body);
|
|
892
|
+
return this.formatSuccessResponse(result);
|
|
893
|
+
}
|
|
709
894
|
}
|
|
710
895
|
}
|
|
711
896
|
async handleRegistrationTool(args) {
|
|
@@ -755,7 +940,7 @@ class LangflowMCPServerConsolidated {
|
|
|
755
940
|
}
|
|
756
941
|
case 'get_picture': {
|
|
757
942
|
const pictureData = await this.client.getProfilePicture(validated.folder_name, validated.file_name);
|
|
758
|
-
if (!pictureData)
|
|
943
|
+
if (!pictureData || (pictureData.byteLength ?? pictureData.length) === 0)
|
|
759
944
|
throw new Error('No picture data received from server');
|
|
760
945
|
const base64Data = Buffer.from(pictureData).toString('base64');
|
|
761
946
|
return this.formatSuccessResponse({ file_name: validated.file_name, content: base64Data });
|
|
@@ -764,6 +949,571 @@ class LangflowMCPServerConsolidated {
|
|
|
764
949
|
const voices = await this.client.listElevenLabsVoices();
|
|
765
950
|
return this.formatSuccessResponse(voices);
|
|
766
951
|
}
|
|
952
|
+
case 'session': {
|
|
953
|
+
const result = await this.client.getSession();
|
|
954
|
+
return this.formatSuccessResponse(result);
|
|
955
|
+
}
|
|
956
|
+
case 'webhook_events': {
|
|
957
|
+
const result = await this.client.getWebhookEvents(validated.flow_id_or_name, validated.user_id ? { user_id: validated.user_id } : undefined);
|
|
958
|
+
return this.formatSuccessResponse(result);
|
|
959
|
+
}
|
|
960
|
+
case 'health_check': {
|
|
961
|
+
const result = await this.client.getHealthCheck();
|
|
962
|
+
return this.formatSuccessResponse(result);
|
|
963
|
+
}
|
|
964
|
+
case 'healthz': {
|
|
965
|
+
const result = await this.client.getHealthz();
|
|
966
|
+
return this.formatSuccessResponse(result);
|
|
967
|
+
}
|
|
968
|
+
}
|
|
969
|
+
}
|
|
970
|
+
async handleFlowVersionTool(args) {
|
|
971
|
+
const validated = validation_consolidated_1.FlowVersionToolSchema.parse(args);
|
|
972
|
+
switch (validated.action) {
|
|
973
|
+
case 'list': {
|
|
974
|
+
const { action: _, flow_id, ...params } = validated;
|
|
975
|
+
const result = await this.client.listFlowVersions(flow_id, params);
|
|
976
|
+
return this.formatSuccessResponse(result);
|
|
977
|
+
}
|
|
978
|
+
case 'create': {
|
|
979
|
+
const result = await this.client.createFlowVersion(validated.flow_id, validated.body);
|
|
980
|
+
return this.formatSuccessResponse(result);
|
|
981
|
+
}
|
|
982
|
+
case 'get': {
|
|
983
|
+
const result = await this.client.getFlowVersion(validated.flow_id, validated.version_id);
|
|
984
|
+
return this.formatSuccessResponse(result);
|
|
985
|
+
}
|
|
986
|
+
case 'delete': {
|
|
987
|
+
await this.client.deleteFlowVersion(validated.flow_id, validated.version_id);
|
|
988
|
+
return this.formatSuccessResponse({ success: true, message: 'Flow version deleted successfully' });
|
|
989
|
+
}
|
|
990
|
+
case 'activate': {
|
|
991
|
+
const result = await this.client.activateFlowVersion(validated.flow_id, validated.version_id, validated.save_draft !== undefined ? { save_draft: validated.save_draft } : undefined);
|
|
992
|
+
return this.formatSuccessResponse(result);
|
|
993
|
+
}
|
|
994
|
+
case 'get_events': {
|
|
995
|
+
const result = await this.client.getFlowEvents(validated.flow_id, validated.since !== undefined ? { since: validated.since } : undefined);
|
|
996
|
+
return this.formatSuccessResponse(result);
|
|
997
|
+
}
|
|
998
|
+
case 'create_event': {
|
|
999
|
+
const { action: _, flow_id, ...body } = validated;
|
|
1000
|
+
const result = await this.client.createFlowEvent(flow_id, body);
|
|
1001
|
+
return this.formatSuccessResponse(result);
|
|
1002
|
+
}
|
|
1003
|
+
}
|
|
1004
|
+
}
|
|
1005
|
+
async handleFileV2Tool(args) {
|
|
1006
|
+
const validated = validation_consolidated_1.FileV2ToolSchema.parse(args);
|
|
1007
|
+
switch (validated.action) {
|
|
1008
|
+
case 'list': {
|
|
1009
|
+
const result = await this.client.listFilesV2();
|
|
1010
|
+
return this.formatSuccessResponse(result);
|
|
1011
|
+
}
|
|
1012
|
+
case 'upload': {
|
|
1013
|
+
const fileBuffer = this.validateFileSize(validated.file_content);
|
|
1014
|
+
const params = {};
|
|
1015
|
+
if (validated.append !== undefined)
|
|
1016
|
+
params.append = validated.append;
|
|
1017
|
+
if (validated.ephemeral !== undefined)
|
|
1018
|
+
params.ephemeral = validated.ephemeral;
|
|
1019
|
+
const result = await this.client.uploadFileV2(fileBuffer, validated.file_name, params);
|
|
1020
|
+
return this.formatSuccessResponse(result);
|
|
1021
|
+
}
|
|
1022
|
+
case 'get': {
|
|
1023
|
+
const result = await this.client.getFileV2(validated.file_id, validated.return_content !== undefined ? { return_content: validated.return_content } : undefined);
|
|
1024
|
+
return this.formatSuccessResponse(result);
|
|
1025
|
+
}
|
|
1026
|
+
case 'rename': {
|
|
1027
|
+
const result = await this.client.renameFileV2(validated.file_id, validated.name);
|
|
1028
|
+
return this.formatSuccessResponse(result);
|
|
1029
|
+
}
|
|
1030
|
+
case 'delete': {
|
|
1031
|
+
const result = await this.client.deleteFileV2(validated.file_id);
|
|
1032
|
+
return this.formatSuccessResponse(result);
|
|
1033
|
+
}
|
|
1034
|
+
case 'delete_all': {
|
|
1035
|
+
const result = await this.client.deleteAllFilesV2();
|
|
1036
|
+
return this.formatSuccessResponse(result);
|
|
1037
|
+
}
|
|
1038
|
+
case 'batch_download': {
|
|
1039
|
+
const result = await this.client.batchDownloadFilesV2(validated.file_ids);
|
|
1040
|
+
return this.formatSuccessResponse(result);
|
|
1041
|
+
}
|
|
1042
|
+
case 'batch_delete': {
|
|
1043
|
+
const result = await this.client.batchDeleteFilesV2(validated.file_ids);
|
|
1044
|
+
return this.formatSuccessResponse(result);
|
|
1045
|
+
}
|
|
1046
|
+
}
|
|
1047
|
+
}
|
|
1048
|
+
async handleModelTool(args) {
|
|
1049
|
+
const validated = validation_consolidated_1.ModelToolSchema.parse(args);
|
|
1050
|
+
switch (validated.action) {
|
|
1051
|
+
case 'list': {
|
|
1052
|
+
const { action: _, ...params } = validated;
|
|
1053
|
+
const result = await this.client.listModels(params);
|
|
1054
|
+
return this.formatSuccessResponse(result);
|
|
1055
|
+
}
|
|
1056
|
+
case 'providers': {
|
|
1057
|
+
const result = await this.client.listModelProviders(validated.purpose ? { purpose: validated.purpose } : undefined);
|
|
1058
|
+
return this.formatSuccessResponse(result);
|
|
1059
|
+
}
|
|
1060
|
+
case 'provider_descriptors': {
|
|
1061
|
+
const result = await this.client.listModelProviderDescriptors(validated.purpose ? { purpose: validated.purpose } : undefined);
|
|
1062
|
+
return this.formatSuccessResponse(result);
|
|
1063
|
+
}
|
|
1064
|
+
case 'enabled_providers': {
|
|
1065
|
+
const result = await this.client.listEnabledProviders(validated.providers || validated.purpose
|
|
1066
|
+
? { providers: validated.providers, purpose: validated.purpose }
|
|
1067
|
+
: undefined);
|
|
1068
|
+
return this.formatSuccessResponse(result);
|
|
1069
|
+
}
|
|
1070
|
+
case 'enabled_models': {
|
|
1071
|
+
const result = await this.client.listEnabledModels(validated.model_names || validated.purpose
|
|
1072
|
+
? { model_names: validated.model_names, purpose: validated.purpose }
|
|
1073
|
+
: undefined);
|
|
1074
|
+
return this.formatSuccessResponse(result);
|
|
1075
|
+
}
|
|
1076
|
+
case 'set_enabled': {
|
|
1077
|
+
const result = await this.client.setEnabledModels(validated.models);
|
|
1078
|
+
return this.formatSuccessResponse(result);
|
|
1079
|
+
}
|
|
1080
|
+
case 'get_default': {
|
|
1081
|
+
const result = await this.client.getDefaultModel({ model_type: validated.model_type });
|
|
1082
|
+
return this.formatSuccessResponse(result);
|
|
1083
|
+
}
|
|
1084
|
+
case 'set_default': {
|
|
1085
|
+
const result = await this.client.setDefaultModel({
|
|
1086
|
+
provider: validated.provider,
|
|
1087
|
+
model_name: validated.model_name,
|
|
1088
|
+
model_type: validated.model_type
|
|
1089
|
+
});
|
|
1090
|
+
return this.formatSuccessResponse(result);
|
|
1091
|
+
}
|
|
1092
|
+
case 'delete_default': {
|
|
1093
|
+
const result = await this.client.deleteDefaultModel({ model_type: validated.model_type });
|
|
1094
|
+
return this.formatSuccessResponse(result);
|
|
1095
|
+
}
|
|
1096
|
+
case 'provider_mapping': {
|
|
1097
|
+
const result = await this.client.getProviderVariableMapping(validated.purpose ? { purpose: validated.purpose } : undefined);
|
|
1098
|
+
return this.formatSuccessResponse(result);
|
|
1099
|
+
}
|
|
1100
|
+
case 'validate_provider': {
|
|
1101
|
+
const result = await this.client.validateModelProvider({
|
|
1102
|
+
provider: validated.provider,
|
|
1103
|
+
variables: validated.variables
|
|
1104
|
+
});
|
|
1105
|
+
return this.formatSuccessResponse(result);
|
|
1106
|
+
}
|
|
1107
|
+
case 'options_language': {
|
|
1108
|
+
const result = await this.client.getLanguageModelOptions(validated.purpose ? { purpose: validated.purpose } : undefined);
|
|
1109
|
+
return this.formatSuccessResponse(result);
|
|
1110
|
+
}
|
|
1111
|
+
case 'options_embedding': {
|
|
1112
|
+
const result = await this.client.getEmbeddingModelOptions(validated.purpose ? { purpose: validated.purpose } : undefined);
|
|
1113
|
+
return this.formatSuccessResponse(result);
|
|
1114
|
+
}
|
|
1115
|
+
}
|
|
1116
|
+
}
|
|
1117
|
+
async handleAgenticTool(args) {
|
|
1118
|
+
const validated = validation_consolidated_1.AgenticToolSchema.parse(args);
|
|
1119
|
+
switch (validated.action) {
|
|
1120
|
+
case 'assist': {
|
|
1121
|
+
const { action: _, ...body } = validated;
|
|
1122
|
+
const result = await this.client.agenticAssist(body);
|
|
1123
|
+
return this.formatSuccessResponse(result);
|
|
1124
|
+
}
|
|
1125
|
+
case 'assist_stream': {
|
|
1126
|
+
const { action: _, ...body } = validated;
|
|
1127
|
+
const result = await this.client.agenticAssistStream(body);
|
|
1128
|
+
return this.formatSuccessResponse(result);
|
|
1129
|
+
}
|
|
1130
|
+
case 'assist_run': {
|
|
1131
|
+
const { action: _, ...body } = validated;
|
|
1132
|
+
const result = await this.client.agenticAssistRun(body);
|
|
1133
|
+
return this.formatSuccessResponse(result);
|
|
1134
|
+
}
|
|
1135
|
+
case 'check_config': {
|
|
1136
|
+
const result = await this.client.agenticCheckConfig();
|
|
1137
|
+
return this.formatSuccessResponse(result);
|
|
1138
|
+
}
|
|
1139
|
+
case 'execute': {
|
|
1140
|
+
const { action: _, flow_name, ...body } = validated;
|
|
1141
|
+
const result = await this.client.agenticExecute(flow_name, body);
|
|
1142
|
+
return this.formatSuccessResponse(result);
|
|
1143
|
+
}
|
|
1144
|
+
case 'get_file': {
|
|
1145
|
+
const result = await this.client.getAgenticFile({
|
|
1146
|
+
path: validated.path,
|
|
1147
|
+
download: validated.download
|
|
1148
|
+
});
|
|
1149
|
+
return this.formatSuccessResponse(result);
|
|
1150
|
+
}
|
|
1151
|
+
case 'reset_session': {
|
|
1152
|
+
const result = await this.client.resetAgenticSession(validated.session_id !== undefined ? { session_id: validated.session_id } : undefined);
|
|
1153
|
+
return this.formatSuccessResponse(result);
|
|
1154
|
+
}
|
|
1155
|
+
}
|
|
1156
|
+
}
|
|
1157
|
+
async handleGovernanceTool(args) {
|
|
1158
|
+
const validated = validation_consolidated_1.GovernanceToolSchema.parse(args);
|
|
1159
|
+
switch (validated.action) {
|
|
1160
|
+
case 'get_model_provider_policy':
|
|
1161
|
+
return this.formatSuccessResponse(await this.client.getModelProviderPolicy());
|
|
1162
|
+
case 'replace_model_provider_policy': {
|
|
1163
|
+
const { action: _, ...body } = validated;
|
|
1164
|
+
return this.formatSuccessResponse(await this.client.replaceModelProviderPolicy(body));
|
|
1165
|
+
}
|
|
1166
|
+
case 'get_catalog_component_policy':
|
|
1167
|
+
return this.formatSuccessResponse(await this.client.getCatalogComponentPolicy());
|
|
1168
|
+
case 'replace_catalog_component_policy':
|
|
1169
|
+
return this.formatSuccessResponse(await this.client.replaceCatalogComponentPolicy({ blocked: validated.blocked }));
|
|
1170
|
+
case 'get_catalog_template_policy':
|
|
1171
|
+
return this.formatSuccessResponse(await this.client.getCatalogTemplatePolicy());
|
|
1172
|
+
case 'replace_catalog_template_policy':
|
|
1173
|
+
return this.formatSuccessResponse(await this.client.replaceCatalogTemplatePolicy({ blocked: validated.blocked }));
|
|
1174
|
+
case 'get_catalog_policy_usage':
|
|
1175
|
+
return this.formatSuccessResponse(await this.client.getCatalogPolicyUsage());
|
|
1176
|
+
case 'get_catalog_policy_usage_flows':
|
|
1177
|
+
return this.formatSuccessResponse(await this.client.getCatalogPolicyUsageFlows({
|
|
1178
|
+
component: validated.component,
|
|
1179
|
+
limit: validated.limit
|
|
1180
|
+
}));
|
|
1181
|
+
case 'get_policy_bundle':
|
|
1182
|
+
return this.formatSuccessResponse(await this.client.getPolicyBundle());
|
|
1183
|
+
case 'replace_policy_bundle': {
|
|
1184
|
+
const { action: _, ...body } = validated;
|
|
1185
|
+
return this.formatSuccessResponse(await this.client.replacePolicyBundle(body));
|
|
1186
|
+
}
|
|
1187
|
+
case 'list_policy_bundle_history':
|
|
1188
|
+
return this.formatSuccessResponse(await this.client.listPolicyBundleHistory({
|
|
1189
|
+
limit: validated.limit,
|
|
1190
|
+
before_revision: validated.before_revision
|
|
1191
|
+
}));
|
|
1192
|
+
case 'rollback_policy_bundle': {
|
|
1193
|
+
const { action: _, revision, ...body } = validated;
|
|
1194
|
+
return this.formatSuccessResponse(await this.client.rollbackPolicyBundle(revision, body));
|
|
1195
|
+
}
|
|
1196
|
+
}
|
|
1197
|
+
}
|
|
1198
|
+
async handleWorkflowTool(args) {
|
|
1199
|
+
const validated = validation_consolidated_1.WorkflowToolSchema.parse(args);
|
|
1200
|
+
switch (validated.action) {
|
|
1201
|
+
case 'run': {
|
|
1202
|
+
const { action: _, ...body } = validated;
|
|
1203
|
+
const result = await this.client.runWorkflow(body);
|
|
1204
|
+
return this.formatSuccessResponse(result);
|
|
1205
|
+
}
|
|
1206
|
+
case 'get_result': {
|
|
1207
|
+
const result = await this.client.getWorkflowResult(validated.job_id ? { job_id: validated.job_id } : undefined);
|
|
1208
|
+
return this.formatSuccessResponse(result);
|
|
1209
|
+
}
|
|
1210
|
+
case 'stop': {
|
|
1211
|
+
const result = await this.client.stopWorkflow(validated.job_id);
|
|
1212
|
+
return this.formatSuccessResponse(result);
|
|
1213
|
+
}
|
|
1214
|
+
case 'pending': {
|
|
1215
|
+
const result = await this.client.listPendingWorkflows({ flow_id: validated.flow_id });
|
|
1216
|
+
return this.formatSuccessResponse(result);
|
|
1217
|
+
}
|
|
1218
|
+
case 'events': {
|
|
1219
|
+
const result = await this.client.getWorkflowEvents(validated.job_id);
|
|
1220
|
+
return this.formatSuccessResponse(result);
|
|
1221
|
+
}
|
|
1222
|
+
case 'resume': {
|
|
1223
|
+
const { action: _, job_id, ...body } = validated;
|
|
1224
|
+
const result = await this.client.resumeWorkflow(job_id, body);
|
|
1225
|
+
return this.formatSuccessResponse(result);
|
|
1226
|
+
}
|
|
1227
|
+
case 'run_public': {
|
|
1228
|
+
const { action: _, ...body } = validated;
|
|
1229
|
+
const result = await this.client.runPublicWorkflow(body);
|
|
1230
|
+
return this.formatSuccessResponse(result);
|
|
1231
|
+
}
|
|
1232
|
+
}
|
|
1233
|
+
}
|
|
1234
|
+
async handleA2aTool(args) {
|
|
1235
|
+
const validated = validation_consolidated_1.A2aToolSchema.parse(args);
|
|
1236
|
+
switch (validated.action) {
|
|
1237
|
+
case 'list_agents': {
|
|
1238
|
+
const result = await this.client.listA2aAgents();
|
|
1239
|
+
return this.formatSuccessResponse(result);
|
|
1240
|
+
}
|
|
1241
|
+
case 'agent_card': {
|
|
1242
|
+
const result = await this.client.getA2aAgentCard(validated.flow_id);
|
|
1243
|
+
return this.formatSuccessResponse(result);
|
|
1244
|
+
}
|
|
1245
|
+
case 'jsonrpc': {
|
|
1246
|
+
const { action: _, flow_id, ...body } = validated;
|
|
1247
|
+
const result = await this.client.invokeA2aJsonrpc(flow_id, body);
|
|
1248
|
+
return this.formatSuccessResponse(result);
|
|
1249
|
+
}
|
|
1250
|
+
}
|
|
1251
|
+
}
|
|
1252
|
+
async handleMcpServerTool(args) {
|
|
1253
|
+
const validated = validation_consolidated_1.McpServerToolSchema.parse(args);
|
|
1254
|
+
switch (validated.action) {
|
|
1255
|
+
case 'list': {
|
|
1256
|
+
const result = await this.client.listMcpServers(validated.action_count !== undefined ? { action_count: validated.action_count } : undefined);
|
|
1257
|
+
return this.formatSuccessResponse(result);
|
|
1258
|
+
}
|
|
1259
|
+
case 'get': {
|
|
1260
|
+
const result = await this.client.getMcpServer(validated.server_name);
|
|
1261
|
+
return this.formatSuccessResponse(result);
|
|
1262
|
+
}
|
|
1263
|
+
case 'create': {
|
|
1264
|
+
const result = await this.client.createMcpServer(validated.server_name, validated.config);
|
|
1265
|
+
return this.formatSuccessResponse(result);
|
|
1266
|
+
}
|
|
1267
|
+
case 'update': {
|
|
1268
|
+
const result = await this.client.updateMcpServer(validated.server_name, validated.config);
|
|
1269
|
+
return this.formatSuccessResponse(result);
|
|
1270
|
+
}
|
|
1271
|
+
case 'delete': {
|
|
1272
|
+
const result = await this.client.deleteMcpServer(validated.server_name);
|
|
1273
|
+
return this.formatSuccessResponse(result);
|
|
1274
|
+
}
|
|
1275
|
+
}
|
|
1276
|
+
}
|
|
1277
|
+
async handleMcpProjectTool(args) {
|
|
1278
|
+
const validated = validation_consolidated_1.McpProjectToolSchema.parse(args);
|
|
1279
|
+
switch (validated.action) {
|
|
1280
|
+
case 'get_config': {
|
|
1281
|
+
const result = await this.client.getMcpProjectConfig(validated.project_id, validated.mcp_enabled !== undefined ? { mcp_enabled: validated.mcp_enabled } : undefined);
|
|
1282
|
+
return this.formatSuccessResponse(result);
|
|
1283
|
+
}
|
|
1284
|
+
case 'update_config': {
|
|
1285
|
+
const result = await this.client.updateMcpProjectConfig(validated.project_id, {
|
|
1286
|
+
settings: validated.settings,
|
|
1287
|
+
auth_settings: validated.auth_settings
|
|
1288
|
+
});
|
|
1289
|
+
return this.formatSuccessResponse(result);
|
|
1290
|
+
}
|
|
1291
|
+
case 'get_installed': {
|
|
1292
|
+
const result = await this.client.getMcpProjectInstalled(validated.project_id);
|
|
1293
|
+
return this.formatSuccessResponse(result);
|
|
1294
|
+
}
|
|
1295
|
+
case 'install': {
|
|
1296
|
+
const result = await this.client.installMcpProject(validated.project_id, {
|
|
1297
|
+
client: validated.client,
|
|
1298
|
+
transport: validated.transport
|
|
1299
|
+
});
|
|
1300
|
+
return this.formatSuccessResponse(result);
|
|
1301
|
+
}
|
|
1302
|
+
case 'get_composer_url': {
|
|
1303
|
+
const result = await this.client.getMcpProjectComposerUrl(validated.project_id);
|
|
1304
|
+
return this.formatSuccessResponse(result);
|
|
1305
|
+
}
|
|
1306
|
+
}
|
|
1307
|
+
}
|
|
1308
|
+
async handleTraceTool(args) {
|
|
1309
|
+
const validated = validation_consolidated_1.TraceToolSchema.parse(args);
|
|
1310
|
+
switch (validated.action) {
|
|
1311
|
+
case 'list': {
|
|
1312
|
+
const { action: _, ...params } = validated;
|
|
1313
|
+
const result = await this.client.listTraces(params);
|
|
1314
|
+
return this.formatSuccessResponse(result);
|
|
1315
|
+
}
|
|
1316
|
+
case 'get': {
|
|
1317
|
+
const result = await this.client.getTrace(validated.trace_id);
|
|
1318
|
+
return this.formatSuccessResponse(result);
|
|
1319
|
+
}
|
|
1320
|
+
case 'delete': {
|
|
1321
|
+
await this.client.deleteTrace(validated.trace_id);
|
|
1322
|
+
return this.formatSuccessResponse({ success: true, message: 'Trace deleted successfully' });
|
|
1323
|
+
}
|
|
1324
|
+
case 'delete_by_flow': {
|
|
1325
|
+
const result = await this.client.deleteTraces(validated.flow_id);
|
|
1326
|
+
return this.formatSuccessResponse(result);
|
|
1327
|
+
}
|
|
1328
|
+
}
|
|
1329
|
+
}
|
|
1330
|
+
async handleResponseTool(args) {
|
|
1331
|
+
const validated = validation_consolidated_1.ResponseToolSchema.parse(args);
|
|
1332
|
+
switch (validated.action) {
|
|
1333
|
+
case 'create': {
|
|
1334
|
+
const { action: _, ...body } = validated;
|
|
1335
|
+
const result = await this.client.createResponse(body);
|
|
1336
|
+
return this.formatSuccessResponse(result);
|
|
1337
|
+
}
|
|
1338
|
+
}
|
|
1339
|
+
}
|
|
1340
|
+
async handleAuthzTool(args) {
|
|
1341
|
+
const validated = validation_consolidated_1.AuthzToolSchema.parse(args);
|
|
1342
|
+
switch (validated.action) {
|
|
1343
|
+
case 'list_roles': {
|
|
1344
|
+
const { action: _, ...params } = validated;
|
|
1345
|
+
const result = await this.client.listAuthzRoles(params);
|
|
1346
|
+
return this.formatSuccessResponse(result);
|
|
1347
|
+
}
|
|
1348
|
+
case 'get_role': {
|
|
1349
|
+
const result = await this.client.getAuthzRole(validated.role_id);
|
|
1350
|
+
return this.formatSuccessResponse(result);
|
|
1351
|
+
}
|
|
1352
|
+
case 'create_role': {
|
|
1353
|
+
const { action: _, ...body } = validated;
|
|
1354
|
+
const result = await this.client.createAuthzRole(body);
|
|
1355
|
+
return this.formatSuccessResponse(result);
|
|
1356
|
+
}
|
|
1357
|
+
case 'update_role': {
|
|
1358
|
+
const { action: _, role_id, ...body } = validated;
|
|
1359
|
+
const result = await this.client.updateAuthzRole(role_id, body);
|
|
1360
|
+
return this.formatSuccessResponse(result);
|
|
1361
|
+
}
|
|
1362
|
+
case 'delete_role': {
|
|
1363
|
+
await this.client.deleteAuthzRole(validated.role_id);
|
|
1364
|
+
return this.formatSuccessResponse({ success: true, message: 'Role deleted successfully' });
|
|
1365
|
+
}
|
|
1366
|
+
case 'list_role_assignments': {
|
|
1367
|
+
const { action: _, ...params } = validated;
|
|
1368
|
+
const result = await this.client.listAuthzRoleAssignments(params);
|
|
1369
|
+
return this.formatSuccessResponse(result);
|
|
1370
|
+
}
|
|
1371
|
+
case 'create_role_assignment': {
|
|
1372
|
+
const { action: _, ...body } = validated;
|
|
1373
|
+
const result = await this.client.createAuthzRoleAssignment(body);
|
|
1374
|
+
return this.formatSuccessResponse(result);
|
|
1375
|
+
}
|
|
1376
|
+
case 'delete_role_assignment': {
|
|
1377
|
+
await this.client.deleteAuthzRoleAssignment(validated.assignment_id);
|
|
1378
|
+
return this.formatSuccessResponse({ success: true, message: 'Role assignment deleted successfully' });
|
|
1379
|
+
}
|
|
1380
|
+
case 'list_teams': {
|
|
1381
|
+
const { action: _, ...params } = validated;
|
|
1382
|
+
const result = await this.client.listAuthzTeams(params);
|
|
1383
|
+
return this.formatSuccessResponse(result);
|
|
1384
|
+
}
|
|
1385
|
+
case 'get_team': {
|
|
1386
|
+
const result = await this.client.getAuthzTeam(validated.team_id);
|
|
1387
|
+
return this.formatSuccessResponse(result);
|
|
1388
|
+
}
|
|
1389
|
+
case 'create_team': {
|
|
1390
|
+
const { action: _, ...body } = validated;
|
|
1391
|
+
const result = await this.client.createAuthzTeam(body);
|
|
1392
|
+
return this.formatSuccessResponse(result);
|
|
1393
|
+
}
|
|
1394
|
+
case 'update_team': {
|
|
1395
|
+
const { action: _, team_id, ...body } = validated;
|
|
1396
|
+
const result = await this.client.updateAuthzTeam(team_id, body);
|
|
1397
|
+
return this.formatSuccessResponse(result);
|
|
1398
|
+
}
|
|
1399
|
+
case 'delete_team': {
|
|
1400
|
+
await this.client.deleteAuthzTeam(validated.team_id);
|
|
1401
|
+
return this.formatSuccessResponse({ success: true, message: 'Team deleted successfully' });
|
|
1402
|
+
}
|
|
1403
|
+
case 'list_team_members': {
|
|
1404
|
+
const { action: _, team_id, ...params } = validated;
|
|
1405
|
+
const result = await this.client.listAuthzTeamMembers(team_id, params);
|
|
1406
|
+
return this.formatSuccessResponse(result);
|
|
1407
|
+
}
|
|
1408
|
+
case 'add_team_member': {
|
|
1409
|
+
const { action: _, team_id, ...body } = validated;
|
|
1410
|
+
const result = await this.client.addAuthzTeamMember(team_id, body);
|
|
1411
|
+
return this.formatSuccessResponse(result);
|
|
1412
|
+
}
|
|
1413
|
+
case 'remove_team_member': {
|
|
1414
|
+
await this.client.removeAuthzTeamMember(validated.team_id, validated.user_id);
|
|
1415
|
+
return this.formatSuccessResponse({ success: true, message: 'Team member removed successfully' });
|
|
1416
|
+
}
|
|
1417
|
+
case 'list_shares': {
|
|
1418
|
+
const { action: _, ...params } = validated;
|
|
1419
|
+
const result = await this.client.listAuthzShares(params);
|
|
1420
|
+
return this.formatSuccessResponse(result);
|
|
1421
|
+
}
|
|
1422
|
+
case 'get_share': {
|
|
1423
|
+
const result = await this.client.getAuthzShare(validated.share_id);
|
|
1424
|
+
return this.formatSuccessResponse(result);
|
|
1425
|
+
}
|
|
1426
|
+
case 'create_share': {
|
|
1427
|
+
const { action: _, ...body } = validated;
|
|
1428
|
+
const result = await this.client.createAuthzShare(body);
|
|
1429
|
+
return this.formatSuccessResponse(result);
|
|
1430
|
+
}
|
|
1431
|
+
case 'update_share': {
|
|
1432
|
+
const result = await this.client.updateAuthzShare(validated.share_id, {
|
|
1433
|
+
permission_level: validated.permission_level
|
|
1434
|
+
});
|
|
1435
|
+
return this.formatSuccessResponse(result);
|
|
1436
|
+
}
|
|
1437
|
+
case 'delete_share': {
|
|
1438
|
+
await this.client.deleteAuthzShare(validated.share_id);
|
|
1439
|
+
return this.formatSuccessResponse({ success: true, message: 'Share deleted successfully' });
|
|
1440
|
+
}
|
|
1441
|
+
case 'audit': {
|
|
1442
|
+
const { action: _, audit_action, ...rest } = validated;
|
|
1443
|
+
const params = { ...rest, ...(audit_action !== undefined ? { action: audit_action } : {}) };
|
|
1444
|
+
const result = await this.client.getAuthzAudit(params);
|
|
1445
|
+
return this.formatSuccessResponse(result);
|
|
1446
|
+
}
|
|
1447
|
+
case 'my_permissions': {
|
|
1448
|
+
const { action: _, ...body } = validated;
|
|
1449
|
+
const result = await this.client.getMyPermissions(body);
|
|
1450
|
+
return this.formatSuccessResponse(result);
|
|
1451
|
+
}
|
|
1452
|
+
}
|
|
1453
|
+
}
|
|
1454
|
+
async handleMemoryTool(args) {
|
|
1455
|
+
const validated = validation_consolidated_1.MemoryToolSchema.parse(args);
|
|
1456
|
+
switch (validated.action) {
|
|
1457
|
+
case 'create': {
|
|
1458
|
+
const { action: _, ...body } = validated;
|
|
1459
|
+
const result = await this.client.createMemoryBase(body);
|
|
1460
|
+
return this.formatSuccessResponse(result);
|
|
1461
|
+
}
|
|
1462
|
+
case 'list': {
|
|
1463
|
+
const { action: _, ...params } = validated;
|
|
1464
|
+
const result = await this.client.listMemoryBases(params);
|
|
1465
|
+
return this.formatSuccessResponse(result);
|
|
1466
|
+
}
|
|
1467
|
+
case 'get': {
|
|
1468
|
+
const result = await this.client.getMemoryBase(validated.memory_base_id);
|
|
1469
|
+
return this.formatSuccessResponse(result);
|
|
1470
|
+
}
|
|
1471
|
+
case 'list_sessions': {
|
|
1472
|
+
const { action: _, memory_base_id, ...params } = validated;
|
|
1473
|
+
const result = await this.client.listMemoryBaseSessions(memory_base_id, params);
|
|
1474
|
+
return this.formatSuccessResponse(result);
|
|
1475
|
+
}
|
|
1476
|
+
case 'list_messages': {
|
|
1477
|
+
const { action: _, memory_base_id, ...params } = validated;
|
|
1478
|
+
const result = await this.client.listMemoryBaseMessages(memory_base_id, params);
|
|
1479
|
+
return this.formatSuccessResponse(result);
|
|
1480
|
+
}
|
|
1481
|
+
case 'update': {
|
|
1482
|
+
const { action: _, memory_base_id, ...body } = validated;
|
|
1483
|
+
const result = await this.client.updateMemoryBase(memory_base_id, body);
|
|
1484
|
+
return this.formatSuccessResponse(result);
|
|
1485
|
+
}
|
|
1486
|
+
case 'delete': {
|
|
1487
|
+
await this.client.deleteMemoryBase(validated.memory_base_id);
|
|
1488
|
+
return this.formatSuccessResponse({ success: true, message: 'Memory base deleted successfully' });
|
|
1489
|
+
}
|
|
1490
|
+
case 'flush': {
|
|
1491
|
+
const result = await this.client.flushMemoryBase(validated.memory_base_id, {
|
|
1492
|
+
session_id: validated.session_id
|
|
1493
|
+
});
|
|
1494
|
+
return this.formatSuccessResponse(result);
|
|
1495
|
+
}
|
|
1496
|
+
case 'mismatch': {
|
|
1497
|
+
const result = await this.client.checkMemoryBaseMismatch(validated.memory_base_id);
|
|
1498
|
+
return this.formatSuccessResponse(result);
|
|
1499
|
+
}
|
|
1500
|
+
case 'regenerate': {
|
|
1501
|
+
const result = await this.client.regenerateMemoryBase(validated.memory_base_id);
|
|
1502
|
+
return this.formatSuccessResponse(result);
|
|
1503
|
+
}
|
|
1504
|
+
}
|
|
1505
|
+
}
|
|
1506
|
+
async handleExtensionTool(args) {
|
|
1507
|
+
const validated = validation_consolidated_1.ExtensionToolSchema.parse(args);
|
|
1508
|
+
switch (validated.action) {
|
|
1509
|
+
case 'reload': {
|
|
1510
|
+
const result = await this.client.reloadExtensionBundle(validated.extension_id, validated.bundle_name);
|
|
1511
|
+
return this.formatSuccessResponse(result);
|
|
1512
|
+
}
|
|
1513
|
+
case 'events': {
|
|
1514
|
+
const result = await this.client.getExtensionEvents(validated.since !== undefined ? { since: validated.since } : undefined);
|
|
1515
|
+
return this.formatSuccessResponse(result);
|
|
1516
|
+
}
|
|
767
1517
|
}
|
|
768
1518
|
}
|
|
769
1519
|
async run() {
|
|
@@ -771,6 +1521,9 @@ class LangflowMCPServerConsolidated {
|
|
|
771
1521
|
await this.server.connect(transport);
|
|
772
1522
|
logger_1.logger.info('Langflow MCP server (consolidated) running on stdio');
|
|
773
1523
|
}
|
|
1524
|
+
async connectTransport(transport) {
|
|
1525
|
+
await this.server.connect(transport);
|
|
1526
|
+
}
|
|
774
1527
|
async shutdown() {
|
|
775
1528
|
logger_1.logger.info('Shutting down Langflow MCP server');
|
|
776
1529
|
await this.server.close();
|