@mcpc-tech/cli 0.1.14 → 0.1.15

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/bin/mcpc.mjs CHANGED
@@ -4391,6 +4391,16 @@ var createServer = async (config2) => {
4391
4391
  import { readFile } from "node:fs/promises";
4392
4392
  import { resolve as resolve2 } from "node:path";
4393
4393
  import process7 from "node:process";
4394
+ function extractServerName(command, commandArgs) {
4395
+ for (const arg of commandArgs) {
4396
+ if (!arg.startsWith("-")) {
4397
+ const name2 = arg.replace(/[@.,/\\:;!?#$%^&*()[\]{}]/g, "_").substring(0, 64);
4398
+ if (name2) return name2;
4399
+ }
4400
+ }
4401
+ const name = command.replace(/[@.,/\\:;!?#$%^&*()[\]{}]/g, "_").substring(0, 64);
4402
+ return name || "agentic-tool";
4403
+ }
4394
4404
  function createProxyConfig(args) {
4395
4405
  if (!args.proxyCommand || args.proxyCommand.length === 0) {
4396
4406
  console.error("Error: --proxy requires a command after --");
@@ -4415,16 +4425,7 @@ function createProxyConfig(args) {
4415
4425
  }
4416
4426
  const command = args.proxyCommand[0];
4417
4427
  const commandArgs = args.proxyCommand.slice(1);
4418
- let serverName = "mcp-server";
4419
- const npmPackageMatch = command.match(/@[\w-]+\/([\w-]+)/) || commandArgs.join(" ").match(/@[\w-]+\/([\w-]+)/);
4420
- if (npmPackageMatch) {
4421
- serverName = npmPackageMatch[1];
4422
- } else {
4423
- const baseName = command.split("/").pop()?.replace(/\.js$/, "");
4424
- if (baseName && baseName !== "npx" && baseName !== "node") {
4425
- serverName = baseName;
4426
- }
4427
- }
4428
+ const serverName = args.name || extractServerName(command, commandArgs);
4428
4429
  const config2 = {
4429
4430
  name: `${serverName}-proxy`,
4430
4431
  version: "0.1.0",
@@ -4435,8 +4436,7 @@ function createProxyConfig(args) {
4435
4436
  agents: [
4436
4437
  {
4437
4438
  name: serverName,
4438
- description: `Agentic tool to orchestrate ${serverName} MCP server tools:
4439
- <tool name="${serverName}.__ALL__"/>`,
4439
+ description: `Orchestrate ${serverName} MCP server tools`,
4440
4440
  deps: {
4441
4441
  mcpServers: {
4442
4442
  [serverName]: {
@@ -4447,7 +4447,10 @@ function createProxyConfig(args) {
4447
4447
  }
4448
4448
  },
4449
4449
  options: {
4450
- mode: args.mode || "agentic"
4450
+ mode: args.mode || "agentic",
4451
+ refs: [
4452
+ `<tool name="${serverName}.__ALL__"/>`
4453
+ ]
4451
4454
  }
4452
4455
  }
4453
4456
  ]
@@ -4488,6 +4491,7 @@ OPTIONS:
4488
4491
  Example: --proxy --transport-type stdio -- npx -y @wonderwhy-er/desktop-commander
4489
4492
  --transport-type <type> Transport type for proxy mode
4490
4493
  Supported types: stdio, streamable-http, sse
4494
+ --name <name> Custom server name for proxy mode (overrides auto-detection)
4491
4495
 
4492
4496
  ENVIRONMENT VARIABLES:
4493
4497
  MCPC_CONFIG Inline JSON configuration (same as --config)
@@ -4501,6 +4505,9 @@ EXAMPLES:
4501
4505
  # Proxy mode - wrap an existing MCP server (stdio)
4502
4506
  mcpc --proxy --transport-type stdio -- npx -y @wonderwhy-er/desktop-commander
4503
4507
 
4508
+ # Proxy mode with custom server name
4509
+ mcpc --proxy --transport-type stdio --name my-server -- npx shadcn@latest mcp
4510
+
4504
4511
  # Proxy mode - wrap an MCP server (streamable-http)
4505
4512
  mcpc --proxy --transport-type streamable-http -- https://api.example.com/mcp
4506
4513
 
@@ -4575,6 +4582,8 @@ function parseArgs() {
4575
4582
  result.transportType = args[++i];
4576
4583
  } else if (arg === "--mode" && i + 1 < args.length) {
4577
4584
  result.mode = args[++i];
4585
+ } else if (arg === "--name" && i + 1 < args.length) {
4586
+ result.name = args[++i];
4578
4587
  } else if (arg === "--") {
4579
4588
  result.proxyCommand = args.slice(i + 1);
4580
4589
  break;
@@ -4725,7 +4734,13 @@ config?.agents.forEach((agent) => {
4725
4734
  if (agent.plugins?.length ?? true) {
4726
4735
  agent.plugins = [];
4727
4736
  }
4728
- agent.plugins?.push(createCodeExecutionPlugin());
4737
+ agent.plugins?.push(
4738
+ createCodeExecutionPlugin({
4739
+ sandbox: {
4740
+ timeout: 3e5
4741
+ }
4742
+ })
4743
+ );
4729
4744
  });
4730
4745
  if (config) {
4731
4746
  console.error(`Loaded configuration with ${config.agents.length} agent(s)`);
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "@mcpc-tech/cli",
3
- "version": "0.1.14",
3
+ "version": "0.1.15",
4
4
  "homepage": "https://jsr.io/@mcpc/cli",
5
5
  "type": "module",
6
6
  "dependencies": {
7
7
  "@hono/zod-openapi": "^0.19.2",
8
- "@mcpc-tech/plugin-code-execution": "^0.0.4",
8
+ "@mcpc-tech/plugin-code-execution": "^0.0.5",
9
9
  "@modelcontextprotocol/sdk": "^1.8.0",
10
10
  "zod": "^3.24.2",
11
11
  "@mcpc-tech/ripgrep-napi": "^0.0.4",
@@ -1 +1 @@
1
- {"version":3,"file":"loader.d.ts","sources":["../../../src/config/loader.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2CC,GAED,cAAc,iBAAiB,0BAAgC;AAK/D,iBAAiB;EACf;;GAEC,GACD,OAAO,MAAM;EACb;;GAEC,GACD,UAAU,MAAM;EAChB;;GAEC,GACD;IACE,QAAQ,OAAO,MAAM,EAAE,OAAO;IAC9B,WAAW,OAAO,MAAM,EAAE,OAAO;;EAEnC;;GAEC,GACD,QAAQ;;AAgQV;;;CAGC,GACD,OAAO,iBAAe,cAAc,QAAQ,aAAa,IAAI;AAqL7D;;CAEC,GACD,OAAO,iBAAS,eAAe,QAAQ,UAAU,GAAG,IAAI"}
1
+ {"version":3,"file":"loader.d.ts","sources":["../../../src/config/loader.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2CC,GAED,cAAc,iBAAiB,0BAAgC;AAK/D,iBAAiB;EACf;;GAEC,GACD,OAAO,MAAM;EACb;;GAEC,GACD,UAAU,MAAM;EAChB;;GAEC,GACD;IACE,QAAQ,OAAO,MAAM,EAAE,OAAO;IAC9B,WAAW,OAAO,MAAM,EAAE,OAAO;;EAEnC;;GAEC,GACD,QAAQ;;AAqRV;;;CAGC,GACD,OAAO,iBAAe,cAAc,QAAQ,aAAa,IAAI;AAqL7D;;CAEC,GACD,OAAO,iBAAS,eAAe,QAAQ,UAAU,GAAG,IAAI"}