mcpick 0.0.20 → 0.0.22

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 (43) hide show
  1. package/.github/copilot-instructions.md +39 -21
  2. package/CHANGELOG.md +24 -4
  3. package/CONTEXT.md +49 -0
  4. package/README.md +149 -309
  5. package/dist/{add-BDyaBew0.js → add-Bok0qbXi.js} +4 -5
  6. package/dist/{add-json-BjgzdeG-.js → add-json-C44vy2A_.js} +3 -3
  7. package/dist/{atomic-write-BqEykHp9.js → atomic-write-4lANmzsO.js} +1 -1
  8. package/dist/{backup-DSDhHI5f.js → backup-bdg6dvsb.js} +5 -5
  9. package/dist/{cache-D6kd7qE8.js → cache-CSUcGdZP.js} +3 -3
  10. package/dist/cli-avr5R1LO.js +111 -0
  11. package/dist/clients-CSQgqHzb.js +30 -0
  12. package/dist/{clone-DYKPEsar.js → clone-CQ0skkT6.js} +6 -7
  13. package/dist/{config-DijVdEFn.js → config-BhX4eAgg.js} +4 -4
  14. package/dist/{dev-DRJRNp7y.js → dev-CTDg5g-c.js} +6 -6
  15. package/dist/{disable-xJXZfUR_.js → disable-DLlOj7sc.js} +3 -4
  16. package/dist/{enable-RrpcN6la.js → enable-CGFYYC2A.js} +3 -4
  17. package/dist/{get-Bb1eOOIZ.js → get-l-eAJhBy.js} +3 -3
  18. package/dist/{hooks-Bmn7pUZa.js → hooks-BWZ_Kgx3.js} +4 -4
  19. package/dist/index.js +1485 -318
  20. package/dist/list-By--kltj.js +100 -0
  21. package/dist/{marketplace-DcKk5dc1.js → marketplace-DdiKDDKK.js} +4 -5
  22. package/dist/output-BgN9Uuxf.js +17 -0
  23. package/dist/{paths-BPISiJi4.js → paths-6wrIM8yh.js} +1 -1
  24. package/dist/{plugin-cache-Bby9Dxm9.js → plugin-cache-DKcW8LGV.js} +3 -3
  25. package/dist/{plugins-Dc7DN6R_.js → plugins-CsXE8AH4.js} +5 -5
  26. package/dist/{profile-CX97sMGp.js → profile-DzGPsdsl.js} +5 -5
  27. package/dist/redact-Dltz2gde.js +88 -0
  28. package/dist/{reload-CYDhkCVZ.js → reload-C29-vuvy.js} +2 -2
  29. package/dist/{remove-D1owHLhG.js → remove-B5q4rQRU.js} +3 -4
  30. package/dist/{reset-project-choices-BfRSNN3m.js → reset-project-choices-Dhh4CxIC.js} +3 -3
  31. package/dist/{restore-DdMfUljI.js → restore-BI8aiszM.js} +6 -6
  32. package/dist/{settings-DEcWtzLE.js → settings-CZR8bVfh.js} +5 -5
  33. package/dist/skills-DPBDmION.js +216 -0
  34. package/dist/{validation-xMlbgGCF.js → validation-qWlF51fw.js} +1 -1
  35. package/package.json +20 -6
  36. package/dist/claude-cli-DnmBJrjg.js +0 -445
  37. package/dist/cli-CsFfnWBo.js +0 -84
  38. package/dist/hook-state-Di8lUsPr.js +0 -171
  39. package/dist/list-B8YeDWt6.js +0 -64
  40. package/dist/output-BchYq0mR.js +0 -15
  41. package/dist/profile-DkY_lBEm.js +0 -70
  42. package/dist/redact-O35tjnRD.js +0 -26
  43. package/dist/registry-CfUKT7_C.js +0 -92
