mcpick 0.0.22 → 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 (45) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/README.md +4 -0
  3. package/dist/add-Qzd8i-5k.js +184 -0
  4. package/dist/add-json-DGmsjB0O.js +115 -0
  5. package/dist/{backup-bdg6dvsb.js → backup-C7fvikFw.js} +5 -5
  6. package/dist/{cache-CSUcGdZP.js → cache-D3jjh5dD.js} +3 -3
  7. package/dist/{cli-avr5R1LO.js → cli-CZOlaqoZ.js} +22 -21
  8. package/dist/{clients-CSQgqHzb.js → clients-Bh93TGP4.js} +3 -3
  9. package/dist/{clone-CQ0skkT6.js → clone-MI8jJhTz.js} +6 -6
  10. package/dist/{config-BhX4eAgg.js → config-DE58Fik_.js} +4 -4
  11. package/dist/{dev-CTDg5g-c.js → dev-51esdZG9.js} +6 -6
  12. package/dist/disable-csYAn2Vk.js +106 -0
  13. package/dist/dry-run-XQ32fxPT.js +20 -0
  14. package/dist/enable-B5GbmhL-.js +107 -0
  15. package/dist/{get-l-eAJhBy.js → get-DacRZmwv.js} +3 -3
  16. package/dist/{hooks-BWZ_Kgx3.js → hooks-C_x49qap.js} +3 -4
  17. package/dist/index.js +717 -116
  18. package/dist/{list-By--kltj.js → list-BeBtsiae.js} +5 -5
  19. package/dist/{marketplace-DdiKDDKK.js → marketplace-BDC2YtvT.js} +4 -4
  20. package/dist/{output-BgN9Uuxf.js → output-HtT5HCof.js} +2 -2
  21. package/dist/{paths-6wrIM8yh.js → paths-BPISiJi4.js} +1 -1
  22. package/dist/{plugin-cache-DKcW8LGV.js → plugin-cache-DmLbh89d.js} +35 -16
  23. package/dist/{plugins-CsXE8AH4.js → plugins-Bkw-SKkZ.js} +4 -5
  24. package/dist/profile-DwJTVXiz.js +161 -0
  25. package/dist/{redact-Dltz2gde.js → redact-wBMtzbno.js} +1 -1
  26. package/dist/{reload-C29-vuvy.js → reload-Bl1mYK1I.js} +2 -2
  27. package/dist/remove-BSHgva79.js +107 -0
  28. package/dist/{reset-project-choices-Dhh4CxIC.js → reset-project-choices-BNLus9J9.js} +3 -3
  29. package/dist/{restore-BI8aiszM.js → restore-YisgARhc.js} +5 -6
  30. package/dist/rollback-GR1RkpXW.js +55 -0
  31. package/dist/{skills-DPBDmION.js → skills-rDTDqqZA.js} +3 -3
  32. package/dist/{validation-qWlF51fw.js → validation-xMlbgGCF.js} +1 -1
  33. package/package.json +4 -4
  34. package/.github/copilot-instructions.md +0 -50
  35. package/.github/workflows/ci.yml +0 -26
  36. package/.vscode/settings.json +0 -5
  37. package/CONTEXT.md +0 -49
  38. package/dist/add-Bok0qbXi.js +0 -112
  39. package/dist/add-json-C44vy2A_.js +0 -58
  40. package/dist/atomic-write-4lANmzsO.js +0 -26
  41. package/dist/disable-DLlOj7sc.js +0 -38
  42. package/dist/enable-CGFYYC2A.js +0 -39
  43. package/dist/profile-DzGPsdsl.js +0 -120
  44. package/dist/remove-B5q4rQRU.js +0 -30
  45. package/dist/settings-CZR8bVfh.js +0 -201
package/CHANGELOG.md CHANGED
@@ -1,5 +1,25 @@
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
+
12
+ ## 0.0.23
13
+
14
+ ### Patch Changes
15
+
16
+ - 291b1d4: Add config rollback command, scoped Claude removals, author
17
+ metadata, and rollback backup tests.
18
+ - 92a0d0e: Improve marketplace add validation, authentication checks,
19
+ and error messages for GitHub repository access failures.
20
+ - 1d191a5: Add safer config writes, non-Claude client mutation
21
+ commands, shell-free git execution, and adapter tests.
22
+
3
23
  ## 0.0.22
