mcpick 0.0.23 → 0.0.24

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.
Files changed (29) hide show
  1. package/CHANGELOG.md +9 -0
  2. package/dist/{add-LJQa2my2.js → add-Qzd8i-5k.js} +24 -4
  3. package/dist/{add-json-TEdYweZ5.js → add-json-DGmsjB0O.js} +24 -4
  4. package/dist/{backup-kyS5IVIr.js → backup-C7fvikFw.js} +3 -3
  5. package/dist/{cache-DTfzTsEE.js → cache-D3jjh5dD.js} +2 -2
  6. package/dist/{cli-By-0nYNQ.js → cli-CZOlaqoZ.js} +22 -22
  7. package/dist/{clients-qMozizys.js → clients-Bh93TGP4.js} +2 -2
  8. package/dist/{clone-BVhYjRGO.js → clone-MI8jJhTz.js} +3 -3
  9. package/dist/{config-DzMmTJYL.js → config-DE58Fik_.js} +2 -2
  10. package/dist/{dev-Cst8WkQ-.js → dev-51esdZG9.js} +3 -3
  11. package/dist/{disable-BaOs9lrm.js → disable-csYAn2Vk.js} +27 -4
  12. package/dist/dry-run-XQ32fxPT.js +20 -0
  13. package/dist/{enable--3mjSmTq.js → enable-B5GbmhL-.js} +27 -4
  14. package/dist/{get-CjhNWyRj.js → get-DacRZmwv.js} +2 -2
  15. package/dist/{hooks-DFmxgD0t.js → hooks-C_x49qap.js} +2 -2
  16. package/dist/index.js +197 -61
  17. package/dist/{list-D5CkCXpP.js → list-BeBtsiae.js} +3 -3
  18. package/dist/{marketplace-C3EGyIG0.js → marketplace-BDC2YtvT.js} +3 -3
  19. package/dist/{plugin-cache-BSgB42wa.js → plugin-cache-DmLbh89d.js} +2 -2
  20. package/dist/{plugins-Dn2mPFKm.js → plugins-Bkw-SKkZ.js} +3 -3
  21. package/dist/profile-DwJTVXiz.js +161 -0
  22. package/dist/{reload-257iU7Z7.js → reload-Bl1mYK1I.js} +1 -1
  23. package/dist/{remove-26XFzkPd.js → remove-BSHgva79.js} +24 -4
  24. package/dist/{reset-project-choices-D2F04LfC.js → reset-project-choices-BNLus9J9.js} +2 -2
  25. package/dist/{restore-BYYsoNqF.js → restore-YisgARhc.js} +3 -3
  26. package/dist/{rollback-CPdaME91.js → rollback-GR1RkpXW.js} +2 -2
  27. package/dist/{skills-DfWk9mpk.js → skills-rDTDqqZA.js} +2 -2
  28. package/package.json +1 -1
  29. package/dist/profile-Dq3ORPil.js +0 -119
package/CHANGELOG.md CHANGED
@@ -1,5 +1,14 @@
1
1
  # mcpick
2
2
 
3
+ ## 0.0.24
4
+
5
+ ### Patch Changes
6
+
7
+ - 1d8cdd4: Add dry-run previews for config mutations with redacted
8
+ structured diffs.
9
+ - 7059ba7: Refactor TUI profile and adapter flows to share CLI
10
+ mutation services, clarifying Claude-specific behavior.
11
+
3
12
  ## 0.0.23
4
13
 
5
14
  ### Patch Changes
@@ -1,6 +1,7 @@
1
1
  import { n as validate_mcp_server } from "./validation-xMlbgGCF.js";
2
- import { A as add_client_server, F as resolve_client_location, M as get_client_adapter, d as add_mcp_via_cli, w as add_server_to_registry } from "./index.js";
2
+ import { G as build_command_preview, I as get_client_adapter, O as add_server_to_registry, P as add_client_server, R as preview_add_client_server, U as resolve_client_location, f as add_mcp_via_cli, p as build_add_args } from "./index.js";
3
3
  import { n as output, t as error } from "./output-HtT5HCof.js";