@@ -1,64 +0,0 @@
1
- import { n as get_all_available_servers } from "./registry-CfUKT7_C.js";
2
- import { o as get_enabled_servers_for_scope } from "./config-DijVdEFn.js";
3
- import { n as output, t as error } from "./output-BchYq0mR.js";
4
- import { t as redact_server } from "./redact-O35tjnRD.js";
5
- import { defineCommand } from "citty";
6
- //#region src/cli/commands/list.ts
7
- var list_default = defineCommand({
8
- meta: {
9
- name: "list",
10
- description: "List all MCP servers and their status"
11
- },
12
- args: {
13
- scope: {
14
- type: "string",
15
- description: "Scope to check: local, project, or user"
16
- },
17
- json: {
18
- type: "boolean",
19
- description: "Output as JSON",
20
- default: false
21
- }
22
- },
23
- async run({ args }) {
24
- const scopes = args.scope ? [args.scope] : [
25
- "local",
26
- "project",
27
- "user"
28
- ];
29
- if (args.scope && ![
30
- "local",
31
- "project",
32
- "user"
33
- ].includes(args.scope)) error(`Invalid scope: ${args.scope}. Use local, project, or user.`);
34
- const all_servers = await get_all_available_servers();
35
- const enabled_by_scope = {};
36
- for (const scope of scopes) enabled_by_scope[scope] = await get_enabled_servers_for_scope(scope);
37
- if (args.json) output(all_servers.map((server) => {
38
- const status = {};
39
- for (const scope of scopes) status[scope] = enabled_by_scope[scope].includes(server.name);
40
- const { name, ...rest } = redact_server(server);
41
- return {
42
- name,
43
- ...status,
44
- ...rest
45
- };
46
- }), true);
47
- else {
48
- if (all_servers.length === 0) {
49
- console.log("No servers in registry.");
50
- return;
51
- }
52
- for (const server of all_servers) {
53
- const statuses = scopes.map((scope) => {
54
- return `${scope}:${enabled_by_scope[scope].includes(server.name) ? "on" : "off"}`;
55
- }).join(" ");
56
- console.log(`${server.name} ${statuses}`);
57
- }
58
- }
59
- }
60
- });
61
- //#endregion
62
- export { list_default as default };
63
-
64
- //# sourceMappingURL=list-B8YeDWt6.js.map
@@ -1,15 +0,0 @@
1
- //#region src/cli/output.ts
2
- function output(data, json) {
3
- if (json) console.log(JSON.stringify(data, null, 2));
4
- else if (typeof data === "string") console.log(data);
5
- else if (Array.isArray(data)) for (const item of data) console.log(item);
6
- else console.log(data);
7
- }
8
- function error(message) {
9
- console.error(`error: ${message}`);
10
- process.exit(1);
11
- }
12
- //#endregion
13
- export { output as n, error as t };
14
-
15
- //# sourceMappingURL=output-BchYq0mR.js.map
@@ -1,70 +0,0 @@
1
- import { _ as get_profiles_dir, g as get_profile_path, t as ensure_directory_exists } from "./paths-BPISiJi4.js";
2
- import { t as validate_claude_config } from "./validation-xMlbgGCF.js";
3
- import { s as read_claude_config } from "./config-DijVdEFn.js";
4
- import { a as read_claude_settings } from "./settings-DEcWtzLE.js";
5
- import { access, readFile, readdir, writeFile } from "node:fs/promises";
6
- //#region src/core/profile.ts
7
- async function load_profile(name) {
8
- const profile_path = get_profile_path(name);
9
- try {
10
- await access(profile_path);
11
- const content = await readFile(profile_path, "utf-8");
12
- const parsed = JSON.parse(content);
13
- let config;
14
- if (parsed.mcpServers) config = validate_claude_config(parsed);
15
- else if (!parsed.enabledPlugins) config = validate_claude_config({ mcpServers: parsed });
16
- else config = validate_claude_config({ mcpServers: parsed.mcpServers || {} });
17
- return {
18
- config,
19
- enabledPlugins: parsed.enabledPlugins
20
- };
21
- } catch (error) {
22
- if (error instanceof Error && "code" in error && error.code === "ENOENT") throw new Error(`Profile '${name}' not found at ${profile_path}`);
23
- throw error;
24
- }
25
- }
26
- async function list_profiles() {
27
- const profiles_dir = get_profiles_dir();
28
- try {
29
- await access(profiles_dir);
30
- const json_files = (await readdir(profiles_dir)).filter((f) => f.endsWith(".json"));
31
- const profiles = [];
32
- for (const file of json_files) try {
33
- const path = get_profile_path(file);
34
- const content = await readFile(path, "utf-8");
35
- const parsed = JSON.parse(content);
36
- const servers = parsed.mcpServers || parsed;
37
- const plugins = parsed.enabledPlugins || {};
38
- profiles.push({
39
- name: file.replace(".json", ""),
40
- path,
41
- serverCount: Object.keys(servers).length,
42
- pluginCount: Object.keys(plugins).length
43
- });
44
- } catch {}
45
- return profiles;
46
- } catch {
47
- return [];
48
- }
49
- }
50
- async function save_profile(name) {
51
- const config = await read_claude_config();
52
- const settings = await read_claude_settings();
53
- const servers = config.mcpServers || {};
54
- const plugins = settings.enabledPlugins || {};
55
- const server_count = Object.keys(servers).length;
56
- const plugin_count = Object.keys(plugins).length;
57
- if (server_count === 0 && plugin_count === 0) throw new Error("No MCP servers or plugins configured to save");
58
- await ensure_directory_exists(get_profiles_dir());
59
- const profile_data = { mcpServers: servers };
60
- if (plugin_count > 0) profile_data.enabledPlugins = plugins;
61
- await writeFile(get_profile_path(name), JSON.stringify(profile_data, null, 2), "utf-8");
62
- return {
63
- serverCount: server_count,
64
- pluginCount: plugin_count
65
- };
66
- }
67
- //#endregion
68
- export { load_profile as n, save_profile as r, list_profiles as t };
69
-
70
- //# sourceMappingURL=profile-DkY_lBEm.js.map
@@ -1,26 +0,0 @@
1
- //#region src/utils/redact.ts
2
- /**
3
- * Redact sensitive values (env, headers) from a server config.
4
- * Shows key names but replaces values with "***".
5
- */
6
- function redact_server_base(server) {
7
- const redacted = { ...server };
8
- if ("env" in redacted && redacted.env) redacted.env = redact_record(redacted.env);
9
- if ("headers" in redacted && redacted.headers) redacted.headers = redact_record(redacted.headers);
10
- return redacted;
11
- }
12
- function redact_server(server) {
13
- return {
14
- ...redact_server_base(server),
15
- name: server.name
16
- };
17
- }
18
- function redact_record(record) {
19
- const redacted = {};
20
- for (const key of Object.keys(record)) redacted[key] = "***";
21
- return redacted;
22
- }
23
- //#endregion
24
- export { redact_server_base as n, redact_server as t };
25
-
26
- //# sourceMappingURL=redact-O35tjnRD.js.map
@@ -1,92 +0,0 @@
1
- import { p as get_mcpick_dir, r as get_backups_dir, t as ensure_directory_exists, y as get_server_registry_path } from "./paths-BPISiJi4.js";
2
- import { r as validate_server_registry } from "./validation-xMlbgGCF.js";
3
- import { access, readFile, readdir, writeFile } from "node:fs/promises";
4
- import { join } from "node:path";
5
- //#region src/core/registry.ts
6
- async function read_server_registry() {
7
- const registry_path = get_server_registry_path();
8
- try {
9
- await access(registry_path);
10
- const registry_content = await readFile(registry_path, "utf-8");
11
- return validate_server_registry(JSON.parse(registry_content));
12
- } catch (error) {
13
- if (error instanceof Error && "code" in error && error.code === "ENOENT") {
14
- await ensure_directory_exists(get_mcpick_dir());
15
- const default_registry = { servers: [] };
16
- await write_server_registry(default_registry);
17
- return default_registry;
18
- }
19
- throw error;
20
- }
21
- }
22
- async function write_server_registry(registry) {
23
- const registry_path = get_server_registry_path();
24
- await ensure_directory_exists(get_mcpick_dir());
25
- await writeFile(registry_path, JSON.stringify(registry, null, 2), "utf-8");
26
- }
27
- async function add_server_to_registry(server) {
28
- const registry = await read_server_registry();
29
- const existing_index = registry.servers.findIndex((s) => s.name === server.name);
30
- if (existing_index >= 0) registry.servers[existing_index] = server;
31
- else registry.servers.push(server);
32
- await write_server_registry(registry);
33
- }
34
- async function get_all_available_servers() {
35
- const { get_enabled_servers, read_claude_config } = await import("./config-DijVdEFn.js").then((n) => n.t);
36
- const registry = await read_server_registry();
37
- const config_servers = get_enabled_servers(await read_claude_config());
38
- const config_by_name = new Map(config_servers.map((s) => [s.name, s]));
39
- const known_names = /* @__PURE__ */ new Set();
40
- let registry_updated = false;
41
- for (let i = 0; i < registry.servers.length; i++) {
42
- const name = registry.servers[i].name;
43
- known_names.add(name);
44
- const config_server = config_by_name.get(name);
45
- if (config_server) {
46
- registry.servers[i] = config_server;
47
- registry_updated = true;
48
- }
49
- }
50
- for (const server of config_servers) if (!known_names.has(server.name)) {
51
- registry.servers.push(server);
52
- registry_updated = true;
53
- }
54
- if (registry_updated) await write_server_registry(registry);
55
- return registry.servers;
56
- }
57
- async function sync_servers_to_registry(servers) {
58
- const registry = await read_server_registry();
59
- servers.forEach((server) => {
60
- const existing_index = registry.servers.findIndex((s) => s.name === server.name);
61
- if (existing_index >= 0) registry.servers[existing_index] = server;
62
- else registry.servers.push(server);
63
- });
64
- await write_server_registry(registry);
65
- }
66
- function parse_backups(prefix, pattern) {
67
- return async () => {
68
- const backups_dir = get_backups_dir();
69
- try {
70
- await access(backups_dir);
71
- return (await readdir(backups_dir)).filter((file) => file.startsWith(prefix) && file.endsWith(".json")).map((file) => {
72
- const timestamp_match = file.match(pattern);
73
- if (!timestamp_match) return null;
74
- const [, year, month, day, hour, minute, second] = timestamp_match;
75
- return {
76
- filename: file,
77
- timestamp: new Date(parseInt(year), parseInt(month) - 1, parseInt(day), parseInt(hour), parseInt(minute), parseInt(second)),
78
- path: join(backups_dir, file)
79
- };
80
- }).filter((backup) => backup !== null).sort((a, b) => b.timestamp.getTime() - a.timestamp.getTime());
81
- } catch (error) {
82
- if (error instanceof Error && "code" in error && error.code === "ENOENT") return [];
83
- throw error;
84
- }
85
- };
86
- }
87
- const list_backups = parse_backups("mcp-servers-", /mcp-servers-(\d{4})-(\d{2})-(\d{2})-(\d{2})(\d{2})(\d{2})\.json/);
88
- const list_plugin_backups = parse_backups("plugins-", /plugins-(\d{4})-(\d{2})-(\d{2})-(\d{2})(\d{2})(\d{2})\.json/);
89
- //#endregion
90
- export { read_server_registry as a, list_plugin_backups as i, get_all_available_servers as n, sync_servers_to_registry as o, list_backups as r, write_server_registry as s, add_server_to_registry as t };
91
-
92
- //# sourceMappingURL=registry-CfUKT7_C.js.map