4
24
 
5
25
  ### Patch Changes
package/README.md CHANGED
@@ -151,6 +151,10 @@ npx mcpick --list-profiles
151
151
 
152
152
  npx mcpick backup
153
153
  npx mcpick restore [file]
154
+
155
+ # Safe-write rollback backups created before config mutations
156
+ npx mcpick rollback --list
157
+ npx mcpick rollback [file]
154
158
  ```
155
159
 
156
160
  ## Interactive TUI
@@ -0,0 +1,184 @@
1
+ import { n as validate_mcp_server } from "./validation-xMlbgGCF.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
+ import { n as output, t as error } from "./output-HtT5HCof.js";
4
+ import { t as print_dry_run } from "./dry-run-XQ32fxPT.js";
5
+ import { defineCommand } from "citty";
6
+ //#region src/cli/commands/add.ts
7
+ var add_default = defineCommand({
8
+ meta: {
9
+ name: "add",
10
+ description: "Add a new MCP server to the registry and enable it"
11
+ },
12
+ args: {
13
+ name: {
14
+ type: "string",
15
+ description: "Server name",
16
+ required: true
17
+ },
18
+ command: {
19
+ type: "string",
20
+ description: "Command to run (for stdio transport)"
21
+ },
22
+ args: {
23
+ type: "string",
24
+ description: "Comma-separated arguments (e.g. \"npx,-y,mcp-sqlite\")"
25
+ },
26
+ url: {
27
+ type: "string",
28
+ description: "URL (for sse or http transport)"
29
+ },
30
+ type: {
31
+ type: "string",
32
+ description: "Transport type: stdio, sse, or http (default: stdio)",
33
+ default: "stdio"
34
+ },
35
+ env: {
36
+ type: "string",
37
+ description: "Environment variables as KEY=val,KEY=val"
38
+ },
39
+ headers: {
40
+ type: "string",
41
+ description: "HTTP headers as KEY=val,KEY=val"
42
+ },
43
+ description: {
44
+ type: "string",
45
+ description: "Server description"
46
+ },
47
+ client: {
48
+ type: "string",
49
+ description: "Client to edit: claude-code, gemini-cli, vscode, cursor, windsurf, opencode, or pi",
50
+ default: "claude-code"
51
+ },
52
+ scope: {
53
+ type: "string",
54
+ description: "Scope: local, project, or user (default: local for Claude Code)"
55
+ },
56
+ location: {
57
+ type: "string",
58
+ description: "Exact config path when a client has multiple matching locations"
59
+ },
60
+ dryRun: {
61
+ type: "boolean",
62
+ description: "Preview changes without writing",
63
+ default: false
64
+ },
65
+ json: {
66
+ type: "boolean",
67
+ description: "Output as JSON",
68
+ default: false
69
+ }
70
+ },
71
+ async run({ args }) {
72
+ const transport = args.type;
73
+ if (![
74
+ "stdio",
75
+ "sse",
76
+ "http"
77
+ ].includes(transport)) error(`Invalid type: ${transport}. Use stdio, sse, or http.`);
78
+ const add_args = args;
79
+ const portable = build_portable_server(add_args, transport);
80
+ if (add_args.client && add_args.client !== "claude-code") {
81
+ await add_to_client(add_args.client, portable, add_args.scope, add_args.location, add_args.json, add_args.dryRun ?? false);
82
+ return;
83
+ }
84
+ const scope = add_args.scope || "local";
85
+ if (![
86
+ "local",
87
+ "project",
88
+ "user"
89
+ ].includes(scope)) error(`Invalid scope: ${scope}. Use local, project, or user.`);
90
+ const server_data = {
91
+ name: portable.name,
92
+ ...transport !== "stdio" ? { type: transport } : {},
93
+ ...portable.command ? { command: portable.command } : {},
94
+ ...portable.args ? { args: portable.args } : {},
95
+ ...portable.url ? { url: portable.url } : {},
96
+ ...portable.env ? { env: portable.env } : {},
97
+ ...portable.headers ? { headers: portable.headers } : {},
98
+ ...portable.description ? { description: portable.description } : {}
99
+ };
100
+ let server;
101
+ try {
102
+ server = validate_mcp_server(server_data);
103
+ } catch (err) {
104
+ error(`Invalid server config: ${err instanceof Error ? err.message : "validation failed"}`);
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
+ }
116
+ await add_server_to_registry(server);
117
+ const result = await add_mcp_via_cli(server, scope);
118
+ if (add_args.json) output({
119
+ added: server.name,
120
+ client: "claude-code",
121
+ scope,
122
+ cli: result.success,
123
+ error: result.error
124
+ }, true);
125
+ else if (result.success) console.log(`Added '${server.name}' and enabled (scope: ${scope})`);
126
+ else console.log(`Added '${server.name}' to registry but CLI failed: ${result.error}`);
127
+ }
128
+ });
129
+ function build_portable_server(args, transport) {
130
+ const server = {
131
+ name: args.name,
132
+ transport
133
+ };
134
+ if (transport === "stdio") {
135
+ if (!args.command) error("--command is required for stdio transport");
136
+ server.command = args.command;
137
+ if (args.args) server.args = args.args.split(",");
138
+ } else {
139
+ if (!args.url) error(`--url is required for ${transport} transport`);
140
+ server.url = args.url;
141
+ if (args.headers) server.headers = parse_key_value_pairs(args.headers);
142
+ }
143
+ if (args.env) server.env = parse_key_value_pairs(args.env);
144
+ if (args.description) server.description = args.description;
145
+ return server;
146
+ }
147
+ async function add_to_client(client, server, scope, location_path, json, dry_run) {
148
+ const adapter = get_client_adapter(client);
149
+ if (!adapter) error(`Invalid client: ${client}. Use claude-code, gemini-cli, vscode, cursor, windsurf, opencode, or pi.`);
150
+ if (scope && ![
151
+ "local",
152
+ "project",
153
+ "user"
154
+ ].includes(scope)) error(`Invalid scope: ${scope}. Use local, project, or user.`);
155
+ try {
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
+ }
161
+ await add_client_server(adapter, location, server);
162
+ if (json) output({
163
+ added: server.name,
164
+ client: adapter.id,
165
+ scope: location.scope,
166
+ location: location.path
167
+ }, true);
168
+ else console.log(`Added '${server.name}' (${adapter.id}:${location.scope})`);
169
+ } catch (err) {
170
+ error(err instanceof Error ? err.message : "Failed to add server");
171
+ }
172
+ }
173
+ function parse_key_value_pairs(input) {
174
+ const result = {};
175
+ for (const pair of input.split(",")) {
176
+ const eq = pair.indexOf("=");
177
+ if (eq > 0) result[pair.substring(0, eq)] = pair.substring(eq + 1);
178
+ }
179
+ return result;
180
+ }
181
+ //#endregion
182
+ export { add_default as default };
183
+
184
+ //# sourceMappingURL=add-Qzd8i-5k.js.map
@@ -0,0 +1,115 @@
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
+ import { n as output, t as error } from "./output-HtT5HCof.js";
3
+ import { t as print_dry_run } from "./dry-run-XQ32fxPT.js";
4
+ import { defineCommand } from "citty";
5
+ //#region src/cli/commands/add-json.ts
6
+ var add_json_default = defineCommand({
7
+ meta: {
8
+ name: "add-json",
9
+ description: "Add an MCP server from a JSON configuration string"
10
+ },
11
+ args: {
12
+ name: {
13
+ type: "positional",
14
+ description: "Server name",
15
+ required: true
16
+ },
17
+ config: {
18
+ type: "positional",
19
+ description: "JSON configuration string",
20
+ required: true
21
+ },
22
+ client: {
23
+ type: "string",
24
+ description: "Client to edit: claude-code, gemini-cli, vscode, cursor, windsurf, opencode, or pi",
25
+ default: "claude-code"
26
+ },
27
+ scope: {
28
+ type: "string",
29
+ description: "Scope: local, project, or user (default: local for Claude Code)"
30
+ },
31
+ location: {
32
+ type: "string",
33
+ description: "Exact config path when a client has multiple matching locations"
34
+ },
35
+ dryRun: {
36
+ type: "boolean",
37
+ description: "Preview changes without writing",
38
+ default: false
39
+ },
40
+ json: {
41
+ type: "boolean",
42
+ description: "Output as JSON",
43
+ default: false
44
+ }
45
+ },
46
+ async run({ args }) {
47
+ let parsed;
48
+ try {
49
+ parsed = JSON.parse(args.config);
50
+ } catch {
51
+ error("Invalid JSON configuration. Provide a valid JSON string.");
52
+ }
53
+ if (!parsed || typeof parsed !== "object" || Array.isArray(parsed)) error("JSON configuration must be an object.");
54
+ if (args.client && args.client !== "claude-code") {
55
+ await add_json_to_client(args.client, args.name, parsed, args.scope, args.location, args.json, args.dryRun);
56
+ return;
57
+ }
58
+ const scope = args.scope || "local";
59
+ if (![
60
+ "local",
61
+ "project",
62
+ "user"
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
+ }
74
+ const result = await mcp_add_json_via_cli(args.name, args.config, scope);
75
+ if (args.json) output({
76
+ added: args.name,
77
+ client: "claude-code",
78
+ scope,
79
+ success: result.success,
80
+ error: result.error
81
+ }, true);
82
+ else if (result.success) console.log(`Added '${args.name}' from JSON (scope: ${scope})`);
83
+ else error(result.error || "Unknown error");
84
+ }
85
+ });
86
+ async function add_json_to_client(client, name, config, scope, location_path, json, dry_run) {
87
+ const adapter = get_client_adapter(client);
88
+ if (!adapter) error(`Invalid client: ${client}. Use claude-code, gemini-cli, vscode, cursor, windsurf, opencode, or pi.`);
89
+ if (scope && ![
90
+ "local",
91
+ "project",
92
+ "user"
93
+ ].includes(scope)) error(`Invalid scope: ${scope}. Use local, project, or user.`);
94
+ try {
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
+ }
100
+ await add_client_server_config(adapter, location, name, config);
101
+ if (json) output({
102
+ added: name,
103
+ client: adapter.id,
104
+ scope: location.scope,
105
+ location: location.path
106
+ }, true);
107
+ else console.log(`Added '${name}' from JSON (${adapter.id}:${location.scope})`);
108
+ } catch (err) {
109
+ error(err instanceof Error ? err.message : "Failed to add server");
110
+ }
111
+ }
112
+ //#endregion
113
+ export { add_json_default as default };
114
+
115
+ //# sourceMappingURL=add-json-DGmsjB0O.js.map
@@ -1,7 +1,7 @@
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-6wrIM8yh.js";
2
- import { s as read_claude_config } from "./config-BhX4eAgg.js";
3
- import { a as read_claude_settings } from "./settings-CZR8bVfh.js";
4
- import { n as output } from "./output-BgN9Uuxf.js";
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-DE58Fik_.js";
3
+ import { Z as read_claude_settings } from "./index.js";
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";
7
7
  import { defineCommand } from "citty";
@@ -61,4 +61,4 @@ var backup_default = defineCommand({
61
61
  //#endregion
62
62
  export { backup_default as default };
63
63
 
64
- //# sourceMappingURL=backup-bdg6dvsb.js.map
64
+ //# sourceMappingURL=backup-C7fvikFw.js.map
@@ -1,5 +1,5 @@
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-DKcW8LGV.js";
2
- import { n as output, t as error } from "./output-BgN9Uuxf.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
+ import { n as output, t as error } from "./output-HtT5HCof.js";
3
3
  import { defineCommand } from "citty";
4
4
  var cache_default = defineCommand({
5
5
  meta: {
@@ -223,4 +223,4 @@ var cache_default = defineCommand({
223
223
  //#endregion
224
224
  export { cache_default as default };
225
225
 
226
- //# sourceMappingURL=cache-CSUcGdZP.js.map
226
+ //# sourceMappingURL=cache-D3jjh5dD.js.map
@@ -6,26 +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-By--kltj.js").then((m) => m.default),
10
- enable: () => import("./enable-CGFYYC2A.js").then((m) => m.default),
11
- disable: () => import("./disable-DLlOj7sc.js").then((m) => m.default),
12
- clients: () => import("./clients-CSQgqHzb.js").then((m) => m.default),
13
- remove: () => import("./remove-B5q4rQRU.js").then((m) => m.default),
14
- add: () => import("./add-Bok0qbXi.js").then((m) => m.default),
15
- "add-json": () => import("./add-json-C44vy2A_.js").then((m) => m.default),
16
- clone: () => import("./clone-CQ0skkT6.js").then((m) => m.default),
17
- get: () => import("./get-l-eAJhBy.js").then((m) => m.default),
18
- "reset-project-choices": () => import("./reset-project-choices-Dhh4CxIC.js").then((m) => m.default),
19
- backup: () => import("./backup-bdg6dvsb.js").then((m) => m.default),
20
- restore: () => import("./restore-BI8aiszM.js").then((m) => m.default),
21
- profile: () => import("./profile-DzGPsdsl.js").then((m) => m.default),
22
- skills: () => import("./skills-DPBDmION.js").then((m) => m.default),
23
- plugins: () => import("./plugins-CsXE8AH4.js").then((m) => m.default),
24
- hooks: () => import("./hooks-BWZ_Kgx3.js").then((m) => m.default),
25
- cache: () => import("./cache-CSUcGdZP.js").then((m) => m.default),
26
- dev: () => import("./dev-CTDg5g-c.js").then((m) => m.default),
27
- marketplace: () => import("./marketplace-DdiKDDKK.js").then((m) => m.default),
28
- reload: () => import("./reload-C29-vuvy.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)
29
30
  }
30
31
  });
31
32
  /**
@@ -108,4 +109,4 @@ const run = () => runMain(main, { showUsage: show_usage_with_examples });
108
109
  //#endregion
109
110
  export { run };
110
111
 
111
- //# sourceMappingURL=cli-avr5R1LO.js.map
112
+ //# sourceMappingURL=cli-CZOlaqoZ.js.map
@@ -1,5 +1,5 @@
1
- import { j as list_client_locations } from "./index.js";
2
- import { n as output } from "./output-BgN9Uuxf.js";
1
+ import { L as list_client_locations } from "./index.js";
2
+ import { n as output } from "./output-HtT5HCof.js";
3
3
  import { defineCommand } from "citty";
4
4
  //#region src/cli/commands/clients.ts
5
5
  var clients_default = defineCommand({
@@ -27,4 +27,4 @@ var clients_default = defineCommand({
27
27
  //#endregion
28
28
  export { clients_default as default };
29
29
 
30
- //# sourceMappingURL=clients-CSQgqHzb.js.map
30
+ //# sourceMappingURL=clients-Bh93TGP4.js.map
@@ -1,8 +1,8 @@
1
- import { n as validate_mcp_server } from "./validation-qWlF51fw.js";
2
- import { i as find_server_in_scope, r as detect_server_scope } from "./config-BhX4eAgg.js";
3
- import { n as redact_server } from "./redact-Dltz2gde.js";
4
- import { d as add_mcp_via_cli, w as add_server_to_registry } from "./index.js";
5
- import { n as output, t as error } from "./output-BgN9Uuxf.js";
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-DE58Fik_.js";
3
+ import { n as redact_server } from "./redact-wBMtzbno.js";
4
+ import { O as add_server_to_registry, f as add_mcp_via_cli } from "./index.js";
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
8
8
  var clone_default = defineCommand({
@@ -84,4 +84,4 @@ var clone_default = defineCommand({
84
84
  //#endregion
85
85
  export { clone_default as default };
86
86
 
87
- //# sourceMappingURL=clone-CQ0skkT6.js.map
87
+ //# sourceMappingURL=clone-MI8jJhTz.js.map
@@ -1,7 +1,7 @@
1
1
  import { t as __exportAll } from "./rolldown-runtime-CiIaOW0V.js";
2
- import { t as atomic_json_write } from "./atomic-write-4lANmzsO.js";
3
- import { i as get_claude_config_path, o as get_current_project_path, v as get_project_mcp_json_path } from "./paths-6wrIM8yh.js";
4
- import { t as validate_claude_config } from "./validation-qWlF51fw.js";
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
+ import { t as validate_claude_config } from "./validation-xMlbgGCF.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-BhX4eAgg.js.map
176
+ //# sourceMappingURL=config-DE58Fik_.js.map
@@ -1,8 +1,8 @@
1
- import { t as atomic_json_write } from "./atomic-write-4lANmzsO.js";
2
- 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-6wrIM8yh.js";
3
- import { i as find_server_in_scope, r as detect_server_scope } from "./config-BhX4eAgg.js";
4
- import { r as redact_server_base } from "./redact-Dltz2gde.js";
5
- import { n as output, t as error } from "./output-BgN9Uuxf.js";
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-DE58Fik_.js";
3
+ import { r as redact_server_base } from "./redact-wBMtzbno.js";
4
+ import { et as atomic_json_write } from "./index.js";
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";
8
8
  //#region src/core/dev-override.ts
@@ -262,4 +262,4 @@ var dev_default = defineCommand({
262
262
  //#endregion
263
263
  export { dev_default as default };
264
264
 
265
- //# sourceMappingURL=dev-CTDg5g-c.js.map
265
+ //# sourceMappingURL=dev-51esdZG9.js.map
@@ -0,0 +1,106 @@
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
+ import { n as output, t as error } from "./output-HtT5HCof.js";
3
+ import { t as print_dry_run } from "./dry-run-XQ32fxPT.js";
4
+ import { defineCommand } from "citty";
5
+ //#region src/cli/commands/disable.ts
6
+ var disable_default = defineCommand({
7
+ meta: {
8
+ name: "disable",
9
+ description: "Disable an MCP server"
10
+ },
11
+ args: {
12
+ server: {
13
+ type: "positional",
14
+ description: "Server name to disable",
15
+ required: true
16
+ },
17
+ client: {
18
+ type: "string",
19
+ description: "Client to edit: claude-code, gemini-cli, vscode, cursor, windsurf, opencode, or pi",
20
+ default: "claude-code"
21
+ },
22
+ scope: {
23
+ type: "string",
24
+ description: "Scope: local, project, or user (default: local for Claude Code)"
25
+ },
26
+ location: {
27
+ type: "string",
28
+ description: "Exact config path when a client has multiple matching locations"
29
+ },
30
+ dryRun: {
31
+ type: "boolean",
32
+ description: "Preview changes without writing",
33
+ default: false
34
+ },
35
+ json: {
36
+ type: "boolean",
37
+ description: "Output as JSON",
38
+ default: false
39
+ }
40
+ },
41
+ async run({ args }) {
42
+ if (args.client && args.client !== "claude-code") {
43
+ await disable_client_server(args.client, args.server, args.scope, args.location, args.json, args.dryRun);
44
+ return;
45
+ }
46
+ const scope = args.scope || "local";
47
+ if (![
48
+ "local",
49
+ "project",
50
+ "user"
51
+ ].includes(scope)) error(`Invalid scope: ${scope}. Use local, project, or user.`);
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
+ }
63
+ const result = await remove_mcp_via_cli(args.server, scope);
64
+ if (!result.success) error(result.error || "Failed to disable server");
65
+ if (args.json) output({
66
+ disabled: args.server,
67
+ client: "claude-code",
68
+ scope
69
+ }, true);
70
+ else console.log(`Disabled '${args.server}' (scope: ${scope})`);
71
+ }
72
+ });
73
+ async function disable_client_server(client, server, scope, location_path, json, dry_run) {
74
+ const adapter = get_client_adapter(client);
75
+ if (!adapter) error(`Invalid client: ${client}. Use claude-code, gemini-cli, vscode, cursor, windsurf, opencode, or pi.`);
76
+ if (scope && ![
77
+ "local",
78
+ "project",
79
+ "user"
80
+ ].includes(scope)) error(`Invalid scope: ${scope}. Use local, project, or user.`);
81
+ try {
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
+ }
90
+ const enabled_count = await set_client_server_enabled(adapter, location, server, false);
91
+ if (json) output({
92
+ disabled: server,
93
+ client: adapter.id,
94
+ scope: location.scope,
95
+ location: location.path,
96
+ enabledCount: enabled_count
97
+ }, true);
98
+ else console.log(`Disabled '${server}' (${adapter.id}:${location.scope})`);
99
+ } catch (err) {
100
+ error(err instanceof Error ? err.message : "Failed to disable server");
101
+ }
102
+ }
103
+ //#endregion
104
+ export { disable_default as default };
105
+
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