langflow-mcp-server 4.11.0 → 4.12.3
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 +158 -37
- 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.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 +3 -0
- package/dist/mcp/server-consolidated.d.ts.map +1 -1
- package/dist/mcp/server-consolidated.js +97 -10
- 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 +125 -14
- package/dist/mcp/server.js.map +1 -1
- package/dist/mcp/tools-consolidated.d.ts.map +1 -1
- package/dist/mcp/tools-consolidated.js +130 -38
- package/dist/mcp/tools-consolidated.js.map +1 -1
- package/dist/mcp/tools.d.ts.map +1 -1
- package/dist/mcp/tools.js +361 -68
- package/dist/mcp/tools.js.map +1 -1
- package/dist/mcp/validation-consolidated.d.ts +254 -50
- package/dist/mcp/validation-consolidated.d.ts.map +1 -1
- package/dist/mcp/validation-consolidated.js +163 -36
- package/dist/mcp/validation-consolidated.js.map +1 -1
- package/dist/mcp/validation.d.ts +260 -51
- package/dist/mcp/validation.d.ts.map +1 -1
- package/dist/mcp/validation.js +166 -40
- package/dist/mcp/validation.js.map +1 -1
- package/dist/services/langflow-client.d.ts +29 -9
- package/dist/services/langflow-client.d.ts.map +1 -1
- package/dist/services/langflow-client.js +240 -21
- package/dist/services/langflow-client.js.map +1 -1
- package/dist/types/index.d.ts +169 -27
- 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 +13 -14
|
@@ -228,6 +228,15 @@ class LangflowClient {
|
|
|
228
228
|
throw this.handleError(error, `Failed to update project ${projectId}`);
|
|
229
229
|
}
|
|
230
230
|
}
|
|
231
|
+
async upsertProject(projectId, body) {
|
|
232
|
+
try {
|
|
233
|
+
const response = await this.client.put(`/projects/${encodeURIComponent(projectId)}`, body);
|
|
234
|
+
return response.data;
|
|
235
|
+
}
|
|
236
|
+
catch (error) {
|
|
237
|
+
throw this.handleError(error, `Failed to upsert project ${projectId}`);
|
|
238
|
+
}
|
|
239
|
+
}
|
|
231
240
|
async deleteProject(projectId) {
|
|
232
241
|
try {
|
|
233
242
|
await this.client.delete(`/projects/${encodeURIComponent(projectId)}`);
|
|
@@ -316,6 +325,36 @@ class LangflowClient {
|
|
|
316
325
|
throw this.handleError(error, `Failed to cancel build job ${jobId}`);
|
|
317
326
|
}
|
|
318
327
|
}
|
|
328
|
+
async buildPublicFlow(flowId, request, params) {
|
|
329
|
+
try {
|
|
330
|
+
const response = await this.client.post('/build_public_tmp/' + encodeURIComponent(flowId) + '/flow', request, { params });
|
|
331
|
+
return response.data;
|
|
332
|
+
}
|
|
333
|
+
catch (error) {
|
|
334
|
+
throw this.handleError(error, 'Failed to build public flow ' + flowId);
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
async getPublicBuildEvents(jobId, eventDelivery = 'streaming') {
|
|
338
|
+
try {
|
|
339
|
+
const response = await this.client.get('/build_public_tmp/' + encodeURIComponent(jobId) + '/events', {
|
|
340
|
+
params: { event_delivery: eventDelivery },
|
|
341
|
+
responseType: eventDelivery === 'streaming' ? 'text' : 'json'
|
|
342
|
+
});
|
|
343
|
+
return response.data;
|
|
344
|
+
}
|
|
345
|
+
catch (error) {
|
|
346
|
+
throw this.handleError(error, 'Failed to get public build events for job ' + jobId);
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
async cancelPublicBuild(jobId) {
|
|
350
|
+
try {
|
|
351
|
+
const response = await this.client.post('/build_public_tmp/' + encodeURIComponent(jobId) + '/cancel');
|
|
352
|
+
return response.data;
|
|
353
|
+
}
|
|
354
|
+
catch (error) {
|
|
355
|
+
throw this.handleError(error, 'Failed to cancel public build job ' + jobId);
|
|
356
|
+
}
|
|
357
|
+
}
|
|
319
358
|
async listKnowledgeBases() {
|
|
320
359
|
try {
|
|
321
360
|
const response = await this.client.get('/knowledge_bases');
|
|
@@ -470,7 +509,10 @@ class LangflowClient {
|
|
|
470
509
|
}
|
|
471
510
|
async listStoreComponents(params) {
|
|
472
511
|
try {
|
|
473
|
-
const response = await this.client.get('/store/components/', {
|
|
512
|
+
const response = await this.client.get('/store/components/', {
|
|
513
|
+
params,
|
|
514
|
+
paramsSerializer: { indexes: null }
|
|
515
|
+
});
|
|
474
516
|
return response.data;
|
|
475
517
|
}
|
|
476
518
|
catch (error) {
|
|
@@ -550,15 +592,32 @@ class LangflowClient {
|
|
|
550
592
|
}
|
|
551
593
|
}
|
|
552
594
|
async getMonitorMessage(messageId) {
|
|
595
|
+
const deadline = Date.now() + (this.config.timeout || 30000);
|
|
553
596
|
try {
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
597
|
+
for (let offset = 0;; offset += 200) {
|
|
598
|
+
const remaining = deadline - Date.now();
|
|
599
|
+
if (remaining <= 0) {
|
|
600
|
+
throw new Error(`Monitor message ${messageId} lookup timeout`);
|
|
601
|
+
}
|
|
602
|
+
const response = await this.client.get('/monitor/messages', {
|
|
603
|
+
params: { limit: 200, offset },
|
|
604
|
+
timeout: remaining
|
|
605
|
+
});
|
|
606
|
+
if (Date.now() >= deadline) {
|
|
607
|
+
throw new Error(`Monitor message ${messageId} lookup timeout`);
|
|
608
|
+
}
|
|
609
|
+
const message = response.data.find(m => m.id === messageId);
|
|
610
|
+
if (message)
|
|
611
|
+
return message;
|
|
612
|
+
if (response.data.length < 200) {
|
|
613
|
+
throw new Error(`Monitor message ${messageId} not found`);
|
|
614
|
+
}
|
|
558
615
|
}
|
|
559
|
-
return message;
|
|
560
616
|
}
|
|
561
617
|
catch (error) {
|
|
618
|
+
if (axios_1.default.isAxiosError(error) && (error.code === 'ECONNABORTED' || error.code === 'ETIMEDOUT')) {
|
|
619
|
+
throw new Error(`Monitor message ${messageId} lookup timeout`);
|
|
620
|
+
}
|
|
562
621
|
throw this.handleError(error, `Failed to get monitor message ${messageId}`);
|
|
563
622
|
}
|
|
564
623
|
}
|
|
@@ -571,10 +630,10 @@ class LangflowClient {
|
|
|
571
630
|
throw this.handleError(error, 'Failed to get monitor sessions');
|
|
572
631
|
}
|
|
573
632
|
}
|
|
574
|
-
async getMonitorSessionMessages(sessionId) {
|
|
633
|
+
async getMonitorSessionMessages(sessionId, params) {
|
|
575
634
|
try {
|
|
576
635
|
const response = await this.client.get('/monitor/messages', {
|
|
577
|
-
params: { session_id: sessionId }
|
|
636
|
+
params: { session_id: sessionId, ...params }
|
|
578
637
|
});
|
|
579
638
|
return response.data;
|
|
580
639
|
}
|
|
@@ -851,10 +910,22 @@ class LangflowClient {
|
|
|
851
910
|
return false;
|
|
852
911
|
}
|
|
853
912
|
}
|
|
913
|
+
async getHealthz() {
|
|
914
|
+
try {
|
|
915
|
+
const response = await this.client.get('/healthz', {
|
|
916
|
+
baseURL: this.config.baseUrl
|
|
917
|
+
});
|
|
918
|
+
return response.data;
|
|
919
|
+
}
|
|
920
|
+
catch (error) {
|
|
921
|
+
throw this.handleError(error, 'Failed to get readiness health status');
|
|
922
|
+
}
|
|
923
|
+
}
|
|
854
924
|
async getLogs(stream = false) {
|
|
855
925
|
try {
|
|
856
926
|
const endpoint = stream ? '/logs-stream' : '/logs';
|
|
857
927
|
const response = await this.client.get(endpoint, {
|
|
928
|
+
baseURL: this.config.baseUrl,
|
|
858
929
|
responseType: stream ? 'stream' : 'json'
|
|
859
930
|
});
|
|
860
931
|
return response.data;
|
|
@@ -1334,10 +1405,10 @@ class LangflowClient {
|
|
|
1334
1405
|
throw this.handleError(error, 'Failed to get shared messages');
|
|
1335
1406
|
}
|
|
1336
1407
|
}
|
|
1337
|
-
async getSharedSessions(sourceFlowId) {
|
|
1408
|
+
async getSharedSessions(sourceFlowId, limit) {
|
|
1338
1409
|
try {
|
|
1339
1410
|
const response = await this.client.get('/monitor/messages/shared/sessions', {
|
|
1340
|
-
params: { source_flow_id: sourceFlowId }
|
|
1411
|
+
params: { source_flow_id: sourceFlowId, ...(limit !== undefined ? { limit } : {}) }
|
|
1341
1412
|
});
|
|
1342
1413
|
return response.data;
|
|
1343
1414
|
}
|
|
@@ -1416,18 +1487,30 @@ class LangflowClient {
|
|
|
1416
1487
|
throw this.handleError(error, 'Failed to list models');
|
|
1417
1488
|
}
|
|
1418
1489
|
}
|
|
1419
|
-
async listModelProviders() {
|
|
1490
|
+
async listModelProviders(params) {
|
|
1420
1491
|
try {
|
|
1421
|
-
const response = await this.client.get('/models/providers');
|
|
1492
|
+
const response = await this.client.get('/models/providers', { params });
|
|
1422
1493
|
return response.data;
|
|
1423
1494
|
}
|
|
1424
1495
|
catch (error) {
|
|
1425
1496
|
throw this.handleError(error, 'Failed to list model providers');
|
|
1426
1497
|
}
|
|
1427
1498
|
}
|
|
1499
|
+
async listModelProviderDescriptors(params) {
|
|
1500
|
+
try {
|
|
1501
|
+
const response = await this.client.get('/models/provider-descriptors', { params });
|
|
1502
|
+
return response.data;
|
|
1503
|
+
}
|
|
1504
|
+
catch (error) {
|
|
1505
|
+
throw this.handleError(error, 'Failed to list model provider descriptors');
|
|
1506
|
+
}
|
|
1507
|
+
}
|
|
1428
1508
|
async listEnabledProviders(params) {
|
|
1429
1509
|
try {
|
|
1430
|
-
const response = await this.client.get('/models/enabled_providers', {
|
|
1510
|
+
const response = await this.client.get('/models/enabled_providers', {
|
|
1511
|
+
params,
|
|
1512
|
+
paramsSerializer: { indexes: null }
|
|
1513
|
+
});
|
|
1431
1514
|
return response.data;
|
|
1432
1515
|
}
|
|
1433
1516
|
catch (error) {
|
|
@@ -1436,7 +1519,10 @@ class LangflowClient {
|
|
|
1436
1519
|
}
|
|
1437
1520
|
async listEnabledModels(params) {
|
|
1438
1521
|
try {
|
|
1439
|
-
const response = await this.client.get('/models/enabled_models', {
|
|
1522
|
+
const response = await this.client.get('/models/enabled_models', {
|
|
1523
|
+
params,
|
|
1524
|
+
paramsSerializer: { indexes: null }
|
|
1525
|
+
});
|
|
1440
1526
|
return response.data;
|
|
1441
1527
|
}
|
|
1442
1528
|
catch (error) {
|
|
@@ -1479,9 +1565,9 @@ class LangflowClient {
|
|
|
1479
1565
|
throw this.handleError(error, 'Failed to delete default model');
|
|
1480
1566
|
}
|
|
1481
1567
|
}
|
|
1482
|
-
async getProviderVariableMapping() {
|
|
1568
|
+
async getProviderVariableMapping(params) {
|
|
1483
1569
|
try {
|
|
1484
|
-
const response = await this.client.get('/models/provider-variable-mapping');
|
|
1570
|
+
const response = await this.client.get('/models/provider-variable-mapping', { params });
|
|
1485
1571
|
return response.data;
|
|
1486
1572
|
}
|
|
1487
1573
|
catch (error) {
|
|
@@ -1497,18 +1583,126 @@ class LangflowClient {
|
|
|
1497
1583
|
throw this.handleError(error, 'Failed to validate model provider');
|
|
1498
1584
|
}
|
|
1499
1585
|
}
|
|
1500
|
-
async
|
|
1586
|
+
async getModelProviderPolicy() {
|
|
1501
1587
|
try {
|
|
1502
|
-
const response = await this.client.get('/
|
|
1588
|
+
const response = await this.client.get('/model-provider-policy');
|
|
1589
|
+
return response.data;
|
|
1590
|
+
}
|
|
1591
|
+
catch (error) {
|
|
1592
|
+
throw this.handleError(error, 'Failed to get model provider policy');
|
|
1593
|
+
}
|
|
1594
|
+
}
|
|
1595
|
+
async replaceModelProviderPolicy(body) {
|
|
1596
|
+
try {
|
|
1597
|
+
const response = await this.client.put('/model-provider-policy', body);
|
|
1598
|
+
return response.data;
|
|
1599
|
+
}
|
|
1600
|
+
catch (error) {
|
|
1601
|
+
throw this.handleError(error, 'Failed to replace model provider policy');
|
|
1602
|
+
}
|
|
1603
|
+
}
|
|
1604
|
+
async getCatalogComponentPolicy() {
|
|
1605
|
+
try {
|
|
1606
|
+
const response = await this.client.get('/catalog-policy/components');
|
|
1607
|
+
return response.data;
|
|
1608
|
+
}
|
|
1609
|
+
catch (error) {
|
|
1610
|
+
throw this.handleError(error, 'Failed to get catalog component policy');
|
|
1611
|
+
}
|
|
1612
|
+
}
|
|
1613
|
+
async replaceCatalogComponentPolicy(body) {
|
|
1614
|
+
try {
|
|
1615
|
+
const response = await this.client.put('/catalog-policy/components', body);
|
|
1616
|
+
return response.data;
|
|
1617
|
+
}
|
|
1618
|
+
catch (error) {
|
|
1619
|
+
throw this.handleError(error, 'Failed to replace catalog component policy');
|
|
1620
|
+
}
|
|
1621
|
+
}
|
|
1622
|
+
async getCatalogTemplatePolicy() {
|
|
1623
|
+
try {
|
|
1624
|
+
const response = await this.client.get('/catalog-policy/templates');
|
|
1625
|
+
return response.data;
|
|
1626
|
+
}
|
|
1627
|
+
catch (error) {
|
|
1628
|
+
throw this.handleError(error, 'Failed to get catalog template policy');
|
|
1629
|
+
}
|
|
1630
|
+
}
|
|
1631
|
+
async replaceCatalogTemplatePolicy(body) {
|
|
1632
|
+
try {
|
|
1633
|
+
const response = await this.client.put('/catalog-policy/templates', body);
|
|
1634
|
+
return response.data;
|
|
1635
|
+
}
|
|
1636
|
+
catch (error) {
|
|
1637
|
+
throw this.handleError(error, 'Failed to replace catalog template policy');
|
|
1638
|
+
}
|
|
1639
|
+
}
|
|
1640
|
+
async getCatalogPolicyUsage() {
|
|
1641
|
+
try {
|
|
1642
|
+
const response = await this.client.get('/catalog-policy/usage');
|
|
1643
|
+
return response.data;
|
|
1644
|
+
}
|
|
1645
|
+
catch (error) {
|
|
1646
|
+
throw this.handleError(error, 'Failed to get catalog policy usage');
|
|
1647
|
+
}
|
|
1648
|
+
}
|
|
1649
|
+
async getCatalogPolicyUsageFlows(params) {
|
|
1650
|
+
try {
|
|
1651
|
+
const response = await this.client.get('/catalog-policy/usage/flows', { params });
|
|
1652
|
+
return response.data;
|
|
1653
|
+
}
|
|
1654
|
+
catch (error) {
|
|
1655
|
+
throw this.handleError(error, 'Failed to get catalog policy usage flows');
|
|
1656
|
+
}
|
|
1657
|
+
}
|
|
1658
|
+
async getPolicyBundle() {
|
|
1659
|
+
try {
|
|
1660
|
+
const response = await this.client.get('/policy-bundle');
|
|
1661
|
+
return response.data;
|
|
1662
|
+
}
|
|
1663
|
+
catch (error) {
|
|
1664
|
+
throw this.handleError(error, 'Failed to get policy bundle');
|
|
1665
|
+
}
|
|
1666
|
+
}
|
|
1667
|
+
async replacePolicyBundle(body) {
|
|
1668
|
+
try {
|
|
1669
|
+
const response = await this.client.put('/policy-bundle', body);
|
|
1670
|
+
return response.data;
|
|
1671
|
+
}
|
|
1672
|
+
catch (error) {
|
|
1673
|
+
throw this.handleError(error, 'Failed to replace policy bundle');
|
|
1674
|
+
}
|
|
1675
|
+
}
|
|
1676
|
+
async listPolicyBundleHistory(params) {
|
|
1677
|
+
try {
|
|
1678
|
+
const response = await this.client.get('/policy-bundle/history', { params });
|
|
1679
|
+
return response.data;
|
|
1680
|
+
}
|
|
1681
|
+
catch (error) {
|
|
1682
|
+
throw this.handleError(error, 'Failed to list policy bundle history');
|
|
1683
|
+
}
|
|
1684
|
+
}
|
|
1685
|
+
async rollbackPolicyBundle(revision, body) {
|
|
1686
|
+
try {
|
|
1687
|
+
const response = await this.client.post(`/policy-bundle/rollback/${encodeURIComponent(revision)}`, body);
|
|
1688
|
+
return response.data;
|
|
1689
|
+
}
|
|
1690
|
+
catch (error) {
|
|
1691
|
+
throw this.handleError(error, `Failed to roll back policy bundle revision ${revision}`);
|
|
1692
|
+
}
|
|
1693
|
+
}
|
|
1694
|
+
async getLanguageModelOptions(params) {
|
|
1695
|
+
try {
|
|
1696
|
+
const response = await this.client.get('/model_options/language', { params });
|
|
1503
1697
|
return response.data;
|
|
1504
1698
|
}
|
|
1505
1699
|
catch (error) {
|
|
1506
1700
|
throw this.handleError(error, 'Failed to get language model options');
|
|
1507
1701
|
}
|
|
1508
1702
|
}
|
|
1509
|
-
async getEmbeddingModelOptions() {
|
|
1703
|
+
async getEmbeddingModelOptions(params) {
|
|
1510
1704
|
try {
|
|
1511
|
-
const response = await this.client.get('/model_options/embedding');
|
|
1705
|
+
const response = await this.client.get('/model_options/embedding', { params });
|
|
1512
1706
|
return response.data;
|
|
1513
1707
|
}
|
|
1514
1708
|
catch (error) {
|
|
@@ -1524,6 +1718,28 @@ class LangflowClient {
|
|
|
1524
1718
|
throw this.handleError(error, 'Failed to run agentic assist');
|
|
1525
1719
|
}
|
|
1526
1720
|
}
|
|
1721
|
+
async agenticAssistStream(body) {
|
|
1722
|
+
try {
|
|
1723
|
+
const response = await this.client.post('/agentic/assist/stream', body, {
|
|
1724
|
+
responseType: 'text'
|
|
1725
|
+
});
|
|
1726
|
+
return response.data;
|
|
1727
|
+
}
|
|
1728
|
+
catch (error) {
|
|
1729
|
+
throw this.handleError(error, 'Failed to run streaming agentic assist');
|
|
1730
|
+
}
|
|
1731
|
+
}
|
|
1732
|
+
async agenticAssistRun(body) {
|
|
1733
|
+
try {
|
|
1734
|
+
const response = await this.client.post('/agentic/assist/run', body, {
|
|
1735
|
+
responseType: 'text'
|
|
1736
|
+
});
|
|
1737
|
+
return response.data;
|
|
1738
|
+
}
|
|
1739
|
+
catch (error) {
|
|
1740
|
+
throw this.handleError(error, 'Failed to run headless agentic assist');
|
|
1741
|
+
}
|
|
1742
|
+
}
|
|
1527
1743
|
async agenticCheckConfig() {
|
|
1528
1744
|
try {
|
|
1529
1745
|
const response = await this.client.get('/agentic/check-config');
|
|
@@ -1855,7 +2071,10 @@ class LangflowClient {
|
|
|
1855
2071
|
}
|
|
1856
2072
|
async getAuthzAudit(params) {
|
|
1857
2073
|
try {
|
|
1858
|
-
const response = await this.client.get('/authz/audit', {
|
|
2074
|
+
const response = await this.client.get('/authz/audit', {
|
|
2075
|
+
params,
|
|
2076
|
+
paramsSerializer: { indexes: null }
|
|
2077
|
+
});
|
|
1859
2078
|
return response.data;
|
|
1860
2079
|
}
|
|
1861
2080
|
catch (error) {
|