@wuyax/mcps 0.1.0-beta.1 → 0.1.0-beta.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/dist/cli.js CHANGED
@@ -2,16 +2,20 @@ import {
2
2
  getMcpAgentTypes,
3
3
  installMcpServer,
4
4
  listInstalledMcpServers,
5
+ logCoHostedNotice,
5
6
  logger,
6
7
  mainMenu,
8
+ mcpManageCommand,
9
+ parseKeyValueList,
7
10
  parseMcpAgentList,
8
11
  parseMcpSource,
9
12
  removeMcpServer,
10
13
  resolveTargetAgents,
14
+ resolveTransport,
11
15
  toErrorMessage,
12
16
  wizardAdd,
13
17
  wizardRemove
14
- } from "./chunk-XW2KL6W3.js";
18
+ } from "./chunk-BUKA3NPJ.js";
15
19
 
16
20
  // src/cli.ts
17
21
  import { Command as Command4 } from "commander";
@@ -24,26 +28,6 @@ import pc from "picocolors";
24
28
  var formatAgentList = (agentList, emptyLabel = "(none)") => agentList.length === 0 ? emptyLabel : agentList.join(", ");
25
29
 
26
30
  // src/cli/add.ts
27
- var parseKeyValueList = (entries, separator) => {
28
- if (!entries || entries.length === 0) return {};
29
- const result = {};
30
- for (const entry of entries) {
31
- const splitIndex = entry.indexOf(separator);
32
- if (splitIndex === -1) {
33
- throw new Error(`Invalid entry "${entry}": expected "${separator}" separator`);
34
- }
35
- const key = entry.slice(0, splitIndex).trim();
36
- const value = entry.slice(splitIndex + separator.length).trim();
37
- if (!key) throw new Error(`Invalid entry "${entry}": empty key`);
38
- result[key] = value;
39
- }
40
- return result;
41
- };
42
- var resolveTransport = (input) => {
43
- if (!input) return void 0;
44
- if (input === "http" || input === "sse") return input;
45
- throw new Error(`Unsupported transport "${input}" (expected: http, sse)`);
46
- };
47
31
  var mcpAddCommand = new Command("add").description("Add an MCP server to coding agents").argument("[source]", "Remote URL, npm package, or command line").option("-a, --agent <agents...>", "Target specific agents (use '*' for all)").option("-g, --global", "Install to user-level config instead of project").option("-t, --transport <type>", "Transport type for remote servers (http or sse)").option("--header <header...>", "HTTP header (Key: Value), repeatable").option("--env <env...>", "Env var for stdio servers (KEY=VALUE), repeatable").option("--args <args...>", "CLI arguments for stdio/package servers").option("-n, --name <name>", "Server name override").option("-y, --yes", "Skip all prompts").option("--all", "Install to all supported agents").action(async (source, options) => {
48
32
  try {
49
33
  const isInteractive = Boolean(process.stdin.isTTY && !options.yes);
@@ -112,6 +96,7 @@ var mcpAddCommand = new Command("add").description("Add an MCP server to coding
112
96
  for (const record of result.results) {
113
97
  if (record.success) {
114
98
  logger.success(`${pc.cyan(record.agent)} ${pc.dim(record.path)}`);
99
+ logCoHostedNotice("configured", record.coConfiguredAgents);
115
100
  } else {
116
101
  logger.error(`${pc.cyan(record.agent)}: ${record.error}`);
117
102
  }
@@ -193,6 +178,7 @@ var mcpRemoveCommand = new Command3("remove").alias("rm").description("Remove an
193
178
  logger.success(
194
179
  `${pc3.cyan(record.agent)} removed ${pc3.bold(name)} ${pc3.dim(record.path)}`
195
180
  );
181
+ logCoHostedNotice("affected", record.coAffectedAgents);
196
182
  } else {
197
183
  logger.error(`${pc3.cyan(record.agent)}: ${record.error ?? "not found"}`);
198
184
  }
@@ -204,12 +190,13 @@ var mcpRemoveCommand = new Command3("remove").alias("rm").description("Remove an
204
190
  });
205
191
 
206
192
  // src/cli.ts
207
- var VERSION = "0.1.0-beta.1";
193
+ var VERSION = "0.1.0-beta.3";
208
194
  process.on("SIGINT", () => process.exit(0));
209
195
  process.on("SIGTERM", () => process.exit(0));
210
196
  var program = new Command4().name("mcps").description("Install, list, and remove MCP servers across AI coding agents").version(VERSION, "-v, --version", "display the version number");
211
197
  program.addCommand(mcpAddCommand);
212
198
  program.addCommand(mcpListCommand);
199
+ program.addCommand(mcpManageCommand);
213
200
  program.addCommand(mcpRemoveCommand);
214
201
  var main = async () => {
215
202
  if (process.argv.length <= 2 && process.stdin.isTTY) {