@kairos-sdk/core 0.2.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +111 -5
- package/dist/{chunk-QQJDLS5A.js → chunk-DDV7ZART.js} +102 -891
- package/dist/chunk-DDV7ZART.js.map +1 -0
- package/dist/chunk-Q77XA7UC.js +809 -0
- package/dist/chunk-Q77XA7UC.js.map +1 -0
- package/dist/cli.js +4 -2
- package/dist/cli.js.map +1 -1
- package/dist/index.js +12 -10
- package/dist/mcp-server.cjs +1936 -0
- package/dist/mcp-server.cjs.map +1 -0
- package/dist/mcp-server.d.cts +1 -0
- package/dist/mcp-server.d.ts +1 -0
- package/dist/mcp-server.js +376 -0
- package/dist/mcp-server.js.map +1 -0
- package/package.json +24 -5
- package/dist/chunk-QQJDLS5A.js.map +0 -1
|
@@ -0,0 +1,376 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import {
|
|
3
|
+
FileLibrary,
|
|
4
|
+
N8nApiClient,
|
|
5
|
+
N8nFieldStripper,
|
|
6
|
+
N8nValidator,
|
|
7
|
+
PromptBuilder,
|
|
8
|
+
TelemetryReader,
|
|
9
|
+
nullLogger
|
|
10
|
+
} from "./chunk-DDV7ZART.js";
|
|
11
|
+
|
|
12
|
+
// src/mcp-server.ts
|
|
13
|
+
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
14
|
+
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
15
|
+
import { z } from "zod";
|
|
16
|
+
import { readFileSync } from "fs";
|
|
17
|
+
import { dirname, join } from "path";
|
|
18
|
+
import { fileURLToPath } from "url";
|
|
19
|
+
var __dirname = dirname(fileURLToPath(import.meta.url));
|
|
20
|
+
var pkg = JSON.parse(readFileSync(join(__dirname, "..", "package.json"), "utf-8"));
|
|
21
|
+
var library = new FileLibrary();
|
|
22
|
+
var validator = new N8nValidator();
|
|
23
|
+
var stripper = new N8nFieldStripper();
|
|
24
|
+
var promptBuilder = new PromptBuilder();
|
|
25
|
+
function getTelemetryReader() {
|
|
26
|
+
try {
|
|
27
|
+
return new TelemetryReader();
|
|
28
|
+
} catch {
|
|
29
|
+
return null;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
function isAllowed(action) {
|
|
33
|
+
const key = `KAIROS_MCP_ALLOW_${action.toUpperCase()}`;
|
|
34
|
+
return process.env[key] === "true";
|
|
35
|
+
}
|
|
36
|
+
function getApiClient() {
|
|
37
|
+
const baseUrl = process.env["N8N_BASE_URL"];
|
|
38
|
+
const apiKey = process.env["N8N_API_KEY"];
|
|
39
|
+
if (!baseUrl || !apiKey) {
|
|
40
|
+
throw new Error("N8N_BASE_URL and N8N_API_KEY environment variables are required for n8n operations");
|
|
41
|
+
}
|
|
42
|
+
return new N8nApiClient(baseUrl, apiKey, nullLogger);
|
|
43
|
+
}
|
|
44
|
+
var server = new McpServer({
|
|
45
|
+
name: "kairos",
|
|
46
|
+
version: pkg.version
|
|
47
|
+
});
|
|
48
|
+
server.tool(
|
|
49
|
+
"kairos_prompt",
|
|
50
|
+
"Get the specialized n8n workflow generation context. Returns a system prompt with node catalog, connection rules, validation rules, plus library matches and failure patterns for the given description. Feed this to yourself as context, then generate the workflow JSON.",
|
|
51
|
+
{
|
|
52
|
+
description: z.string().describe("Plain-English description of the workflow to build"),
|
|
53
|
+
name: z.string().optional().describe("Optional workflow name override")
|
|
54
|
+
},
|
|
55
|
+
async ({ description, name }) => {
|
|
56
|
+
await library.initialize();
|
|
57
|
+
const matches = await library.search(description);
|
|
58
|
+
const telemetryReader = getTelemetryReader();
|
|
59
|
+
const failureRates = await telemetryReader?.getFailureRates() ?? [];
|
|
60
|
+
const request = { description, ...name ? { name } : {} };
|
|
61
|
+
const built = promptBuilder.build(request, matches, failureRates);
|
|
62
|
+
const systemText = built.system.map((block) => block.text).join("\n\n---\n\n");
|
|
63
|
+
return {
|
|
64
|
+
content: [{
|
|
65
|
+
type: "text",
|
|
66
|
+
text: JSON.stringify({
|
|
67
|
+
mode: built.mode,
|
|
68
|
+
matchCount: matches.length,
|
|
69
|
+
topMatchScore: matches[0]?.score ?? null,
|
|
70
|
+
systemPrompt: systemText,
|
|
71
|
+
userMessage: built.userMessage,
|
|
72
|
+
outputFormat: {
|
|
73
|
+
description: "Generate a JSON object with this exact structure. The workflow field contains the n8n workflow. credentialsNeeded lists services requiring credentials.",
|
|
74
|
+
schema: {
|
|
75
|
+
workflow: {
|
|
76
|
+
name: "string \u2014 descriptive workflow name",
|
|
77
|
+
nodes: "array \u2014 n8n node objects with id (UUID v4), type, typeVersion, name, position, parameters",
|
|
78
|
+
connections: "object \u2014 keyed by source node NAME, maps to target nodes",
|
|
79
|
+
settings: 'object \u2014 include executionOrder: "v1"'
|
|
80
|
+
},
|
|
81
|
+
credentialsNeeded: [{
|
|
82
|
+
service: 'string \u2014 e.g. "Slack"',
|
|
83
|
+
credentialType: 'string \u2014 e.g. "slackOAuth2Api"',
|
|
84
|
+
description: "string \u2014 what the user needs to set up"
|
|
85
|
+
}]
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
}, null, 2)
|
|
89
|
+
}]
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
);
|
|
93
|
+
server.tool(
|
|
94
|
+
"kairos_validate",
|
|
95
|
+
"Validate n8n workflow JSON against 23 structural rules. Returns pass/fail with specific issues. If validation fails, fix the issues and call this again. Errors block deployment; warnings are advisory.",
|
|
96
|
+
{
|
|
97
|
+
workflow: z.string().describe("The workflow JSON string to validate")
|
|
98
|
+
},
|
|
99
|
+
async ({ workflow: workflowStr }) => {
|
|
100
|
+
let parsed;
|
|
101
|
+
try {
|
|
102
|
+
parsed = JSON.parse(workflowStr);
|
|
103
|
+
} catch (e) {
|
|
104
|
+
return {
|
|
105
|
+
content: [{
|
|
106
|
+
type: "text",
|
|
107
|
+
text: JSON.stringify({
|
|
108
|
+
valid: false,
|
|
109
|
+
error: `Invalid JSON: ${e instanceof Error ? e.message : String(e)}`
|
|
110
|
+
}, null, 2)
|
|
111
|
+
}]
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
const result = validator.validate(parsed);
|
|
115
|
+
const errors = result.issues.filter((i) => i.severity === "error");
|
|
116
|
+
const warnings = result.issues.filter((i) => i.severity === "warn");
|
|
117
|
+
return {
|
|
118
|
+
content: [{
|
|
119
|
+
type: "text",
|
|
120
|
+
text: JSON.stringify({
|
|
121
|
+
valid: result.valid,
|
|
122
|
+
errorCount: errors.length,
|
|
123
|
+
warningCount: warnings.length,
|
|
124
|
+
errors: errors.map((i) => ({
|
|
125
|
+
rule: i.rule,
|
|
126
|
+
message: i.message,
|
|
127
|
+
nodeId: i.nodeId ?? null
|
|
128
|
+
})),
|
|
129
|
+
warnings: warnings.map((i) => ({
|
|
130
|
+
rule: i.rule,
|
|
131
|
+
message: i.message,
|
|
132
|
+
nodeId: i.nodeId ?? null
|
|
133
|
+
})),
|
|
134
|
+
deployable: errors.length === 0
|
|
135
|
+
}, null, 2)
|
|
136
|
+
}]
|
|
137
|
+
};
|
|
138
|
+
}
|
|
139
|
+
);
|
|
140
|
+
server.tool(
|
|
141
|
+
"kairos_deploy",
|
|
142
|
+
"Deploy a validated workflow to n8n. Pass the workflow JSON that passed kairos_validate. Strips server-assigned fields automatically. Requires N8N_BASE_URL and N8N_API_KEY.",
|
|
143
|
+
{
|
|
144
|
+
workflow: z.string().describe("The validated workflow JSON string to deploy"),
|
|
145
|
+
activate: z.boolean().default(false).describe("Activate the workflow immediately after deployment")
|
|
146
|
+
},
|
|
147
|
+
async ({ workflow: workflowStr, activate }) => {
|
|
148
|
+
if (!isAllowed("deploy")) {
|
|
149
|
+
return {
|
|
150
|
+
content: [{
|
|
151
|
+
type: "text",
|
|
152
|
+
text: JSON.stringify({ error: "Deploy is disabled. Set KAIROS_MCP_ALLOW_DEPLOY=true to enable." })
|
|
153
|
+
}],
|
|
154
|
+
isError: true
|
|
155
|
+
};
|
|
156
|
+
}
|
|
157
|
+
let parsed;
|
|
158
|
+
try {
|
|
159
|
+
parsed = JSON.parse(workflowStr);
|
|
160
|
+
} catch (e) {
|
|
161
|
+
return {
|
|
162
|
+
content: [{
|
|
163
|
+
type: "text",
|
|
164
|
+
text: JSON.stringify({ error: `Invalid JSON: ${e instanceof Error ? e.message : String(e)}` })
|
|
165
|
+
}]
|
|
166
|
+
};
|
|
167
|
+
}
|
|
168
|
+
const validation = validator.validate(parsed);
|
|
169
|
+
const errors = validation.issues.filter((i) => i.severity === "error");
|
|
170
|
+
if (errors.length > 0) {
|
|
171
|
+
return {
|
|
172
|
+
content: [{
|
|
173
|
+
type: "text",
|
|
174
|
+
text: JSON.stringify({
|
|
175
|
+
error: "Workflow has validation errors \u2014 fix them before deploying",
|
|
176
|
+
errors: errors.map((i) => ({ rule: i.rule, message: i.message }))
|
|
177
|
+
}, null, 2)
|
|
178
|
+
}]
|
|
179
|
+
};
|
|
180
|
+
}
|
|
181
|
+
const client = getApiClient();
|
|
182
|
+
const stripped = stripper.stripForCreate(parsed);
|
|
183
|
+
const response = await client.createWorkflow(stripped);
|
|
184
|
+
if (activate) {
|
|
185
|
+
if (!isAllowed("activate")) {
|
|
186
|
+
return {
|
|
187
|
+
content: [{
|
|
188
|
+
type: "text",
|
|
189
|
+
text: JSON.stringify({
|
|
190
|
+
workflowId: response.id,
|
|
191
|
+
name: response.name,
|
|
192
|
+
activated: false,
|
|
193
|
+
warning: "Workflow deployed but activation is disabled. Set KAIROS_MCP_ALLOW_ACTIVATE=true to enable.",
|
|
194
|
+
url: `${process.env["N8N_BASE_URL"]}/workflow/${response.id}`
|
|
195
|
+
}, null, 2)
|
|
196
|
+
}]
|
|
197
|
+
};
|
|
198
|
+
}
|
|
199
|
+
await client.activateWorkflow(response.id);
|
|
200
|
+
}
|
|
201
|
+
await library.initialize();
|
|
202
|
+
await library.save(parsed, {
|
|
203
|
+
description: parsed.name,
|
|
204
|
+
generationMode: "scratch",
|
|
205
|
+
generationAttempts: 1
|
|
206
|
+
});
|
|
207
|
+
return {
|
|
208
|
+
content: [{
|
|
209
|
+
type: "text",
|
|
210
|
+
text: JSON.stringify({
|
|
211
|
+
workflowId: response.id,
|
|
212
|
+
name: response.name,
|
|
213
|
+
activated: activate,
|
|
214
|
+
url: `${process.env["N8N_BASE_URL"]}/workflow/${response.id}`
|
|
215
|
+
}, null, 2)
|
|
216
|
+
}]
|
|
217
|
+
};
|
|
218
|
+
}
|
|
219
|
+
);
|
|
220
|
+
server.tool(
|
|
221
|
+
"kairos_search",
|
|
222
|
+
"Search the local workflow library for similar past builds. Returns matching workflows with scores, useful for finding examples and reusing patterns.",
|
|
223
|
+
{
|
|
224
|
+
query: z.string().describe("Search query \u2014 a workflow description or keywords"),
|
|
225
|
+
limit: z.number().default(5).describe("Maximum number of results")
|
|
226
|
+
},
|
|
227
|
+
async ({ query, limit }) => {
|
|
228
|
+
await library.initialize();
|
|
229
|
+
const matches = await library.search(query);
|
|
230
|
+
return {
|
|
231
|
+
content: [{
|
|
232
|
+
type: "text",
|
|
233
|
+
text: JSON.stringify(
|
|
234
|
+
matches.slice(0, limit).map((m) => ({
|
|
235
|
+
score: Number(m.score.toFixed(3)),
|
|
236
|
+
mode: m.mode,
|
|
237
|
+
description: m.workflow.description,
|
|
238
|
+
nodeCount: m.workflow.workflow.nodes.length,
|
|
239
|
+
nodes: m.workflow.workflow.nodes.map((n) => n.name),
|
|
240
|
+
failurePatterns: m.workflow.failurePatterns ?? []
|
|
241
|
+
})),
|
|
242
|
+
null,
|
|
243
|
+
2
|
|
244
|
+
)
|
|
245
|
+
}]
|
|
246
|
+
};
|
|
247
|
+
}
|
|
248
|
+
);
|
|
249
|
+
server.tool(
|
|
250
|
+
"kairos_list",
|
|
251
|
+
"List all workflows deployed on the connected n8n instance.",
|
|
252
|
+
{},
|
|
253
|
+
async () => {
|
|
254
|
+
const client = getApiClient();
|
|
255
|
+
const workflows = await client.listWorkflows();
|
|
256
|
+
return {
|
|
257
|
+
content: [{
|
|
258
|
+
type: "text",
|
|
259
|
+
text: JSON.stringify(workflows, null, 2)
|
|
260
|
+
}]
|
|
261
|
+
};
|
|
262
|
+
}
|
|
263
|
+
);
|
|
264
|
+
server.tool(
|
|
265
|
+
"kairos_get",
|
|
266
|
+
"Get the full JSON definition of a specific workflow by ID.",
|
|
267
|
+
{
|
|
268
|
+
workflow_id: z.string().describe("The n8n workflow ID")
|
|
269
|
+
},
|
|
270
|
+
async ({ workflow_id }) => {
|
|
271
|
+
const client = getApiClient();
|
|
272
|
+
const workflow = await client.getWorkflow(workflow_id);
|
|
273
|
+
return {
|
|
274
|
+
content: [{
|
|
275
|
+
type: "text",
|
|
276
|
+
text: JSON.stringify(workflow, null, 2)
|
|
277
|
+
}]
|
|
278
|
+
};
|
|
279
|
+
}
|
|
280
|
+
);
|
|
281
|
+
server.tool(
|
|
282
|
+
"kairos_activate",
|
|
283
|
+
"Activate a deployed workflow so it starts running on triggers.",
|
|
284
|
+
{
|
|
285
|
+
workflow_id: z.string().describe("The n8n workflow ID to activate")
|
|
286
|
+
},
|
|
287
|
+
async ({ workflow_id }) => {
|
|
288
|
+
if (!isAllowed("activate")) {
|
|
289
|
+
return {
|
|
290
|
+
content: [{
|
|
291
|
+
type: "text",
|
|
292
|
+
text: JSON.stringify({ error: "Activate is disabled. Set KAIROS_MCP_ALLOW_ACTIVATE=true to enable." })
|
|
293
|
+
}],
|
|
294
|
+
isError: true
|
|
295
|
+
};
|
|
296
|
+
}
|
|
297
|
+
const client = getApiClient();
|
|
298
|
+
await client.activateWorkflow(workflow_id);
|
|
299
|
+
return {
|
|
300
|
+
content: [{
|
|
301
|
+
type: "text",
|
|
302
|
+
text: `Activated workflow ${workflow_id}`
|
|
303
|
+
}]
|
|
304
|
+
};
|
|
305
|
+
}
|
|
306
|
+
);
|
|
307
|
+
server.tool(
|
|
308
|
+
"kairos_deactivate",
|
|
309
|
+
"Deactivate a running workflow.",
|
|
310
|
+
{
|
|
311
|
+
workflow_id: z.string().describe("The n8n workflow ID to deactivate")
|
|
312
|
+
},
|
|
313
|
+
async ({ workflow_id }) => {
|
|
314
|
+
const client = getApiClient();
|
|
315
|
+
await client.deactivateWorkflow(workflow_id);
|
|
316
|
+
return {
|
|
317
|
+
content: [{
|
|
318
|
+
type: "text",
|
|
319
|
+
text: `Deactivated workflow ${workflow_id}`
|
|
320
|
+
}]
|
|
321
|
+
};
|
|
322
|
+
}
|
|
323
|
+
);
|
|
324
|
+
server.tool(
|
|
325
|
+
"kairos_delete",
|
|
326
|
+
"Delete a workflow from n8n. This is irreversible.",
|
|
327
|
+
{
|
|
328
|
+
workflow_id: z.string().describe("The n8n workflow ID to delete")
|
|
329
|
+
},
|
|
330
|
+
async ({ workflow_id }) => {
|
|
331
|
+
if (!isAllowed("delete")) {
|
|
332
|
+
return {
|
|
333
|
+
content: [{
|
|
334
|
+
type: "text",
|
|
335
|
+
text: JSON.stringify({ error: "Delete is disabled. Set KAIROS_MCP_ALLOW_DELETE=true to enable." })
|
|
336
|
+
}],
|
|
337
|
+
isError: true
|
|
338
|
+
};
|
|
339
|
+
}
|
|
340
|
+
const client = getApiClient();
|
|
341
|
+
await client.deleteWorkflow(workflow_id);
|
|
342
|
+
return {
|
|
343
|
+
content: [{
|
|
344
|
+
type: "text",
|
|
345
|
+
text: `Deleted workflow ${workflow_id}`
|
|
346
|
+
}]
|
|
347
|
+
};
|
|
348
|
+
}
|
|
349
|
+
);
|
|
350
|
+
server.tool(
|
|
351
|
+
"kairos_executions",
|
|
352
|
+
"List recent executions for a workflow, showing status and timing.",
|
|
353
|
+
{
|
|
354
|
+
workflow_id: z.string().optional().describe("Filter to a specific workflow ID (omit for all)"),
|
|
355
|
+
limit: z.number().default(20).describe("Maximum number of executions to return")
|
|
356
|
+
},
|
|
357
|
+
async ({ workflow_id, limit }) => {
|
|
358
|
+
const client = getApiClient();
|
|
359
|
+
const executions = await client.getExecutions(workflow_id, { limit });
|
|
360
|
+
return {
|
|
361
|
+
content: [{
|
|
362
|
+
type: "text",
|
|
363
|
+
text: JSON.stringify(executions, null, 2)
|
|
364
|
+
}]
|
|
365
|
+
};
|
|
366
|
+
}
|
|
367
|
+
);
|
|
368
|
+
async function main() {
|
|
369
|
+
const transport = new StdioServerTransport();
|
|
370
|
+
await server.connect(transport);
|
|
371
|
+
}
|
|
372
|
+
main().catch((err) => {
|
|
373
|
+
console.error("Kairos MCP server failed to start:", err);
|
|
374
|
+
process.exit(1);
|
|
375
|
+
});
|
|
376
|
+
//# sourceMappingURL=mcp-server.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/mcp-server.ts"],"sourcesContent":["#!/usr/bin/env node\n\n/**\n * Kairos MCP Server — decomposed architecture.\n *\n * The host LLM (Claude, GPT, Gemini, whatever) generates the workflow.\n * Kairos provides the knowledge (system prompt, library, failure patterns)\n * and guardrails (validator, deployer). Zero Anthropic API key needed.\n */\n\nimport { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js'\nimport { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js'\nimport { z } from 'zod'\nimport { FileLibrary } from './library/file-library.js'\nimport { N8nValidator } from './validation/validator.js'\nimport { N8nFieldStripper } from './providers/n8n/stripper.js'\nimport { N8nApiClient } from './providers/n8n/api-client.js'\nimport { PromptBuilder } from './generation/prompt-builder.js'\nimport { TelemetryReader } from './telemetry/reader.js'\nimport { nullLogger } from './utils/logger.js'\nimport type { N8nWorkflow } from './types/workflow.js'\nimport { readFileSync } from 'node:fs'\nimport { dirname, join } from 'node:path'\nimport { fileURLToPath } from 'node:url'\n\nconst __dirname = dirname(fileURLToPath(import.meta.url))\nconst pkg = JSON.parse(readFileSync(join(__dirname, '..', 'package.json'), 'utf-8')) as { version: string }\n\nconst library = new FileLibrary()\nconst validator = new N8nValidator()\nconst stripper = new N8nFieldStripper()\nconst promptBuilder = new PromptBuilder()\n\nfunction getTelemetryReader(): TelemetryReader | null {\n try {\n return new TelemetryReader()\n } catch {\n return null\n }\n}\n\nfunction isAllowed(action: 'deploy' | 'activate' | 'delete'): boolean {\n const key = `KAIROS_MCP_ALLOW_${action.toUpperCase()}`\n return process.env[key] === 'true'\n}\n\nfunction getApiClient(): N8nApiClient {\n const baseUrl = process.env['N8N_BASE_URL']\n const apiKey = process.env['N8N_API_KEY']\n if (!baseUrl || !apiKey) {\n throw new Error('N8N_BASE_URL and N8N_API_KEY environment variables are required for n8n operations')\n }\n return new N8nApiClient(baseUrl, apiKey, nullLogger)\n}\n\nconst server = new McpServer({\n name: 'kairos',\n version: pkg.version,\n})\n\n// ── Core generation tools (no API key needed) ──────────────────────────────\n\nserver.tool(\n 'kairos_prompt',\n 'Get the specialized n8n workflow generation context. Returns a system prompt with node catalog, connection rules, validation rules, plus library matches and failure patterns for the given description. Feed this to yourself as context, then generate the workflow JSON.',\n {\n description: z.string().describe('Plain-English description of the workflow to build'),\n name: z.string().optional().describe('Optional workflow name override'),\n },\n async ({ description, name }) => {\n await library.initialize()\n const matches = await library.search(description)\n const telemetryReader = getTelemetryReader()\n const failureRates = await telemetryReader?.getFailureRates() ?? []\n\n const request = { description, ...(name ? { name } : {}) }\n const built = promptBuilder.build(request, matches, failureRates)\n\n const systemText = built.system.map(block => block.text).join('\\n\\n---\\n\\n')\n\n return {\n content: [{\n type: 'text' as const,\n text: JSON.stringify({\n mode: built.mode,\n matchCount: matches.length,\n topMatchScore: matches[0]?.score ?? null,\n systemPrompt: systemText,\n userMessage: built.userMessage,\n outputFormat: {\n description: 'Generate a JSON object with this exact structure. The workflow field contains the n8n workflow. credentialsNeeded lists services requiring credentials.',\n schema: {\n workflow: {\n name: 'string — descriptive workflow name',\n nodes: 'array — n8n node objects with id (UUID v4), type, typeVersion, name, position, parameters',\n connections: 'object — keyed by source node NAME, maps to target nodes',\n settings: 'object — include executionOrder: \"v1\"',\n },\n credentialsNeeded: [{\n service: 'string — e.g. \"Slack\"',\n credentialType: 'string — e.g. \"slackOAuth2Api\"',\n description: 'string — what the user needs to set up',\n }],\n },\n },\n }, null, 2),\n }],\n }\n },\n)\n\nserver.tool(\n 'kairos_validate',\n 'Validate n8n workflow JSON against 23 structural rules. Returns pass/fail with specific issues. If validation fails, fix the issues and call this again. Errors block deployment; warnings are advisory.',\n {\n workflow: z.string().describe('The workflow JSON string to validate'),\n },\n async ({ workflow: workflowStr }) => {\n let parsed: N8nWorkflow\n try {\n parsed = JSON.parse(workflowStr) as N8nWorkflow\n } catch (e) {\n return {\n content: [{\n type: 'text' as const,\n text: JSON.stringify({\n valid: false,\n error: `Invalid JSON: ${e instanceof Error ? e.message : String(e)}`,\n }, null, 2),\n }],\n }\n }\n\n const result = validator.validate(parsed)\n const errors = result.issues.filter(i => i.severity === 'error')\n const warnings = result.issues.filter(i => i.severity === 'warn')\n\n return {\n content: [{\n type: 'text' as const,\n text: JSON.stringify({\n valid: result.valid,\n errorCount: errors.length,\n warningCount: warnings.length,\n errors: errors.map(i => ({\n rule: i.rule,\n message: i.message,\n nodeId: i.nodeId ?? null,\n })),\n warnings: warnings.map(i => ({\n rule: i.rule,\n message: i.message,\n nodeId: i.nodeId ?? null,\n })),\n deployable: errors.length === 0,\n }, null, 2),\n }],\n }\n },\n)\n\nserver.tool(\n 'kairos_deploy',\n 'Deploy a validated workflow to n8n. Pass the workflow JSON that passed kairos_validate. Strips server-assigned fields automatically. Requires N8N_BASE_URL and N8N_API_KEY.',\n {\n workflow: z.string().describe('The validated workflow JSON string to deploy'),\n activate: z.boolean().default(false).describe('Activate the workflow immediately after deployment'),\n },\n async ({ workflow: workflowStr, activate }) => {\n if (!isAllowed('deploy')) {\n return {\n content: [{\n type: 'text' as const,\n text: JSON.stringify({ error: 'Deploy is disabled. Set KAIROS_MCP_ALLOW_DEPLOY=true to enable.' }),\n }],\n isError: true,\n }\n }\n\n let parsed: N8nWorkflow\n try {\n parsed = JSON.parse(workflowStr) as N8nWorkflow\n } catch (e) {\n return {\n content: [{\n type: 'text' as const,\n text: JSON.stringify({ error: `Invalid JSON: ${e instanceof Error ? e.message : String(e)}` }),\n }],\n }\n }\n\n const validation = validator.validate(parsed)\n const errors = validation.issues.filter(i => i.severity === 'error')\n if (errors.length > 0) {\n return {\n content: [{\n type: 'text' as const,\n text: JSON.stringify({\n error: 'Workflow has validation errors — fix them before deploying',\n errors: errors.map(i => ({ rule: i.rule, message: i.message })),\n }, null, 2),\n }],\n }\n }\n\n const client = getApiClient()\n const stripped = stripper.stripForCreate(parsed)\n const response = await client.createWorkflow(stripped)\n\n if (activate) {\n if (!isAllowed('activate')) {\n return {\n content: [{\n type: 'text' as const,\n text: JSON.stringify({\n workflowId: response.id,\n name: response.name,\n activated: false,\n warning: 'Workflow deployed but activation is disabled. Set KAIROS_MCP_ALLOW_ACTIVATE=true to enable.',\n url: `${process.env['N8N_BASE_URL']}/workflow/${response.id}`,\n }, null, 2),\n }],\n }\n }\n await client.activateWorkflow(response.id)\n }\n\n // Save to library for future retrieval\n await library.initialize()\n await library.save(parsed, {\n description: parsed.name,\n generationMode: 'scratch',\n generationAttempts: 1,\n })\n\n return {\n content: [{\n type: 'text' as const,\n text: JSON.stringify({\n workflowId: response.id,\n name: response.name,\n activated: activate,\n url: `${process.env['N8N_BASE_URL']}/workflow/${response.id}`,\n }, null, 2),\n }],\n }\n },\n)\n\nserver.tool(\n 'kairos_search',\n 'Search the local workflow library for similar past builds. Returns matching workflows with scores, useful for finding examples and reusing patterns.',\n {\n query: z.string().describe('Search query — a workflow description or keywords'),\n limit: z.number().default(5).describe('Maximum number of results'),\n },\n async ({ query, limit }) => {\n await library.initialize()\n const matches = await library.search(query)\n\n return {\n content: [{\n type: 'text' as const,\n text: JSON.stringify(\n matches.slice(0, limit).map(m => ({\n score: Number(m.score.toFixed(3)),\n mode: m.mode,\n description: m.workflow.description,\n nodeCount: m.workflow.workflow.nodes.length,\n nodes: m.workflow.workflow.nodes.map(n => n.name),\n failurePatterns: m.workflow.failurePatterns ?? [],\n })),\n null,\n 2,\n ),\n }],\n }\n },\n)\n\n// ── n8n management tools (need N8N_BASE_URL + N8N_API_KEY) ─────────────────\n\nserver.tool(\n 'kairos_list',\n 'List all workflows deployed on the connected n8n instance.',\n {},\n async () => {\n const client = getApiClient()\n const workflows = await client.listWorkflows()\n\n return {\n content: [{\n type: 'text' as const,\n text: JSON.stringify(workflows, null, 2),\n }],\n }\n },\n)\n\nserver.tool(\n 'kairos_get',\n 'Get the full JSON definition of a specific workflow by ID.',\n {\n workflow_id: z.string().describe('The n8n workflow ID'),\n },\n async ({ workflow_id }) => {\n const client = getApiClient()\n const workflow = await client.getWorkflow(workflow_id)\n\n return {\n content: [{\n type: 'text' as const,\n text: JSON.stringify(workflow, null, 2),\n }],\n }\n },\n)\n\nserver.tool(\n 'kairos_activate',\n 'Activate a deployed workflow so it starts running on triggers.',\n {\n workflow_id: z.string().describe('The n8n workflow ID to activate'),\n },\n async ({ workflow_id }) => {\n if (!isAllowed('activate')) {\n return {\n content: [{\n type: 'text' as const,\n text: JSON.stringify({ error: 'Activate is disabled. Set KAIROS_MCP_ALLOW_ACTIVATE=true to enable.' }),\n }],\n isError: true,\n }\n }\n\n const client = getApiClient()\n await client.activateWorkflow(workflow_id)\n\n return {\n content: [{\n type: 'text' as const,\n text: `Activated workflow ${workflow_id}`,\n }],\n }\n },\n)\n\nserver.tool(\n 'kairos_deactivate',\n 'Deactivate a running workflow.',\n {\n workflow_id: z.string().describe('The n8n workflow ID to deactivate'),\n },\n async ({ workflow_id }) => {\n const client = getApiClient()\n await client.deactivateWorkflow(workflow_id)\n\n return {\n content: [{\n type: 'text' as const,\n text: `Deactivated workflow ${workflow_id}`,\n }],\n }\n },\n)\n\nserver.tool(\n 'kairos_delete',\n 'Delete a workflow from n8n. This is irreversible.',\n {\n workflow_id: z.string().describe('The n8n workflow ID to delete'),\n },\n async ({ workflow_id }) => {\n if (!isAllowed('delete')) {\n return {\n content: [{\n type: 'text' as const,\n text: JSON.stringify({ error: 'Delete is disabled. Set KAIROS_MCP_ALLOW_DELETE=true to enable.' }),\n }],\n isError: true,\n }\n }\n\n const client = getApiClient()\n await client.deleteWorkflow(workflow_id)\n\n return {\n content: [{\n type: 'text' as const,\n text: `Deleted workflow ${workflow_id}`,\n }],\n }\n },\n)\n\nserver.tool(\n 'kairos_executions',\n 'List recent executions for a workflow, showing status and timing.',\n {\n workflow_id: z.string().optional().describe('Filter to a specific workflow ID (omit for all)'),\n limit: z.number().default(20).describe('Maximum number of executions to return'),\n },\n async ({ workflow_id, limit }) => {\n const client = getApiClient()\n const executions = await client.getExecutions(workflow_id, { limit })\n\n return {\n content: [{\n type: 'text' as const,\n text: JSON.stringify(executions, null, 2),\n }],\n }\n },\n)\n\nasync function main() {\n const transport = new StdioServerTransport()\n await server.connect(transport)\n}\n\nmain().catch((err: unknown) => {\n console.error('Kairos MCP server failed to start:', err)\n process.exit(1)\n})\n"],"mappings":";;;;;;;;;;;;AAUA,SAAS,iBAAiB;AAC1B,SAAS,4BAA4B;AACrC,SAAS,SAAS;AASlB,SAAS,oBAAoB;AAC7B,SAAS,SAAS,YAAY;AAC9B,SAAS,qBAAqB;AAE9B,IAAM,YAAY,QAAQ,cAAc,YAAY,GAAG,CAAC;AACxD,IAAM,MAAM,KAAK,MAAM,aAAa,KAAK,WAAW,MAAM,cAAc,GAAG,OAAO,CAAC;AAEnF,IAAM,UAAU,IAAI,YAAY;AAChC,IAAM,YAAY,IAAI,aAAa;AACnC,IAAM,WAAW,IAAI,iBAAiB;AACtC,IAAM,gBAAgB,IAAI,cAAc;AAExC,SAAS,qBAA6C;AACpD,MAAI;AACF,WAAO,IAAI,gBAAgB;AAAA,EAC7B,QAAQ;AACN,WAAO;AAAA,EACT;AACF;AAEA,SAAS,UAAU,QAAmD;AACpE,QAAM,MAAM,oBAAoB,OAAO,YAAY,CAAC;AACpD,SAAO,QAAQ,IAAI,GAAG,MAAM;AAC9B;AAEA,SAAS,eAA6B;AACpC,QAAM,UAAU,QAAQ,IAAI,cAAc;AAC1C,QAAM,SAAS,QAAQ,IAAI,aAAa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,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,SAAS,wCAAwC;AAAA,EACjF;AAAA,EACA,OAAO,EAAE,aAAa,MAAM,MAAM;AAChC,UAAM,SAAS,aAAa;AAC5B,UAAM,aAAa,MAAM,OAAO,cAAc,aAAa,EAAE,MAAM,CAAC;AAEpE,WAAO;AAAA,MACL,SAAS,CAAC;AAAA,QACR,MAAM;AAAA,QACN,MAAM,KAAK,UAAU,YAAY,MAAM,CAAC;AAAA,MAC1C,CAAC;AAAA,IACH;AAAA,EACF;AACF;AAEA,eAAe,OAAO;AACpB,QAAM,YAAY,IAAI,qBAAqB;AAC3C,QAAM,OAAO,QAAQ,SAAS;AAChC;AAEA,KAAK,EAAE,MAAM,CAAC,QAAiB;AAC7B,UAAQ,MAAM,sCAAsC,GAAG;AACvD,UAAQ,KAAK,CAAC;AAChB,CAAC;","names":[]}
|
package/package.json
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kairos-sdk/core",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "LLM-powered n8n workflow generation
|
|
3
|
+
"version": "0.3.0",
|
|
4
|
+
"description": "LLM-powered n8n workflow generation — use as an SDK or MCP server",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|
|
7
7
|
"module": "./dist/index.js",
|
|
8
8
|
"types": "./dist/index.d.ts",
|
|
9
9
|
"bin": {
|
|
10
|
-
"kairos": "dist/cli.js"
|
|
10
|
+
"kairos": "dist/cli.js",
|
|
11
|
+
"kairos-mcp": "dist/mcp-server.js"
|
|
11
12
|
},
|
|
12
13
|
"exports": {
|
|
13
14
|
".": {
|
|
@@ -42,14 +43,32 @@
|
|
|
42
43
|
"llm",
|
|
43
44
|
"workflow-generation",
|
|
44
45
|
"kairos",
|
|
45
|
-
"no-code"
|
|
46
|
+
"no-code",
|
|
47
|
+
"mcp",
|
|
48
|
+
"model-context-protocol"
|
|
46
49
|
],
|
|
50
|
+
"repository": {
|
|
51
|
+
"type": "git",
|
|
52
|
+
"url": "git+https://github.com/Kruttz/kairos-sdk.git"
|
|
53
|
+
},
|
|
54
|
+
"homepage": "https://github.com/Kruttz/kairos-sdk#readme",
|
|
55
|
+
"bugs": {
|
|
56
|
+
"url": "https://github.com/Kruttz/kairos-sdk/issues"
|
|
57
|
+
},
|
|
47
58
|
"author": "Jordan Krutman",
|
|
48
59
|
"license": "MIT",
|
|
49
60
|
"peerDependencies": {
|
|
50
61
|
"@anthropic-ai/sdk": ">=0.30.0"
|
|
51
62
|
},
|
|
52
|
-
"
|
|
63
|
+
"peerDependenciesMeta": {
|
|
64
|
+
"@anthropic-ai/sdk": {
|
|
65
|
+
"optional": true
|
|
66
|
+
}
|
|
67
|
+
},
|
|
68
|
+
"dependencies": {
|
|
69
|
+
"@modelcontextprotocol/sdk": "^1.29.0",
|
|
70
|
+
"zod": "^4.4.3"
|
|
71
|
+
},
|
|
53
72
|
"devDependencies": {
|
|
54
73
|
"@anthropic-ai/sdk": "^0.36.0",
|
|
55
74
|
"@types/node": "^20.0.0",
|