@contextual-io/cli 0.8.1 → 0.8.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/README.md +1 -1
- package/dist/commands/mcp/index.d.ts +1 -3
- package/dist/commands/mcp/index.js +1 -10
- package/dist/commands/mcp/serve.js +3 -0
- package/oclif.manifest.json +109 -116
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -3,9 +3,7 @@ export default class Mcp extends BaseConfigCommand<typeof Mcp> {
|
|
|
3
3
|
static args: {};
|
|
4
4
|
static description: string;
|
|
5
5
|
static examples: string[];
|
|
6
|
-
static flags: {
|
|
7
|
-
debug: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
8
|
-
};
|
|
6
|
+
static flags: {};
|
|
9
7
|
static usage: string[];
|
|
10
8
|
run(): Promise<void>;
|
|
11
9
|
}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { Flags } from "@oclif/core";
|
|
2
1
|
import { BaseConfigCommand } from "../../base.js";
|
|
3
2
|
export default class Mcp extends BaseConfigCommand {
|
|
4
3
|
static args = {};
|
|
@@ -7,19 +6,11 @@ export default class Mcp extends BaseConfigCommand {
|
|
|
7
6
|
"<%= config.bin %> <%= command.id %> serve",
|
|
8
7
|
"<%= config.bin %> <%= command.id %> serve flow-editor --flow my-flow-id",
|
|
9
8
|
];
|
|
10
|
-
static flags = {
|
|
11
|
-
"debug": Flags.boolean({
|
|
12
|
-
default: false,
|
|
13
|
-
hidden: true,
|
|
14
|
-
}),
|
|
15
|
-
};
|
|
9
|
+
static flags = {};
|
|
16
10
|
static usage = [
|
|
17
11
|
"<%= command.id %> <COMMAND>",
|
|
18
12
|
];
|
|
19
13
|
async run() {
|
|
20
|
-
if (this.flags.debug) {
|
|
21
|
-
console.log("user-agent: %s", process.env.npm_config_user_agent);
|
|
22
|
-
}
|
|
23
14
|
await this.showHelp();
|
|
24
15
|
}
|
|
25
16
|
}
|
|
@@ -55,6 +55,9 @@ export default class McpServe extends BaseCommand {
|
|
|
55
55
|
const toolPrefix = this.flags["tool-prefix"] ? defaultToolPrefix : "";
|
|
56
56
|
const interfaceType = this.args.interface;
|
|
57
57
|
const config = await this.currentConfig();
|
|
58
|
+
if (!config.bearerToken || !config.expiresAt || config.expiresAt <= new Date().toISOString()) {
|
|
59
|
+
throw new Error("Config is expired or not logged in. Run 'ctxl config login' to login.");
|
|
60
|
+
}
|
|
58
61
|
const server = await startCtxlMcpHttpServer({
|
|
59
62
|
createBridgeManager: () => createBridgeManager({
|
|
60
63
|
config,
|
package/oclif.manifest.json
CHANGED
|
@@ -1,120 +1,5 @@
|
|
|
1
1
|
{
|
|
2
2
|
"commands": {
|
|
3
|
-
"mcp": {
|
|
4
|
-
"aliases": [],
|
|
5
|
-
"args": {},
|
|
6
|
-
"description": "Manage local MCP server commands. Start with 'ctxl mcp serve' to run the local MCP bridge.",
|
|
7
|
-
"examples": [
|
|
8
|
-
"<%= config.bin %> <%= command.id %> serve",
|
|
9
|
-
"<%= config.bin %> <%= command.id %> serve flow-editor --flow my-flow-id"
|
|
10
|
-
],
|
|
11
|
-
"flags": {
|
|
12
|
-
"debug": {
|
|
13
|
-
"hidden": true,
|
|
14
|
-
"name": "debug",
|
|
15
|
-
"allowNo": false,
|
|
16
|
-
"type": "boolean"
|
|
17
|
-
}
|
|
18
|
-
},
|
|
19
|
-
"hasDynamicHelp": false,
|
|
20
|
-
"hiddenAliases": [],
|
|
21
|
-
"id": "mcp",
|
|
22
|
-
"pluginAlias": "@contextual-io/cli",
|
|
23
|
-
"pluginName": "@contextual-io/cli",
|
|
24
|
-
"pluginType": "core",
|
|
25
|
-
"strict": true,
|
|
26
|
-
"usage": [
|
|
27
|
-
"<%= command.id %> <COMMAND>"
|
|
28
|
-
],
|
|
29
|
-
"enableJsonFlag": false,
|
|
30
|
-
"isESM": true,
|
|
31
|
-
"relativePath": [
|
|
32
|
-
"dist",
|
|
33
|
-
"commands",
|
|
34
|
-
"mcp",
|
|
35
|
-
"index.js"
|
|
36
|
-
]
|
|
37
|
-
},
|
|
38
|
-
"mcp:serve": {
|
|
39
|
-
"aliases": [],
|
|
40
|
-
"args": {
|
|
41
|
-
"interface": {
|
|
42
|
-
"default": "flow-editor",
|
|
43
|
-
"description": "Interface type to scope tools for. Available interfaces depend on your platform version.",
|
|
44
|
-
"name": "interface",
|
|
45
|
-
"required": false
|
|
46
|
-
}
|
|
47
|
-
},
|
|
48
|
-
"description": "Start a local MCP HTTP server that connects to SolutionAI for a given interface type. By default it binds to http://localhost:5051/. The server fetches the full tool manifest from SolutionAI and serves all tools immediately. Pass a flowId with each tool call to target a specific flow, or use list_sessions to discover available flows.",
|
|
49
|
-
"examples": [
|
|
50
|
-
"<%= config.bin %> <%= command.id %>",
|
|
51
|
-
"<%= config.bin %> <%= command.id %> flow-editor --flow my-flow-id"
|
|
52
|
-
],
|
|
53
|
-
"flags": {
|
|
54
|
-
"config-id": {
|
|
55
|
-
"char": "C",
|
|
56
|
-
"helpGroup": "GLOBAL",
|
|
57
|
-
"name": "config-id",
|
|
58
|
-
"summary": "Specify config id to use for call.",
|
|
59
|
-
"hasDynamicHelp": false,
|
|
60
|
-
"multiple": false,
|
|
61
|
-
"type": "option"
|
|
62
|
-
},
|
|
63
|
-
"flow": {
|
|
64
|
-
"char": "f",
|
|
65
|
-
"description": "pre-filter session listing to a specific flow ID",
|
|
66
|
-
"name": "flow",
|
|
67
|
-
"hasDynamicHelp": false,
|
|
68
|
-
"multiple": false,
|
|
69
|
-
"type": "option"
|
|
70
|
-
},
|
|
71
|
-
"port": {
|
|
72
|
-
"char": "p",
|
|
73
|
-
"description": "local HTTP port (default: 5051)",
|
|
74
|
-
"name": "port",
|
|
75
|
-
"hasDynamicHelp": false,
|
|
76
|
-
"multiple": false,
|
|
77
|
-
"type": "option"
|
|
78
|
-
},
|
|
79
|
-
"tool-prefix": {
|
|
80
|
-
"char": "t",
|
|
81
|
-
"description": "prefix all MCP tool names with ctxl_",
|
|
82
|
-
"name": "tool-prefix",
|
|
83
|
-
"allowNo": true,
|
|
84
|
-
"type": "boolean"
|
|
85
|
-
},
|
|
86
|
-
"url": {
|
|
87
|
-
"description": "override MCP route URL (http/https)",
|
|
88
|
-
"hidden": true,
|
|
89
|
-
"name": "url",
|
|
90
|
-
"hasDynamicHelp": false,
|
|
91
|
-
"multiple": false,
|
|
92
|
-
"type": "option"
|
|
93
|
-
},
|
|
94
|
-
"verbose": {
|
|
95
|
-
"char": "V",
|
|
96
|
-
"description": "emit verbose MCP runtime diagnostics",
|
|
97
|
-
"name": "verbose",
|
|
98
|
-
"allowNo": false,
|
|
99
|
-
"type": "boolean"
|
|
100
|
-
}
|
|
101
|
-
},
|
|
102
|
-
"hasDynamicHelp": false,
|
|
103
|
-
"hiddenAliases": [],
|
|
104
|
-
"id": "mcp:serve",
|
|
105
|
-
"pluginAlias": "@contextual-io/cli",
|
|
106
|
-
"pluginName": "@contextual-io/cli",
|
|
107
|
-
"pluginType": "core",
|
|
108
|
-
"strict": true,
|
|
109
|
-
"enableJsonFlag": false,
|
|
110
|
-
"isESM": true,
|
|
111
|
-
"relativePath": [
|
|
112
|
-
"dist",
|
|
113
|
-
"commands",
|
|
114
|
-
"mcp",
|
|
115
|
-
"serve.js"
|
|
116
|
-
]
|
|
117
|
-
},
|
|
118
3
|
"config:add": {
|
|
119
4
|
"aliases": [],
|
|
120
5
|
"args": {
|
|
@@ -380,6 +265,114 @@
|
|
|
380
265
|
"use.js"
|
|
381
266
|
]
|
|
382
267
|
},
|
|
268
|
+
"mcp": {
|
|
269
|
+
"aliases": [],
|
|
270
|
+
"args": {},
|
|
271
|
+
"description": "Manage local MCP server commands. Start with 'ctxl mcp serve' to run the local MCP bridge.",
|
|
272
|
+
"examples": [
|
|
273
|
+
"<%= config.bin %> <%= command.id %> serve",
|
|
274
|
+
"<%= config.bin %> <%= command.id %> serve flow-editor --flow my-flow-id"
|
|
275
|
+
],
|
|
276
|
+
"flags": {},
|
|
277
|
+
"hasDynamicHelp": false,
|
|
278
|
+
"hiddenAliases": [],
|
|
279
|
+
"id": "mcp",
|
|
280
|
+
"pluginAlias": "@contextual-io/cli",
|
|
281
|
+
"pluginName": "@contextual-io/cli",
|
|
282
|
+
"pluginType": "core",
|
|
283
|
+
"strict": true,
|
|
284
|
+
"usage": [
|
|
285
|
+
"<%= command.id %> <COMMAND>"
|
|
286
|
+
],
|
|
287
|
+
"enableJsonFlag": false,
|
|
288
|
+
"isESM": true,
|
|
289
|
+
"relativePath": [
|
|
290
|
+
"dist",
|
|
291
|
+
"commands",
|
|
292
|
+
"mcp",
|
|
293
|
+
"index.js"
|
|
294
|
+
]
|
|
295
|
+
},
|
|
296
|
+
"mcp:serve": {
|
|
297
|
+
"aliases": [],
|
|
298
|
+
"args": {
|
|
299
|
+
"interface": {
|
|
300
|
+
"default": "flow-editor",
|
|
301
|
+
"description": "Interface type to scope tools for. Available interfaces depend on your platform version.",
|
|
302
|
+
"name": "interface",
|
|
303
|
+
"required": false
|
|
304
|
+
}
|
|
305
|
+
},
|
|
306
|
+
"description": "Start a local MCP HTTP server that connects to SolutionAI for a given interface type. By default it binds to http://localhost:5051/. The server fetches the full tool manifest from SolutionAI and serves all tools immediately. Pass a flowId with each tool call to target a specific flow, or use list_sessions to discover available flows.",
|
|
307
|
+
"examples": [
|
|
308
|
+
"<%= config.bin %> <%= command.id %>",
|
|
309
|
+
"<%= config.bin %> <%= command.id %> flow-editor --flow my-flow-id"
|
|
310
|
+
],
|
|
311
|
+
"flags": {
|
|
312
|
+
"config-id": {
|
|
313
|
+
"char": "C",
|
|
314
|
+
"helpGroup": "GLOBAL",
|
|
315
|
+
"name": "config-id",
|
|
316
|
+
"summary": "Specify config id to use for call.",
|
|
317
|
+
"hasDynamicHelp": false,
|
|
318
|
+
"multiple": false,
|
|
319
|
+
"type": "option"
|
|
320
|
+
},
|
|
321
|
+
"flow": {
|
|
322
|
+
"char": "f",
|
|
323
|
+
"description": "pre-filter session listing to a specific flow ID",
|
|
324
|
+
"name": "flow",
|
|
325
|
+
"hasDynamicHelp": false,
|
|
326
|
+
"multiple": false,
|
|
327
|
+
"type": "option"
|
|
328
|
+
},
|
|
329
|
+
"port": {
|
|
330
|
+
"char": "p",
|
|
331
|
+
"description": "local HTTP port (default: 5051)",
|
|
332
|
+
"name": "port",
|
|
333
|
+
"hasDynamicHelp": false,
|
|
334
|
+
"multiple": false,
|
|
335
|
+
"type": "option"
|
|
336
|
+
},
|
|
337
|
+
"tool-prefix": {
|
|
338
|
+
"char": "t",
|
|
339
|
+
"description": "prefix all MCP tool names with ctxl_",
|
|
340
|
+
"name": "tool-prefix",
|
|
341
|
+
"allowNo": true,
|
|
342
|
+
"type": "boolean"
|
|
343
|
+
},
|
|
344
|
+
"url": {
|
|
345
|
+
"description": "override MCP route URL (http/https)",
|
|
346
|
+
"hidden": true,
|
|
347
|
+
"name": "url",
|
|
348
|
+
"hasDynamicHelp": false,
|
|
349
|
+
"multiple": false,
|
|
350
|
+
"type": "option"
|
|
351
|
+
},
|
|
352
|
+
"verbose": {
|
|
353
|
+
"char": "V",
|
|
354
|
+
"description": "emit verbose MCP runtime diagnostics",
|
|
355
|
+
"name": "verbose",
|
|
356
|
+
"allowNo": false,
|
|
357
|
+
"type": "boolean"
|
|
358
|
+
}
|
|
359
|
+
},
|
|
360
|
+
"hasDynamicHelp": false,
|
|
361
|
+
"hiddenAliases": [],
|
|
362
|
+
"id": "mcp:serve",
|
|
363
|
+
"pluginAlias": "@contextual-io/cli",
|
|
364
|
+
"pluginName": "@contextual-io/cli",
|
|
365
|
+
"pluginType": "core",
|
|
366
|
+
"strict": true,
|
|
367
|
+
"enableJsonFlag": false,
|
|
368
|
+
"isESM": true,
|
|
369
|
+
"relativePath": [
|
|
370
|
+
"dist",
|
|
371
|
+
"commands",
|
|
372
|
+
"mcp",
|
|
373
|
+
"serve.js"
|
|
374
|
+
]
|
|
375
|
+
},
|
|
383
376
|
"records:add": {
|
|
384
377
|
"aliases": [
|
|
385
378
|
"records:create",
|
|
@@ -1374,5 +1367,5 @@
|
|
|
1374
1367
|
]
|
|
1375
1368
|
}
|
|
1376
1369
|
},
|
|
1377
|
-
"version": "0.8.
|
|
1370
|
+
"version": "0.8.3"
|
|
1378
1371
|
}
|