4
+ import { t as print_dry_run } from "./dry-run-XQ32fxPT.js";
4
5
  import { defineCommand } from "citty";
5
6
  //#region src/cli/commands/add.ts
6
7
  var add_default = defineCommand({
@@ -56,6 +57,11 @@ var add_default = defineCommand({
56
57
  type: "string",
57
58
  description: "Exact config path when a client has multiple matching locations"
58
59
  },
60
+ dryRun: {
61
+ type: "boolean",
62
+ description: "Preview changes without writing",
63
+ default: false
64
+ },
59
65
  json: {
60
66
  type: "boolean",
61
67
  description: "Output as JSON",
@@ -72,7 +78,7 @@ var add_default = defineCommand({
72
78
  const add_args = args;
73
79
  const portable = build_portable_server(add_args, transport);
74
80
  if (add_args.client && add_args.client !== "claude-code") {
75
- await add_to_client(add_args.client, portable, add_args.scope, add_args.location, add_args.json);
81
+ await add_to_client(add_args.client, portable, add_args.scope, add_args.location, add_args.json, add_args.dryRun ?? false);
76
82
  return;
77
83
  }
78
84
  const scope = add_args.scope || "local";
@@ -97,6 +103,16 @@ var add_default = defineCommand({
97
103
  } catch (err) {
98
104
  error(`Invalid server config: ${err instanceof Error ? err.message : "validation failed"}`);
99
105
  }
106
+ if (add_args.dryRun) {
107
+ print_dry_run(build_command_preview({
108
+ operation: "add-server",
109
+ client: "claude-code",
110
+ scope,
111
+ location: "Claude Code CLI + mcpick registry",
112
+ command: ["claude", ...build_add_args(server, scope)]
113
+ }), add_args.json);
114
+ return;
115
+ }
100
116
  await add_server_to_registry(server);
101
117
  const result = await add_mcp_via_cli(server, scope);
102
118
  if (add_args.json) output({
@@ -128,7 +144,7 @@ function build_portable_server(args, transport) {
128
144
  if (args.description) server.description = args.description;
129
145
  return server;
130
146
  }
131
- async function add_to_client(client, server, scope, location_path, json) {
147
+ async function add_to_client(client, server, scope, location_path, json, dry_run) {
132
148
  const adapter = get_client_adapter(client);
133
149
  if (!adapter) error(`Invalid client: ${client}. Use claude-code, gemini-cli, vscode, cursor, windsurf, opencode, or pi.`);
134
150
  if (scope && ![
@@ -138,6 +154,10 @@ async function add_to_client(client, server, scope, location_path, json) {
138
154
  ].includes(scope)) error(`Invalid scope: ${scope}. Use local, project, or user.`);
139
155
  try {
140
156
  const location = resolve_client_location(adapter, scope, location_path);
157
+ if (dry_run) {
158
+ print_dry_run(await preview_add_client_server(adapter, location, server), json);
159
+ return;
160
+ }
141
161
  await add_client_server(adapter, location, server);
142
162
  if (json) output({
143
163
  added: server.name,
@@ -161,4 +181,4 @@ function parse_key_value_pairs(input) {
161
181
  //#endregion
162
182
  export { add_default as default };
163
183
 
164
- //# sourceMappingURL=add-LJQa2my2.js.map
184
+ //# sourceMappingURL=add-Qzd8i-5k.js.map
@@ -1,5 +1,6 @@
1
- import { F as resolve_client_location, M as get_client_adapter, _ as mcp_add_json_via_cli, j as add_client_server_config } from "./index.js";
1
+ import { F as add_client_server_config, G as build_command_preview, I as get_client_adapter, U as resolve_client_location, m as build_add_json_args, x as mcp_add_json_via_cli, z as preview_add_client_server_config } from "./index.js";
2
2
  import { n as output, t as error } from "./output-HtT5HCof.js";
3
+ import { t as print_dry_run } from "./dry-run-XQ32fxPT.js";
3
4
  import { defineCommand } from "citty";
4
5
  //#region src/cli/commands/add-json.ts
5
6
  var add_json_default = defineCommand({
@@ -31,6 +32,11 @@ var add_json_default = defineCommand({
31
32
  type: "string",
32
33
  description: "Exact config path when a client has multiple matching locations"
33
34
  },
35
+ dryRun: {
36
+ type: "boolean",
37
+ description: "Preview changes without writing",
38
+ default: false
39
+ },
34
40
  json: {
35
41
  type: "boolean",
36
42
  description: "Output as JSON",
@@ -46,7 +52,7 @@ var add_json_default = defineCommand({
46
52
  }
47
53
  if (!parsed || typeof parsed !== "object" || Array.isArray(parsed)) error("JSON configuration must be an object.");
48
54
  if (args.client && args.client !== "claude-code") {
49
- await add_json_to_client(args.client, args.name, parsed, args.scope, args.location, args.json);
55
+ await add_json_to_client(args.client, args.name, parsed, args.scope, args.location, args.json, args.dryRun);
50
56
  return;
51
57
  }
52
58
  const scope = args.scope || "local";
@@ -55,6 +61,16 @@ var add_json_default = defineCommand({
55
61
  "project",
56
62
  "user"
57
63
  ].includes(scope)) error(`Invalid scope: ${scope}. Use local, project, or user.`);
64
+ if (args.dryRun) {
65
+ print_dry_run(build_command_preview({
66
+ operation: "add-json",
67
+ client: "claude-code",
68
+ scope,
69
+ location: "Claude Code CLI",
70
+ command: ["claude", ...build_add_json_args(args.name, args.config, scope)]
71
+ }), args.json);
72
+ return;
73
+ }
58
74
  const result = await mcp_add_json_via_cli(args.name, args.config, scope);
59
75
  if (args.json) output({
60
76
  added: args.name,
@@ -67,7 +83,7 @@ var add_json_default = defineCommand({
67
83
  else error(result.error || "Unknown error");
68
84
  }
69
85
  });
70
- async function add_json_to_client(client, name, config, scope, location_path, json) {
86
+ async function add_json_to_client(client, name, config, scope, location_path, json, dry_run) {
71
87
  const adapter = get_client_adapter(client);
72
88
  if (!adapter) error(`Invalid client: ${client}. Use claude-code, gemini-cli, vscode, cursor, windsurf, opencode, or pi.`);
73
89
  if (scope && ![
@@ -77,6 +93,10 @@ async function add_json_to_client(client, name, config, scope, location_path, js
77
93
  ].includes(scope)) error(`Invalid scope: ${scope}. Use local, project, or user.`);
78
94
  try {
79
95
  const location = resolve_client_location(adapter, scope, location_path);
96
+ if (dry_run) {
97
+ print_dry_run(await preview_add_client_server_config(adapter, location, name, config), json);
98
+ return;
99
+ }
80
100
  await add_client_server_config(adapter, location, name, config);
81
101
  if (json) output({
82
102
  added: name,
@@ -92,4 +112,4 @@ async function add_json_to_client(client, name, config, scope, location_path, js
92
112
  //#endregion
93
113
  export { add_json_default as default };
94
114
 
95
- //# sourceMappingURL=add-json-TEdYweZ5.js.map
115
+ //# sourceMappingURL=add-json-DGmsjB0O.js.map
@@ -1,6 +1,6 @@
1
1
  import { m as get_plugin_backup_filename, n as get_backup_filename, r as get_backups_dir, t as ensure_directory_exists } from "./paths-BPISiJi4.js";
2
- import { s as read_claude_config } from "./config-DzMmTJYL.js";
3
- import { V as read_claude_settings } from "./index.js";
2
+ import { s as read_claude_config } from "./config-DE58Fik_.js";
3
+ import { Z as read_claude_settings } from "./index.js";
4
4
  import { n as output } from "./output-HtT5HCof.js";
5
5
  import { readdir, unlink, writeFile } from "node:fs/promises";
6
6
  import { join } from "node:path";
@@ -61,4 +61,4 @@ var backup_default = defineCommand({
61
61
  //#endregion
62
62
  export { backup_default as default };
63
63
 
64
- //# sourceMappingURL=backup-kyS5IVIr.js.map
64
+ //# sourceMappingURL=backup-C7fvikFw.js.map
@@ -1,4 +1,4 @@
1
- import { a as list_linked_plugins, c as read_installed_plugins, d as refresh_all_marketplaces, f as scan_all_cache_keys, i as link_local_plugin, n as clear_plugin_caches, p as unlink_local_plugin, r as get_cached_plugins_info, t as clean_orphaned_versions } from "./plugin-cache-BSgB42wa.js";
1
+ import { a as list_linked_plugins, c as read_installed_plugins, d as refresh_all_marketplaces, f as scan_all_cache_keys, i as link_local_plugin, n as clear_plugin_caches, p as unlink_local_plugin, r as get_cached_plugins_info, t as clean_orphaned_versions } from "./plugin-cache-DmLbh89d.js";
2
2
  import { n as output, t as error } from "./output-HtT5HCof.js";
3
3
  import { defineCommand } from "citty";
4
4
  var cache_default = defineCommand({
@@ -223,4 +223,4 @@ var cache_default = defineCommand({
223
223
  //#endregion
224
224
  export { cache_default as default };
225
225
 
226
- //# sourceMappingURL=cache-DTfzTsEE.js.map
226
+ //# sourceMappingURL=cache-D3jjh5dD.js.map
@@ -6,27 +6,27 @@ const main = defineCommand({
6
6
  description: "Vendor-neutral MCP configuration manager with first-class Claude Code support"
7
7
  },
8
8
  subCommands: {
9
- list: () => import("./list-D5CkCXpP.js").then((m) => m.default),
10
- enable: () => import("./enable--3mjSmTq.js").then((m) => m.default),
11
- disable: () => import("./disable-BaOs9lrm.js").then((m) => m.default),
12
- clients: () => import("./clients-qMozizys.js").then((m) => m.default),
13
- remove: () => import("./remove-26XFzkPd.js").then((m) => m.default),
14
- add: () => import("./add-LJQa2my2.js").then((m) => m.default),
15
- "add-json": () => import("./add-json-TEdYweZ5.js").then((m) => m.default),
16
- clone: () => import("./clone-BVhYjRGO.js").then((m) => m.default),
17
- get: () => import("./get-CjhNWyRj.js").then((m) => m.default),
18
- "reset-project-choices": () => import("./reset-project-choices-D2F04LfC.js").then((m) => m.default),
19
- backup: () => import("./backup-kyS5IVIr.js").then((m) => m.default),
20
- restore: () => import("./restore-BYYsoNqF.js").then((m) => m.default),
21
- profile: () => import("./profile-Dq3ORPil.js").then((m) => m.default),
22
- skills: () => import("./skills-DfWk9mpk.js").then((m) => m.default),
23
- plugins: () => import("./plugins-Dn2mPFKm.js").then((m) => m.default),
24
- hooks: () => import("./hooks-DFmxgD0t.js").then((m) => m.default),
25
- cache: () => import("./cache-DTfzTsEE.js").then((m) => m.default),
26
- dev: () => import("./dev-Cst8WkQ-.js").then((m) => m.default),
27
- marketplace: () => import("./marketplace-C3EGyIG0.js").then((m) => m.default),
28
- reload: () => import("./reload-257iU7Z7.js").then((m) => m.default),
29
- rollback: () => import("./rollback-CPdaME91.js").then((m) => m.default)
9
+ list: () => import("./list-BeBtsiae.js").then((m) => m.default),
10
+ enable: () => import("./enable-B5GbmhL-.js").then((m) => m.default),
11
+ disable: () => import("./disable-csYAn2Vk.js").then((m) => m.default),
12
+ clients: () => import("./clients-Bh93TGP4.js").then((m) => m.default),
13
+ remove: () => import("./remove-BSHgva79.js").then((m) => m.default),
14
+ add: () => import("./add-Qzd8i-5k.js").then((m) => m.default),
15
+ "add-json": () => import("./add-json-DGmsjB0O.js").then((m) => m.default),
16
+ clone: () => import("./clone-MI8jJhTz.js").then((m) => m.default),
17
+ get: () => import("./get-DacRZmwv.js").then((m) => m.default),
18
+ "reset-project-choices": () => import("./reset-project-choices-BNLus9J9.js").then((m) => m.default),
19
+ backup: () => import("./backup-C7fvikFw.js").then((m) => m.default),
20
+ restore: () => import("./restore-YisgARhc.js").then((m) => m.default),
21
+ profile: () => import("./profile-DwJTVXiz.js").then((m) => m.default),
22
+ skills: () => import("./skills-rDTDqqZA.js").then((m) => m.default),
23
+ plugins: () => import("./plugins-Bkw-SKkZ.js").then((m) => m.default),
24
+ hooks: () => import("./hooks-C_x49qap.js").then((m) => m.default),
25
+ cache: () => import("./cache-D3jjh5dD.js").then((m) => m.default),
26
+ dev: () => import("./dev-51esdZG9.js").then((m) => m.default),
27
+ marketplace: () => import("./marketplace-BDC2YtvT.js").then((m) => m.default),
28
+ reload: () => import("./reload-Bl1mYK1I.js").then((m) => m.default),
29
+ rollback: () => import("./rollback-GR1RkpXW.js").then((m) => m.default)
30
30
  }
31
31
  });
32
32
  /**
@@ -109,4 +109,4 @@ const run = () => runMain(main, { showUsage: show_usage_with_examples });
109
109
  //#endregion
110
110
  export { run };
111
111
 
112
- //# sourceMappingURL=cli-By-0nYNQ.js.map
112
+ //# sourceMappingURL=cli-CZOlaqoZ.js.map
@@ -1,4 +1,4 @@
1
- import { N as list_client_locations } from "./index.js";
1
+ import { L as list_client_locations } from "./index.js";
2
2
  import { n as output } from "./output-HtT5HCof.js";
3
3
  import { defineCommand } from "citty";
4
4
  //#region src/cli/commands/clients.ts
@@ -27,4 +27,4 @@ var clients_default = defineCommand({
27
27
  //#endregion
28
28
  export { clients_default as default };
29
29
 
30
- //# sourceMappingURL=clients-qMozizys.js.map
30
+ //# sourceMappingURL=clients-Bh93TGP4.js.map
@@ -1,7 +1,7 @@
1
1
  import { n as validate_mcp_server } from "./validation-xMlbgGCF.js";
2
- import { i as find_server_in_scope, r as detect_server_scope } from "./config-DzMmTJYL.js";
2
+ import { i as find_server_in_scope, r as detect_server_scope } from "./config-DE58Fik_.js";
3
3
  import { n as redact_server } from "./redact-wBMtzbno.js";
4
- import { d as add_mcp_via_cli, w as add_server_to_registry } from "./index.js";
4
+ import { O as add_server_to_registry, f as add_mcp_via_cli } from "./index.js";
5
5
  import { n as output, t as error } from "./output-HtT5HCof.js";
6
6
  import { defineCommand } from "citty";
7
7
  //#region src/cli/commands/clone.ts
@@ -84,4 +84,4 @@ var clone_default = defineCommand({
84
84
  //#endregion
85
85
  export { clone_default as default };
86
86
 
87
- //# sourceMappingURL=clone-BVhYjRGO.js.map
87
+ //# sourceMappingURL=clone-MI8jJhTz.js.map
@@ -1,7 +1,7 @@
1
1
  import { t as __exportAll } from "./rolldown-runtime-CiIaOW0V.js";
2
2
  import { i as get_claude_config_path, o as get_current_project_path, v as get_project_mcp_json_path } from "./paths-BPISiJi4.js";
3
3
  import { t as validate_claude_config } from "./validation-xMlbgGCF.js";
4
- import { W as atomic_json_write } from "./index.js";
4
+ import { et as atomic_json_write } from "./index.js";
5
5
  import { access, readFile } from "node:fs/promises";
6
6
  //#region src/core/config.ts
7
7
  var config_exports = /* @__PURE__ */ __exportAll({
@@ -173,4 +173,4 @@ async function get_enabled_servers_for_scope(scope) {
173
173
  //#endregion
174
174
  export { get_enabled_servers as a, write_claude_config as c, find_server_in_scope as i, create_config_from_servers as n, get_enabled_servers_for_scope as o, detect_server_scope as r, read_claude_config as s, config_exports as t };
175
175
 
176
- //# sourceMappingURL=config-DzMmTJYL.js.map
176
+ //# sourceMappingURL=config-DE58Fik_.js.map
@@ -1,7 +1,7 @@
1
1
  import { i as get_claude_config_path, o as get_current_project_path, s as get_dev_overrides_path, v as get_project_mcp_json_path } from "./paths-BPISiJi4.js";
2
- import { i as find_server_in_scope, r as detect_server_scope } from "./config-DzMmTJYL.js";
2
+ import { i as find_server_in_scope, r as detect_server_scope } from "./config-DE58Fik_.js";
3
3
  import { r as redact_server_base } from "./redact-wBMtzbno.js";
4
- import { W as atomic_json_write } from "./index.js";
4
+ import { et as atomic_json_write } from "./index.js";
5
5
  import { n as output, t as error } from "./output-HtT5HCof.js";
6
6
  import { readFile } from "node:fs/promises";
7
7
  import { defineCommand } from "citty";
@@ -262,4 +262,4 @@ var dev_default = defineCommand({
262
262
  //#endregion
263
263
  export { dev_default as default };
264
264
 
265
- //# sourceMappingURL=dev-Cst8WkQ-.js.map
265
+ //# sourceMappingURL=dev-51esdZG9.js.map
@@ -1,5 +1,6 @@
1
- import { F as resolve_client_location, I as set_client_server_enabled, M as get_client_adapter, T as get_all_available_servers, b as remove_mcp_via_cli } from "./index.js";
1
+ import { G as build_command_preview, I as get_client_adapter, U as resolve_client_location, V as preview_set_client_enabled_servers, W as set_client_server_enabled, h as build_remove_args, k as get_all_available_servers, w as remove_mcp_via_cli } from "./index.js";
2
2
  import { n as output, t as error } from "./output-HtT5HCof.js";
3
+ import { t as print_dry_run } from "./dry-run-XQ32fxPT.js";
3
4
  import { defineCommand } from "citty";
4
5
  //#region src/cli/commands/disable.ts
5
6
  var disable_default = defineCommand({
@@ -26,6 +27,11 @@ var disable_default = defineCommand({
26
27
  type: "string",
27
28
  description: "Exact config path when a client has multiple matching locations"
28
29
  },
30
+ dryRun: {
31
+ type: "boolean",
32
+ description: "Preview changes without writing",
33
+ default: false
34
+ },
29
35
  json: {
30
36
  type: "boolean",
31
37
  description: "Output as JSON",
@@ -34,7 +40,7 @@ var disable_default = defineCommand({
34
40
  },
35
41
  async run({ args }) {
36
42
  if (args.client && args.client !== "claude-code") {
37
- await disable_client_server(args.client, args.server, args.scope, args.location, args.json);
43
+ await disable_client_server(args.client, args.server, args.scope, args.location, args.json, args.dryRun);
38
44
  return;
39
45
  }
40
46
  const scope = args.scope || "local";
@@ -44,6 +50,16 @@ var disable_default = defineCommand({
44
50
  "user"
45
51
  ].includes(scope)) error(`Invalid scope: ${scope}. Use local, project, or user.`);
46
52
  await get_all_available_servers();
53
+ if (args.dryRun) {
54
+ print_dry_run(build_command_preview({
55
+ operation: "disable-server",
56
+ client: "claude-code",
57
+ scope,
58
+ location: "Claude Code CLI",
59
+ command: ["claude", ...build_remove_args(args.server, scope)]
60
+ }), args.json);
61
+ return;
62
+ }
47
63
  const result = await remove_mcp_via_cli(args.server, scope);
48
64
  if (!result.success) error(result.error || "Failed to disable server");
49
65
  if (args.json) output({
@@ -54,7 +70,7 @@ var disable_default = defineCommand({
54
70
  else console.log(`Disabled '${args.server}' (scope: ${scope})`);
55
71
  }
56
72
  });
57
- async function disable_client_server(client, server, scope, location_path, json) {
73
+ async function disable_client_server(client, server, scope, location_path, json, dry_run) {
58
74
  const adapter = get_client_adapter(client);
59
75
  if (!adapter) error(`Invalid client: ${client}. Use claude-code, gemini-cli, vscode, cursor, windsurf, opencode, or pi.`);
60
76
  if (scope && ![
@@ -64,6 +80,13 @@ async function disable_client_server(client, server, scope, location_path, json)
64
80
  ].includes(scope)) error(`Invalid scope: ${scope}. Use local, project, or user.`);
65
81
  try {
66
82
  const location = resolve_client_location(adapter, scope, location_path);
83
+ const servers = await adapter.readLocation(location);
84
+ const enabled_names = new Set(servers.filter((candidate) => candidate.disabled !== true).map((candidate) => candidate.name));
85
+ enabled_names.delete(server);
86
+ if (dry_run) {
87
+ print_dry_run(await preview_set_client_enabled_servers(adapter, location, [...enabled_names]), json);
88
+ return;
89
+ }
67
90
  const enabled_count = await set_client_server_enabled(adapter, location, server, false);
68
91
  if (json) output({
69
92
  disabled: server,
@@ -80,4 +103,4 @@ async function disable_client_server(client, server, scope, location_path, json)
80
103
  //#endregion
81
104
  export { disable_default as default };
82
105
 
83
- //# sourceMappingURL=disable-BaOs9lrm.js.map
106
+ //# sourceMappingURL=disable-csYAn2Vk.js.map
@@ -0,0 +1,20 @@
1
+ import { n as output } from "./output-HtT5HCof.js";
2
+ //#region src/cli/dry-run.ts
3
+ function print_dry_run(preview, json) {
4
+ if (json) {
5
+ output(preview, true);
6
+ return;
7
+ }
8
+ console.log(`Dry run: ${preview.operation} (${preview.client}:${preview.scope})`);
9
+ console.log(`Target: ${preview.location}`);
10
+ if ("command" in preview) {
11
+ console.log(`Command: ${preview.command.join(" ")}`);
12
+ return;
13
+ }
14
+ if (preview.diff) console.log(preview.diff);
15
+ else console.log("No changes.");
16
+ }
17
+ //#endregion
18
+ export { print_dry_run as t };
19
+
20
+ //# sourceMappingURL=dry-run-XQ32fxPT.js.map
@@ -1,5 +1,6 @@
1
- import { F as resolve_client_location, I as set_client_server_enabled, M as get_client_adapter, T as get_all_available_servers, d as add_mcp_via_cli } from "./index.js";
1
+ import { G as build_command_preview, I as get_client_adapter, U as resolve_client_location, V as preview_set_client_enabled_servers, W as set_client_server_enabled, f as add_mcp_via_cli, k as get_all_available_servers, p as build_add_args } from "./index.js";
2
2
  import { n as output, t as error } from "./output-HtT5HCof.js";
3
+ import { t as print_dry_run } from "./dry-run-XQ32fxPT.js";
3
4
  import { defineCommand } from "citty";
4
5
  //#region src/cli/commands/enable.ts
5
6
  var enable_default = defineCommand({
@@ -26,6 +27,11 @@ var enable_default = defineCommand({
26
27
  type: "string",
27
28
  description: "Exact config path when a client has multiple matching locations"
28
29
  },
30
+ dryRun: {
31
+ type: "boolean",
32
+ description: "Preview changes without writing",
33
+ default: false
34
+ },
29
35
  json: {
30
36
  type: "boolean",
31
37
  description: "Output as JSON",
@@ -34,7 +40,7 @@ var enable_default = defineCommand({
34
40
  },
35
41
  async run({ args }) {
36
42
  if (args.client && args.client !== "claude-code") {
37
- await enable_client_server(args.client, args.server, args.scope, args.location, args.json);
43
+ await enable_client_server(args.client, args.server, args.scope, args.location, args.json, args.dryRun);
38
44
  return;
39
45
  }
40
46
  const scope = args.scope || "local";
@@ -45,6 +51,16 @@ var enable_default = defineCommand({
45
51
  ].includes(scope)) error(`Invalid scope: ${scope}. Use local, project, or user.`);
46
52
  const server = (await get_all_available_servers()).find((s) => s.name === args.server);
47
53
  if (!server) error(`Server '${args.server}' not found in registry. Run 'mcpick list' to see available servers.`);
54
+ if (args.dryRun) {
55
+ print_dry_run(build_command_preview({
56
+ operation: "enable-server",
57
+ client: "claude-code",
58
+ scope,
59
+ location: "Claude Code CLI",
60
+ command: ["claude", ...build_add_args(server, scope)]
61
+ }), args.json);
62
+ return;
63
+ }
48
64
  const result = await add_mcp_via_cli(server, scope);
49
65
  if (!result.success) error(result.error || "Failed to enable server");
50
66
  if (args.json) output({
@@ -55,7 +71,7 @@ var enable_default = defineCommand({
55
71
  else console.log(`Enabled '${server.name}' (scope: ${scope})`);
56
72
  }
57
73
  });
58
- async function enable_client_server(client, server, scope, location_path, json) {
74
+ async function enable_client_server(client, server, scope, location_path, json, dry_run) {
59
75
  const adapter = get_client_adapter(client);
60
76
  if (!adapter) error(`Invalid client: ${client}. Use claude-code, gemini-cli, vscode, cursor, windsurf, opencode, or pi.`);
61
77
  if (scope && ![
@@ -65,6 +81,13 @@ async function enable_client_server(client, server, scope, location_path, json)
65
81
  ].includes(scope)) error(`Invalid scope: ${scope}. Use local, project, or user.`);
66
82
  try {
67
83
  const location = resolve_client_location(adapter, scope, location_path);
84
+ const servers = await adapter.readLocation(location);
85
+ const enabled_names = new Set(servers.filter((candidate) => candidate.disabled !== true).map((candidate) => candidate.name));
86
+ enabled_names.add(server);
87
+ if (dry_run) {
88
+ print_dry_run(await preview_set_client_enabled_servers(adapter, location, [...enabled_names]), json);
89
+ return;
90
+ }
68
91
  const enabled_count = await set_client_server_enabled(adapter, location, server, true);
69
92
  if (json) output({
70
93
  enabled: server,
@@ -81,4 +104,4 @@ async function enable_client_server(client, server, scope, location_path, json)
81
104
  //#endregion
82
105
  export { enable_default as default };
83
106
 
84
- //# sourceMappingURL=enable--3mjSmTq.js.map
107
+ //# sourceMappingURL=enable-B5GbmhL-.js.map
@@ -1,4 +1,4 @@
1
- import { v as mcp_get_via_cli } from "./index.js";
1
+ import { S as mcp_get_via_cli } from "./index.js";
2
2
  import { n as output, t as error } from "./output-HtT5HCof.js";
3
3
  import { defineCommand } from "citty";
4
4
  //#region src/cli/commands/get.ts
@@ -38,4 +38,4 @@ var get_default = defineCommand({
38
38
  //#endregion
39
39
  export { get_default as default };
40
40
 
41
- //# sourceMappingURL=get-CjhNWyRj.js.map
41
+ //# sourceMappingURL=get-DacRZmwv.js.map
@@ -1,4 +1,4 @@
1
- import { H as remove_hook, L as add_hook, c as enable_plugin_hook, l as read_disabled_hooks, o as check_restored_hooks, s as disable_plugin_hook, u as redisable_restored_hooks, z as get_all_hooks } from "./index.js";
1
+ import { Q as remove_hook, Y as get_all_hooks, c as disable_plugin_hook, d as redisable_restored_hooks, l as enable_plugin_hook, q as add_hook, s as check_restored_hooks, u as read_disabled_hooks } from "./index.js";
2
2
  import { n as output, t as error } from "./output-HtT5HCof.js";
3
3
  import { defineCommand } from "citty";
4
4
  var hooks_default = defineCommand({
@@ -276,4 +276,4 @@ var hooks_default = defineCommand({
276
276
  //#endregion
277
277
  export { hooks_default as default };
278
278
 
279
- //# sourceMappingURL=hooks-DFmxgD0t.js.map
279
+ //# sourceMappingURL=hooks-C_x49qap.js.map