@kadoa/mcp 0.5.3 → 0.5.4-rc.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/dist/index.js +141 -13
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -29556,7 +29556,7 @@ var require_combined_stream = __commonJS((exports, module) => {
|
|
|
29556
29556
|
};
|
|
29557
29557
|
});
|
|
29558
29558
|
|
|
29559
|
-
// node_modules/form-data/node_modules/mime-
|
|
29559
|
+
// node_modules/form-data/node_modules/mime-db/db.json
|
|
29560
29560
|
var require_db = __commonJS((exports, module) => {
|
|
29561
29561
|
module.exports = {
|
|
29562
29562
|
"application/1d-interleaved-parityfec": {
|
|
@@ -41039,6 +41039,11 @@ var require_follow_redirects = __commonJS((exports, module) => {
|
|
|
41039
41039
|
} catch (error48) {
|
|
41040
41040
|
useNativeURL = error48.code === "ERR_INVALID_URL";
|
|
41041
41041
|
}
|
|
41042
|
+
var sensitiveHeaders = [
|
|
41043
|
+
"Authorization",
|
|
41044
|
+
"Proxy-Authorization",
|
|
41045
|
+
"Cookie"
|
|
41046
|
+
];
|
|
41042
41047
|
var preservedUrlFields = [
|
|
41043
41048
|
"auth",
|
|
41044
41049
|
"host",
|
|
@@ -41086,6 +41091,7 @@ var require_follow_redirects = __commonJS((exports, module) => {
|
|
|
41086
41091
|
self2.emit("error", cause instanceof RedirectionError ? cause : new RedirectionError({ cause }));
|
|
41087
41092
|
}
|
|
41088
41093
|
};
|
|
41094
|
+
this._headerFilter = new RegExp("^(?:" + sensitiveHeaders.concat(options.sensitiveHeaders).map(escapeRegex2).join("|") + ")$", "i");
|
|
41089
41095
|
this._performRequest();
|
|
41090
41096
|
}
|
|
41091
41097
|
RedirectableRequest.prototype = Object.create(Writable.prototype);
|
|
@@ -41223,6 +41229,9 @@ var require_follow_redirects = __commonJS((exports, module) => {
|
|
|
41223
41229
|
if (!options.headers) {
|
|
41224
41230
|
options.headers = {};
|
|
41225
41231
|
}
|
|
41232
|
+
if (!isArray2(options.sensitiveHeaders)) {
|
|
41233
|
+
options.sensitiveHeaders = [];
|
|
41234
|
+
}
|
|
41226
41235
|
if (options.host) {
|
|
41227
41236
|
if (!options.hostname) {
|
|
41228
41237
|
options.hostname = options.host;
|
|
@@ -41319,7 +41328,7 @@ var require_follow_redirects = __commonJS((exports, module) => {
|
|
|
41319
41328
|
this._isRedirect = true;
|
|
41320
41329
|
spreadUrlObject(redirectUrl, this._options);
|
|
41321
41330
|
if (redirectUrl.protocol !== currentUrlParts.protocol && redirectUrl.protocol !== "https:" || redirectUrl.host !== currentHost && !isSubdomain(redirectUrl.host, currentHost)) {
|
|
41322
|
-
removeMatchingHeaders(
|
|
41331
|
+
removeMatchingHeaders(this._headerFilter, this._options.headers);
|
|
41323
41332
|
}
|
|
41324
41333
|
if (isFunction2(beforeRedirect)) {
|
|
41325
41334
|
var responseDetails = {
|
|
@@ -41467,6 +41476,9 @@ var require_follow_redirects = __commonJS((exports, module) => {
|
|
|
41467
41476
|
var dot = subdomain.length - domain2.length - 1;
|
|
41468
41477
|
return dot > 0 && subdomain[dot] === "." && subdomain.endsWith(domain2);
|
|
41469
41478
|
}
|
|
41479
|
+
function isArray2(value) {
|
|
41480
|
+
return value instanceof Array;
|
|
41481
|
+
}
|
|
41470
41482
|
function isString2(value) {
|
|
41471
41483
|
return typeof value === "string" || value instanceof String;
|
|
41472
41484
|
}
|
|
@@ -41479,6 +41491,9 @@ var require_follow_redirects = __commonJS((exports, module) => {
|
|
|
41479
41491
|
function isURL(value) {
|
|
41480
41492
|
return URL2 && value instanceof URL2;
|
|
41481
41493
|
}
|
|
41494
|
+
function escapeRegex2(regex) {
|
|
41495
|
+
return regex.replace(/[\]\\/()*+?.$]/g, "\\$&");
|
|
41496
|
+
}
|
|
41482
41497
|
module.exports = wrap({ http, https });
|
|
41483
41498
|
module.exports.wrap = wrap;
|
|
41484
41499
|
});
|
|
@@ -47000,6 +47015,46 @@ var import_debug, __require2, ChangeDifferenceType, KadoaErrorCode, _KadoaSdkExc
|
|
|
47000
47015
|
options: localVarRequestOptions
|
|
47001
47016
|
};
|
|
47002
47017
|
},
|
|
47018
|
+
v4WorkflowsWorkflowIdDataExportGet: async (workflowId, format, runId, filters, sortBy2, order, rowIds, options = {}) => {
|
|
47019
|
+
assertParamExists("v4WorkflowsWorkflowIdDataExportGet", "workflowId", workflowId);
|
|
47020
|
+
const localVarPath = `/v4/workflows/{workflowId}/data/export`.replace(`{${"workflowId"}}`, encodeURIComponent(String(workflowId)));
|
|
47021
|
+
const localVarUrlObj = new URL$1(localVarPath, DUMMY_BASE_URL);
|
|
47022
|
+
let baseOptions;
|
|
47023
|
+
if (configuration) {
|
|
47024
|
+
baseOptions = configuration.baseOptions;
|
|
47025
|
+
}
|
|
47026
|
+
const localVarRequestOptions = { method: "GET", ...baseOptions, ...options };
|
|
47027
|
+
const localVarHeaderParameter = {};
|
|
47028
|
+
const localVarQueryParameter = {};
|
|
47029
|
+
await setApiKeyToObject(localVarHeaderParameter, "x-api-key", configuration);
|
|
47030
|
+
await setBearerAuthToObject(localVarHeaderParameter, configuration);
|
|
47031
|
+
if (format !== undefined) {
|
|
47032
|
+
localVarQueryParameter["format"] = format;
|
|
47033
|
+
}
|
|
47034
|
+
if (runId !== undefined) {
|
|
47035
|
+
localVarQueryParameter["runId"] = runId;
|
|
47036
|
+
}
|
|
47037
|
+
if (filters !== undefined) {
|
|
47038
|
+
localVarQueryParameter["filters"] = filters;
|
|
47039
|
+
}
|
|
47040
|
+
if (sortBy2 !== undefined) {
|
|
47041
|
+
localVarQueryParameter["sortBy"] = sortBy2;
|
|
47042
|
+
}
|
|
47043
|
+
if (order !== undefined) {
|
|
47044
|
+
localVarQueryParameter["order"] = order;
|
|
47045
|
+
}
|
|
47046
|
+
if (rowIds !== undefined) {
|
|
47047
|
+
localVarQueryParameter["rowIds"] = rowIds;
|
|
47048
|
+
}
|
|
47049
|
+
localVarHeaderParameter["Accept"] = "application/json";
|
|
47050
|
+
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
47051
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
47052
|
+
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
|
|
47053
|
+
return {
|
|
47054
|
+
url: toPathString(localVarUrlObj),
|
|
47055
|
+
options: localVarRequestOptions
|
|
47056
|
+
};
|
|
47057
|
+
},
|
|
47003
47058
|
v4WorkflowsWorkflowIdDataExportsExportIdGet: async (workflowId, exportId, options = {}) => {
|
|
47004
47059
|
assertParamExists("v4WorkflowsWorkflowIdDataExportsExportIdGet", "workflowId", workflowId);
|
|
47005
47060
|
assertParamExists("v4WorkflowsWorkflowIdDataExportsExportIdGet", "exportId", exportId);
|
|
@@ -47465,6 +47520,12 @@ var import_debug, __require2, ChangeDifferenceType, KadoaErrorCode, _KadoaSdkExc
|
|
|
47465
47520
|
const localVarOperationServerBasePath = operationServerMap["WorkflowsApi.v4WorkflowsWorkflowIdComplianceRejectPut"]?.[localVarOperationServerIndex]?.url;
|
|
47466
47521
|
return (axios2, basePath) => createRequestFunction(localVarAxiosArgs, axios_default, BASE_PATH, configuration)(axios2, localVarOperationServerBasePath || basePath);
|
|
47467
47522
|
},
|
|
47523
|
+
async v4WorkflowsWorkflowIdDataExportGet(workflowId, format, runId, filters, sortBy2, order, rowIds, options) {
|
|
47524
|
+
const localVarAxiosArgs = await localVarAxiosParamCreator.v4WorkflowsWorkflowIdDataExportGet(workflowId, format, runId, filters, sortBy2, order, rowIds, options);
|
|
47525
|
+
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
|
47526
|
+
const localVarOperationServerBasePath = operationServerMap["WorkflowsApi.v4WorkflowsWorkflowIdDataExportGet"]?.[localVarOperationServerIndex]?.url;
|
|
47527
|
+
return (axios2, basePath) => createRequestFunction(localVarAxiosArgs, axios_default, BASE_PATH, configuration)(axios2, localVarOperationServerBasePath || basePath);
|
|
47528
|
+
},
|
|
47468
47529
|
async v4WorkflowsWorkflowIdDataExportsExportIdGet(workflowId, exportId, options) {
|
|
47469
47530
|
const localVarAxiosArgs = await localVarAxiosParamCreator.v4WorkflowsWorkflowIdDataExportsExportIdGet(workflowId, exportId, options);
|
|
47470
47531
|
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
|
@@ -47724,6 +47785,18 @@ var import_debug, __require2, ChangeDifferenceType, KadoaErrorCode, _KadoaSdkExc
|
|
|
47724
47785
|
const iterator2 = new PagedIterator((pageOptions) => this.fetchData({ ...options, ...pageOptions }));
|
|
47725
47786
|
return iterator2.fetchAll({ limit: options.limit ?? this.defaultLimit });
|
|
47726
47787
|
}
|
|
47788
|
+
async exportData(options) {
|
|
47789
|
+
const response = await this.workflowsApi.v4WorkflowsWorkflowIdDataExportGet({
|
|
47790
|
+
workflowId: options.workflowId,
|
|
47791
|
+
format: options.format,
|
|
47792
|
+
runId: options.runId,
|
|
47793
|
+
filters: options.filters,
|
|
47794
|
+
sortBy: options.sortBy,
|
|
47795
|
+
order: options.order,
|
|
47796
|
+
rowIds: options.rowIds
|
|
47797
|
+
});
|
|
47798
|
+
return response.data;
|
|
47799
|
+
}
|
|
47727
47800
|
async* fetchDataPages(options) {
|
|
47728
47801
|
const iterator2 = new PagedIterator((pageOptions) => this.fetchData({ ...options, ...pageOptions }));
|
|
47729
47802
|
for await (const page of iterator2.pages({
|
|
@@ -47928,6 +48001,9 @@ var import_debug, __require2, ChangeDifferenceType, KadoaErrorCode, _KadoaSdkExc
|
|
|
47928
48001
|
async fetchAllData(options) {
|
|
47929
48002
|
return await this.dataFetcherService.fetchAllData(options);
|
|
47930
48003
|
}
|
|
48004
|
+
async exportData(options) {
|
|
48005
|
+
return await this.dataFetcherService.exportData(options);
|
|
48006
|
+
}
|
|
47931
48007
|
fetchDataPages(options) {
|
|
47932
48008
|
return this.dataFetcherService.fetchDataPages(options);
|
|
47933
48009
|
}
|
|
@@ -48653,7 +48729,7 @@ var import_debug, __require2, ChangeDifferenceType, KadoaErrorCode, _KadoaSdkExc
|
|
|
48653
48729
|
}));
|
|
48654
48730
|
return channels;
|
|
48655
48731
|
}
|
|
48656
|
-
}, PUBLIC_API_URI, WSS_API_URI, REALTIME_API_URI, SDK_VERSION = "0.
|
|
48732
|
+
}, PUBLIC_API_URI, WSS_API_URI, REALTIME_API_URI, SDK_VERSION = "0.32.0", SDK_NAME = "kadoa-node-sdk", SDK_LANGUAGE = "node", debug6, isDrainControlMessage = (message) => message.type === "control.draining", isRealtimeEvent = (message) => message.type !== "heartbeat" && message.type !== "control.draining", _Realtime = class _Realtime2 {
|
|
48657
48733
|
constructor(config2) {
|
|
48658
48734
|
this.drainingSockets = /* @__PURE__ */ new Set;
|
|
48659
48735
|
this.lastHeartbeat = Date.now();
|
|
@@ -50168,6 +50244,9 @@ var init_dist2 = __esm(() => {
|
|
|
50168
50244
|
v4WorkflowsWorkflowIdComplianceRejectPut(requestParameters, options) {
|
|
50169
50245
|
return WorkflowsApiFp(this.configuration).v4WorkflowsWorkflowIdComplianceRejectPut(requestParameters.workflowId, requestParameters.v4WorkflowsWorkflowIdComplianceRejectPutRequest, requestParameters.xApiKey, requestParameters.authorization, options).then((request) => request(this.axios, this.basePath));
|
|
50170
50246
|
}
|
|
50247
|
+
v4WorkflowsWorkflowIdDataExportGet(requestParameters, options) {
|
|
50248
|
+
return WorkflowsApiFp(this.configuration).v4WorkflowsWorkflowIdDataExportGet(requestParameters.workflowId, requestParameters.format, requestParameters.runId, requestParameters.filters, requestParameters.sortBy, requestParameters.order, requestParameters.rowIds, options).then((request) => request(this.axios, this.basePath));
|
|
50249
|
+
}
|
|
50171
50250
|
v4WorkflowsWorkflowIdDataExportsExportIdGet(requestParameters, options) {
|
|
50172
50251
|
return WorkflowsApiFp(this.configuration).v4WorkflowsWorkflowIdDataExportsExportIdGet(requestParameters.workflowId, requestParameters.exportId, options).then((request) => request(this.axios, this.basePath));
|
|
50173
50252
|
}
|
|
@@ -51135,24 +51214,73 @@ function registerTools(server, ctx) {
|
|
|
51135
51214
|
message: "Workflow execution started. Use fetch_data to retrieve results once complete."
|
|
51136
51215
|
});
|
|
51137
51216
|
}));
|
|
51217
|
+
const FETCH_DATA_DEFAULT_LIMIT = 50;
|
|
51218
|
+
const FETCH_DATA_MAX_LIMIT = 500;
|
|
51138
51219
|
server.registerTool("fetch_data", {
|
|
51139
|
-
description: "Get extracted data from a workflow. Data is only available after the workflow run has completed (status is no longer 'Running' or 'Validating'). Do NOT poll or sleep-wait for completion.",
|
|
51220
|
+
description: "Get a PAGE of extracted data from a workflow. Use ONLY for previews, sorted/filtered slices, or explicit 'first N rows' / 'top N' queries (capped at 500 rows per call). Do NOT use this to retrieve a full dataset, 'all rows', or anything the user wants to analyze in Excel / pandas / duckdb — use export_data for those. Data is only available after the workflow run has completed (status is no longer 'Running' or 'Validating'). Do NOT poll or sleep-wait for completion.",
|
|
51140
51221
|
inputSchema: {
|
|
51141
51222
|
workflowId: exports_external.string().describe("The workflow ID"),
|
|
51142
|
-
limit: exports_external.preprocess(coerceNumber(), exports_external.number()).optional().describe(
|
|
51143
|
-
page: exports_external.preprocess(coerceNumber(), exports_external.number()).optional().describe("Page number for pagination")
|
|
51223
|
+
limit: exports_external.preprocess(coerceNumber(), exports_external.number()).optional().describe(`Maximum number of records to return. Default ${FETCH_DATA_DEFAULT_LIMIT}, max ${FETCH_DATA_MAX_LIMIT}.`),
|
|
51224
|
+
page: exports_external.preprocess(coerceNumber(), exports_external.number()).optional().describe("Page number for pagination (1-based)"),
|
|
51225
|
+
filters: exports_external.string().optional().describe('JSON-encoded filter array. Each filter has shape {"field":"<fieldName>","operator":"<OP>","value":"<v>"}. Operators are UPPERCASE: CONTAINS, EQUALS, NOT_EQUALS, GREATER_THAN, LESS_THAN, GREATER_THAN_OR_EQUAL, LESS_THAN_OR_EQUAL. Example: [{"field":"title","operator":"CONTAINS","value":"Manager"}].'),
|
|
51226
|
+
sortBy: exports_external.string().optional().describe("Field name to sort by"),
|
|
51227
|
+
order: exports_external.enum(["asc", "desc"]).optional().describe("Sort order: asc or desc")
|
|
51144
51228
|
},
|
|
51145
51229
|
annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true }
|
|
51146
51230
|
}, withErrorHandling("fetch_data", async (args) => {
|
|
51231
|
+
const requestedLimit = args.limit ?? FETCH_DATA_DEFAULT_LIMIT;
|
|
51232
|
+
if (requestedLimit > FETCH_DATA_MAX_LIMIT) {
|
|
51233
|
+
return errorResult(`limit ${requestedLimit} exceeds max ${FETCH_DATA_MAX_LIMIT}. Use export_data for full datasets.`);
|
|
51234
|
+
}
|
|
51147
51235
|
const data = await ctx.client.extraction.fetchData({
|
|
51148
51236
|
workflowId: args.workflowId,
|
|
51149
|
-
limit:
|
|
51150
|
-
page: args.page || 1
|
|
51151
|
-
|
|
51152
|
-
|
|
51237
|
+
limit: requestedLimit,
|
|
51238
|
+
page: args.page || 1,
|
|
51239
|
+
filters: args.filters,
|
|
51240
|
+
sortBy: args.sortBy,
|
|
51241
|
+
order: args.order
|
|
51242
|
+
});
|
|
51243
|
+
const totalCount = data.pagination?.totalCount ?? data.data.length;
|
|
51244
|
+
const result = {
|
|
51153
51245
|
data: data.data,
|
|
51154
51246
|
pagination: data.pagination,
|
|
51155
|
-
|
|
51247
|
+
totalCount
|
|
51248
|
+
};
|
|
51249
|
+
if (data.data.length < totalCount) {
|
|
51250
|
+
result.hint = `Showing ${data.data.length} of ${totalCount} rows. Use export_data for the full dataset.`;
|
|
51251
|
+
}
|
|
51252
|
+
return jsonResult(result);
|
|
51253
|
+
}));
|
|
51254
|
+
server.registerTool("export_data", {
|
|
51255
|
+
description: "PREFERRED tool for retrieving a workflow's FULL dataset. Materializes the data to object storage and returns a signed download URL. Use this whenever the user wants 'all rows', 'the full dataset', 'everything', an export, or anything destined for Excel / pandas / duckdb / a CSV file — even for small workflows. The URL is self-authenticating (open with `fetch(url)`, no Authorization header). Use fetch_data ONLY when the user explicitly asks for a small preview slice (e.g., 'first 10', 'top N sorted by X').",
|
|
51256
|
+
inputSchema: {
|
|
51257
|
+
workflowId: exports_external.string().describe("The workflow ID"),
|
|
51258
|
+
format: exports_external.enum(["csv", "json"]).optional().describe("Export format. Default 'csv'."),
|
|
51259
|
+
runId: exports_external.string().optional().describe("Specific run ID to export. Defaults to the latest completed run."),
|
|
51260
|
+
filters: exports_external.string().optional().describe('JSON-encoded filter array. Each filter has shape {"field":"<fieldName>","operator":"<OP>","value":"<v>"}. Operators are UPPERCASE: CONTAINS, EQUALS, NOT_EQUALS, GREATER_THAN, LESS_THAN, GREATER_THAN_OR_EQUAL, LESS_THAN_OR_EQUAL.'),
|
|
51261
|
+
sortBy: exports_external.string().optional().describe("Field name to sort by"),
|
|
51262
|
+
order: exports_external.enum(["asc", "desc"]).optional().describe("Sort order: asc or desc"),
|
|
51263
|
+
rowIds: exports_external.string().optional().describe("Comma-separated list (or JSON array) of row ids to include")
|
|
51264
|
+
},
|
|
51265
|
+
annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true }
|
|
51266
|
+
}, withErrorHandling("export_data", async (args) => {
|
|
51267
|
+
const result = await ctx.client.extraction.exportData({
|
|
51268
|
+
workflowId: args.workflowId,
|
|
51269
|
+
format: args.format,
|
|
51270
|
+
runId: args.runId,
|
|
51271
|
+
filters: args.filters,
|
|
51272
|
+
sortBy: args.sortBy,
|
|
51273
|
+
order: args.order,
|
|
51274
|
+
rowIds: args.rowIds
|
|
51275
|
+
});
|
|
51276
|
+
return jsonResult({
|
|
51277
|
+
url: result.url,
|
|
51278
|
+
rowCount: result.rowCount,
|
|
51279
|
+
format: result.format,
|
|
51280
|
+
expiresAt: result.expiresAt,
|
|
51281
|
+
workflowId: result.workflowId,
|
|
51282
|
+
runId: result.runId,
|
|
51283
|
+
hint: `Full dataset ready at the URL above. Open in Excel via 'Get Data from Web' (no auth needed), ` + `or load with code execution (pandas.read_csv(url) / pandas.read_json(url) / duckdb.read_csv(url)). ` + `URL expires ${result.expiresAt}.`
|
|
51156
51284
|
});
|
|
51157
51285
|
}));
|
|
51158
51286
|
server.registerTool("list_changes", {
|
|
@@ -51874,7 +52002,7 @@ var package_default;
|
|
|
51874
52002
|
var init_package = __esm(() => {
|
|
51875
52003
|
package_default = {
|
|
51876
52004
|
name: "@kadoa/mcp",
|
|
51877
|
-
version: "0.5.
|
|
52005
|
+
version: "0.5.4-rc.2",
|
|
51878
52006
|
description: "Kadoa MCP Server — manage workflows from Claude Desktop, Cursor, and other MCP clients",
|
|
51879
52007
|
type: "module",
|
|
51880
52008
|
main: "dist/index.js",
|
|
@@ -51898,7 +52026,7 @@ var init_package = __esm(() => {
|
|
|
51898
52026
|
prepublishOnly: "bun run check-types && bun run test:unit && bun run build"
|
|
51899
52027
|
},
|
|
51900
52028
|
dependencies: {
|
|
51901
|
-
"@kadoa/node-sdk": "^0.
|
|
52029
|
+
"@kadoa/node-sdk": "^0.32.0",
|
|
51902
52030
|
"@modelcontextprotocol/sdk": "^1.26.0",
|
|
51903
52031
|
express: "^5.2.1",
|
|
51904
52032
|
ioredis: "^5.6.1",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kadoa/mcp",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.4-rc.2",
|
|
4
4
|
"description": "Kadoa MCP Server — manage workflows from Claude Desktop, Cursor, and other MCP clients",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"prepublishOnly": "bun run check-types && bun run test:unit && bun run build"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@kadoa/node-sdk": "^0.
|
|
27
|
+
"@kadoa/node-sdk": "^0.32.0",
|
|
28
28
|
"@modelcontextprotocol/sdk": "^1.26.0",
|
|
29
29
|
"express": "^5.2.1",
|
|
30
30
|
"ioredis": "^5.6.1",
|