@stealthmole/mcp 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/README.md CHANGED
@@ -6,13 +6,15 @@ Connect [Claude Desktop](https://claude.ai/download), [Claude Code](https://docs
6
6
 
7
7
  ### All MCP clients at once
8
8
 
9
- Register StealthMole in every MCP client installed on this machine (Claude Desktop, Claude Code, Cursor, Codex, VS Code, Windsurf, and more):
9
+ Register StealthMole in the MCP clients installed on this machine (Claude Desktop, Claude Code, Cursor, Codex, VS Code, Windsurf, and more):
10
10
 
11
11
  ```bash
12
12
  npx -y @stealthmole/mcp install
13
13
  ```
14
14
 
15
- Pick clients with `-a` (repeatable), e.g. `npx -y @stealthmole/mcp install -a cursor -a codex`. Run `npx -y @stealthmole/mcp install --help` for the full client list. A client that already runs StealthMole is left unchanged, so running it again is safe. Restart your clients afterwards.
15
+ A checklist of the detected clients appears, all checked: press Space to uncheck a client, Enter to register. Without a terminal (scripts, CI), every detected client is registered.
16
+
17
+ Or name clients with `-a` (repeatable) to skip the checklist, e.g. `npx -y @stealthmole/mcp install -a cursor -a codex`. Run `npx -y @stealthmole/mcp install --help` for the full client list. A client that already runs StealthMole is left unchanged, so running it again is safe. Restart your clients afterwards.
16
18
 
17
19
  ### Claude Desktop
18
20
 
package/bin/install.mjs CHANGED
@@ -1,16 +1,19 @@
1
1
  // `npx -y @stealthmole/mcp install [-a <agent>]...` — register this server in
2
- // every MCP client on the machine (Claude Desktop, Claude Code, Cursor, Codex, …)
2
+ // the MCP clients on the machine (Claude Desktop, Claude Code, Cursor, Codex, …)
3
3
  // through add-mcp's library, which knows each client's config path and format.
4
4
  //
5
- // chosen agents ──▶ listInstalledServers ──┬─ already launches us ─▶ skip
6
- // (-a, or all detected) └─ not yet ─────────────▶ upsertServer
5
+ // -a given ─────────────────────────────┐
6
+ // terminal: detected ─▶ checkbox pick ──┼─▶ listInstalledServers ──┬─ already launches us ─▶ skip
7
+ // no terminal: all detected ────────────┘ └─ not yet ─────────────▶ upsertServer
7
8
  //
8
9
  // Skipping is the point: add-mcp's own CLI overwrites a same-named entry (the
9
10
  // customer's `env` is lost) and adds a second one under a new name (every tool
10
11
  // shows up twice). Identity is the package an entry launches, as in
11
12
  // claude-desktop-config.mjs.
12
13
 
14
+ import { multiselect } from "@clack/prompts";
13
15
  import {
16
+ agents,
14
17
  detectGlobalAgents,
15
18
  getAgentTypes,
16
19
  listInstalledServers,
@@ -24,8 +27,9 @@ const AGENT_FLAGS = new Set(["-a", "--agent"]);
24
27
 
25
28
  const USAGE =
26
29
  "Usage: npx -y @stealthmole/mcp install [-a <agent>]...\n" +
27
- "\nRegisters StealthMole MCP in every detected MCP client, or only in the\n" +
28
- "clients named with -a. Clients that already run it are left unchanged.\n" +
30
+ "\nRegisters StealthMole MCP in the clients named with -a. Without -a, a\n" +
31
+ "terminal asks which detected clients to use; otherwise all are used.\n" +
32
+ "Clients that already run it are left unchanged.\n" +
29
33
  `\nAgents: ${getAgentTypes().join(", ")}\n`;
30
34
 
31
35
  /**
@@ -38,6 +42,43 @@ export function parseAgents(args) {
38
42
  return args.flatMap((arg, i) => (AGENT_FLAGS.has(arg) && args[i + 1] ? [args[i + 1]] : []));
39
43
  }
40
44
 
45
+ /**
46
+ * Decide which agents to register in.
47
+ *
48
+ * @param {{
49
+ * requested: string[],
50
+ * detect: () => Promise<string[]>,
51
+ * interactive: boolean,
52
+ * pick: (detected: string[]) => Promise<string[] | symbol>,
53
+ * }} options
54
+ * @returns {Promise<string[] | null>} agents; [] when none detected, null when the user picked none
55
+ */
56
+ export async function chooseTargets({ requested, detect, interactive, pick }) {
57
+ if (requested.length) return requested;
58
+ const detected = await detect();
59
+ // ponytail: no terminal keeps 0.1.14's register-all so scripted runs don't break.
60
+ if (!interactive || !detected.length) return detected;
61
+ const picked = await pick(detected);
62
+ // A non-array is clack's cancel symbol (Ctrl+C / Esc).
63
+ return Array.isArray(picked) && picked.length ? picked : null;
64
+ }
65
+
66
+ /**
67
+ * Checkbox prompt over the detected agents, all pre-checked so Enter keeps
68
+ * the old "every client" result.
69
+ *
70
+ * @param {string[]} detected agent types
71
+ * @returns {Promise<string[] | symbol>} picked agent types, or clack's cancel symbol
72
+ */
73
+ function pickAgents(detected) {
74
+ return multiselect({
75
+ message: "Register StealthMole MCP in (space: toggle, enter: confirm)",
76
+ options: detected.map((type) => ({ value: type, label: agents[type].displayName })),
77
+ initialValues: detected,
78
+ required: false,
79
+ });
80
+ }
81
+
41
82
  /**
42
83
  * Register this server in each chosen agent's global config.
43
84
  *
@@ -58,7 +99,16 @@ export async function install({ pkgVersion, args }) {
58
99
  return 1;
59
100
  }
60
101
 
61
- const targets = requested.length ? requested : await detectGlobalAgents();
102
+ const targets = await chooseTargets({
103
+ requested,
104
+ detect: detectGlobalAgents,
105
+ interactive: Boolean(process.stdin.isTTY && process.stdout.isTTY),
106
+ pick: pickAgents,
107
+ });
108
+ if (targets === null) {
109
+ console.error(`${LOG_PREFIX} Nothing selected; nothing registered.`);
110
+ return 0;
111
+ }
62
112
  if (!targets.length) {
63
113
  console.error(`${LOG_PREFIX} No MCP clients found. Name one with -a <agent>.\n\n${USAGE}`);
64
114
  return 1;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stealthmole/mcp",
3
- "version": "0.1.14",
3
+ "version": "0.1.15",
4
4
  "description": "StealthMole Threat Intelligence MCP client - connect Claude Desktop, Cursor, and other MCP clients to StealthMole API",
5
5
  "bin": {
6
6
  "stealthmole-mcp": "bin/cli.mjs"
@@ -12,6 +12,7 @@
12
12
  "bin/"
13
13
  ],
14
14
  "dependencies": {
15
+ "@clack/prompts": "0.9.1",
15
16
  "add-mcp": "2.6.1",
16
17
  "mcp-remote": "0.15.1"
17
18
  },