@enactprotocol/cli 2.1.32 → 2.1.33
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/commands/mcp/index.d.ts.map +1 -1
- package/dist/commands/mcp/index.js +62 -2
- package/dist/commands/mcp/index.js.map +1 -1
- package/dist/commands/verify/index.d.ts +16 -0
- package/dist/commands/verify/index.d.ts.map +1 -0
- package/dist/commands/verify/index.js +386 -0
- package/dist/commands/verify/index.js.map +1 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/package.json +5 -5
- package/src/commands/mcp/index.ts +75 -2
- package/src/index.ts +1 -1
- package/tsconfig.tsbuildinfo +1 -1
|
@@ -52,6 +52,11 @@ interface McpInstallOptions extends GlobalOptions {
|
|
|
52
52
|
client?: string;
|
|
53
53
|
}
|
|
54
54
|
|
|
55
|
+
interface McpServeOptions extends GlobalOptions {
|
|
56
|
+
http?: boolean;
|
|
57
|
+
port?: number;
|
|
58
|
+
}
|
|
59
|
+
|
|
55
60
|
interface McpOptions extends GlobalOptions {
|
|
56
61
|
all?: boolean;
|
|
57
62
|
sync?: boolean;
|
|
@@ -115,7 +120,17 @@ function detectClients(): McpClient[] {
|
|
|
115
120
|
},
|
|
116
121
|
configFormat: "json",
|
|
117
122
|
detected: false,
|
|
118
|
-
instructions:
|
|
123
|
+
instructions: `Run this command to add the Enact MCP server to Claude Code:
|
|
124
|
+
|
|
125
|
+
claude mcp add enact -- npx -y @enactprotocol/mcp-server
|
|
126
|
+
|
|
127
|
+
For HTTP mode (remote/web access):
|
|
128
|
+
|
|
129
|
+
claude mcp add enact --transport http --url http://localhost:3000/mcp
|
|
130
|
+
|
|
131
|
+
Then start the server with: enact mcp serve --http
|
|
132
|
+
|
|
133
|
+
Or manually add to mcpServers in your Claude Desktop config:`,
|
|
119
134
|
configTemplate: (mcpPath) => `{
|
|
120
135
|
"mcpServers": {
|
|
121
136
|
"enact": {
|
|
@@ -247,7 +262,10 @@ function showClientConfig(client: McpClient, mcpPath: string): void {
|
|
|
247
262
|
|
|
248
263
|
if (client.id === "claude-code") {
|
|
249
264
|
newline();
|
|
250
|
-
dim(
|
|
265
|
+
dim("For HTTP mode, run: enact mcp serve --http --port 3000");
|
|
266
|
+
dim(
|
|
267
|
+
"Then add to Claude: claude mcp add enact --transport http --url http://localhost:3000/mcp"
|
|
268
|
+
);
|
|
251
269
|
}
|
|
252
270
|
|
|
253
271
|
newline();
|
|
@@ -637,12 +655,67 @@ async function toolsetHandler(action: string, args: string[], options: McpOption
|
|
|
637
655
|
}
|
|
638
656
|
}
|
|
639
657
|
|
|
658
|
+
/**
|
|
659
|
+
* Start the MCP server
|
|
660
|
+
*/
|
|
661
|
+
async function serveHandler(options: McpServeOptions): Promise<void> {
|
|
662
|
+
const { spawn } = await import("node:child_process");
|
|
663
|
+
|
|
664
|
+
const args: string[] = [];
|
|
665
|
+
|
|
666
|
+
if (options.http) {
|
|
667
|
+
args.push("--http");
|
|
668
|
+
if (options.port) {
|
|
669
|
+
args.push("--port", String(options.port));
|
|
670
|
+
}
|
|
671
|
+
}
|
|
672
|
+
|
|
673
|
+
if (!options.json) {
|
|
674
|
+
if (options.http) {
|
|
675
|
+
info(`Starting Enact MCP server in HTTP mode on port ${options.port || 3000}...`);
|
|
676
|
+
} else {
|
|
677
|
+
info("Starting Enact MCP server in stdio mode...");
|
|
678
|
+
}
|
|
679
|
+
newline();
|
|
680
|
+
}
|
|
681
|
+
|
|
682
|
+
// Spawn the MCP server process
|
|
683
|
+
const child = spawn("bunx", ["-y", "@enactprotocol/mcp-server", ...args], {
|
|
684
|
+
stdio: "inherit",
|
|
685
|
+
env: process.env,
|
|
686
|
+
});
|
|
687
|
+
|
|
688
|
+
child.on("error", (err) => {
|
|
689
|
+
error(`Failed to start MCP server: ${err.message}`);
|
|
690
|
+
process.exit(1);
|
|
691
|
+
});
|
|
692
|
+
|
|
693
|
+
child.on("exit", (code) => {
|
|
694
|
+
process.exit(code ?? 0);
|
|
695
|
+
});
|
|
696
|
+
}
|
|
697
|
+
|
|
640
698
|
/**
|
|
641
699
|
* Configure the mcp command
|
|
642
700
|
*/
|
|
643
701
|
export function configureMcpCommand(program: Command): void {
|
|
644
702
|
const mcp = program.command("mcp").description("Manage MCP-exposed tools and toolsets");
|
|
645
703
|
|
|
704
|
+
// enact mcp serve
|
|
705
|
+
mcp
|
|
706
|
+
.command("serve")
|
|
707
|
+
.description("Start the Enact MCP server")
|
|
708
|
+
.option("--http", "Run in HTTP mode instead of stdio")
|
|
709
|
+
.option("-p, --port <port>", "Port for HTTP mode (default: 3000)", Number.parseInt)
|
|
710
|
+
.action(async (options: McpServeOptions) => {
|
|
711
|
+
try {
|
|
712
|
+
await serveHandler(options);
|
|
713
|
+
} catch (err) {
|
|
714
|
+
error(formatError(err));
|
|
715
|
+
process.exit(1);
|
|
716
|
+
}
|
|
717
|
+
});
|
|
718
|
+
|
|
646
719
|
// enact mcp install
|
|
647
720
|
mcp
|
|
648
721
|
.command("install")
|
package/src/index.ts
CHANGED
|
@@ -36,7 +36,7 @@ import {
|
|
|
36
36
|
} from "./commands";
|
|
37
37
|
import { error, formatError } from "./utils";
|
|
38
38
|
|
|
39
|
-
export const version = "2.1.
|
|
39
|
+
export const version = "2.1.33";
|
|
40
40
|
|
|
41
41
|
// Export types for external use
|
|
42
42
|
export type { GlobalOptions, CommandContext } from "./types";
|