getprismo 0.1.15 → 0.1.17

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
@@ -806,6 +806,7 @@ npx getprismo doctor --help
806
806
  npx getprismo watch --help
807
807
  npx getprismo shield --help
808
808
  npx getprismo mcp --help
809
+ npx getprismo mcp doctor
809
810
  npx getprismo cc --help
810
811
  npx getprismo scan --help
811
812
  ```
package/docs/mcp.md CHANGED
@@ -8,6 +8,16 @@ PrismoDev can run as a local MCP server so compatible coding agents can inspect
8
8
  npx getprismo mcp /path/to/your/repo
9
9
  ```
10
10
 
11
+ ## Doctor
12
+
13
+ Before adding PrismoDev to a client, validate the local MCP surface:
14
+
15
+ ```bash
16
+ npx getprismo mcp doctor /path/to/your/repo
17
+ ```
18
+
19
+ This checks that the MCP server can expose all Prismo tools, runs a scan smoke test, and prints a ready-to-use client config snippet.
20
+
11
21
  ## Generic MCP Config
12
22
 
13
23
  ```json
@@ -258,7 +258,96 @@ function runMcpServer(deps) {
258
258
  });
259
259
  }
260
260
 
261
+ async function runMcpDoctor(deps) {
262
+ const { rootDir, packageVersion = "0.0.0" } = deps;
263
+ const { tools, callTool } = createMcpTools(deps);
264
+ const requiredTools = [
265
+ "prismo_scan",
266
+ "prismo_doctor_dry_run",
267
+ "prismo_watch_snapshot",
268
+ "prismo_shield_run",
269
+ "prismo_shield_search",
270
+ "prismo_shield_last",
271
+ "prismo_context_pack",
272
+ "prismo_firewall",
273
+ "prismo_cc_timeline",
274
+ ];
275
+ const toolNames = tools.map((tool) => tool.name);
276
+ const missingTools = requiredTools.filter((name) => !toolNames.includes(name));
277
+ const scanResult = await callTool("prismo_scan", { path: rootDir, includeUsage: false, limit: 1 });
278
+ let scanPayload = {};
279
+ try {
280
+ scanPayload = JSON.parse(scanResult.content?.[0]?.text || "{}");
281
+ } catch {
282
+ scanPayload = {};
283
+ }
284
+ const config = {
285
+ mcpServers: {
286
+ prismodev: {
287
+ command: "npx",
288
+ args: ["-y", "getprismo", "mcp", rootDir],
289
+ },
290
+ },
291
+ };
292
+ return {
293
+ schemaVersion: 1,
294
+ ok: missingTools.length === 0 && Boolean(scanPayload.schemaVersion),
295
+ server: {
296
+ name: "prismodev",
297
+ version: packageVersion,
298
+ transport: "stdio",
299
+ root: rootDir,
300
+ },
301
+ tools: {
302
+ count: tools.length,
303
+ required: requiredTools,
304
+ missing: missingTools,
305
+ hasShield: toolNames.includes("prismo_shield_run") && toolNames.includes("prismo_shield_search"),
306
+ },
307
+ smoke: {
308
+ scan: {
309
+ ok: Boolean(scanPayload.schemaVersion),
310
+ score: scanPayload.score ?? null,
311
+ riskLevel: scanPayload.riskLevel ?? null,
312
+ },
313
+ },
314
+ config,
315
+ next: [
316
+ "Add the config snippet to your MCP-compatible client.",
317
+ "Restart the client and confirm prismodev appears in the MCP tool list.",
318
+ "Ask the agent to call prismo_scan or prismo_shield_run.",
319
+ ],
320
+ };
321
+ }
322
+
323
+ function renderMcpDoctorTerminal(result) {
324
+ const lines = [];
325
+ lines.push("");
326
+ lines.push("Prismo MCP Doctor");
327
+ lines.push("");
328
+ lines.push(`Status: ${result.ok ? "ready" : "needs attention"}`);
329
+ lines.push(`Server: ${result.server.name}@${result.server.version}`);
330
+ lines.push(`Transport: ${result.server.transport}`);
331
+ lines.push(`Repo: ${result.server.root}`);
332
+ lines.push("");
333
+ lines.push("Checks");
334
+ lines.push(`- Tools exposed: ${result.tools.count}`);
335
+ lines.push(`- Required tools missing: ${result.tools.missing.length ? result.tools.missing.join(", ") : "none"}`);
336
+ lines.push(`- Shield tools: ${result.tools.hasShield ? "ready" : "missing"}`);
337
+ lines.push(`- Scan smoke: ${result.smoke.scan.ok ? `ok (${result.smoke.scan.score}/100, ${result.smoke.scan.riskLevel})` : "failed"}`);
338
+ lines.push("");
339
+ lines.push("MCP config");
340
+ lines.push("");
341
+ lines.push(JSON.stringify(result.config, null, 2));
342
+ lines.push("");
343
+ lines.push("Next");
344
+ result.next.forEach((step, index) => lines.push(`${index + 1}. ${step}`));
345
+ return lines.join("\n");
346
+ }
347
+
261
348
  module.exports = {
262
349
  createMcpTools,
350
+ renderMcpDoctorTerminal,
351
+ runMcpDoctor,
263
352
  runMcpServer,
264
353
  };
@@ -283,7 +283,11 @@ const {
283
283
  color,
284
284
  });
285
285
 
286
- const { runMcpServer } = require("./prismo-dev/mcp");
286
+ const {
287
+ renderMcpDoctorTerminal,
288
+ runMcpDoctor,
289
+ runMcpServer,
290
+ } = require("./prismo-dev/mcp");
287
291
 
288
292
  function printHelp() {
289
293
  console.log(`Prismo CLI
@@ -298,6 +302,7 @@ Usage:
298
302
  prismo shield last [--json] [--limit N] [path]
299
303
  prismo shield search <query> [--json] [--limit N] [path]
300
304
  prismo mcp [path]
305
+ prismo mcp doctor [--json] [path]
301
306
  prismo setup [--json] [--proxy-url URL] [path]
302
307
  prismo scan [--fix] [--ci] [--json] [--usage] [--simple] [--no-report] [path]
303
308
  prismo optimize [scope] [--json] [path]
@@ -521,10 +526,13 @@ Output:
521
526
 
522
527
  Usage:
523
528
  prismo mcp [path]
529
+ prismo mcp doctor [--json] [path]
524
530
 
525
531
  Examples:
526
532
  prismo mcp
527
533
  prismo mcp /path/to/repo
534
+ prismo mcp doctor
535
+ prismo mcp doctor --json
528
536
 
529
537
  Tools exposed:
530
538
  prismo_scan
@@ -538,7 +546,9 @@ Tools exposed:
538
546
  prismo_cc_timeline
539
547
 
540
548
  Output:
541
- Starts a local JSON-RPC MCP server over stdio. Use it from MCP-compatible clients so agents can scan context waste, search shielded command output, and request scoped context without loading huge logs into chat.`,
549
+ Starts a local JSON-RPC MCP server over stdio. Use it from MCP-compatible clients so agents can scan context waste, search shielded command output, and request scoped context without loading huge logs into chat.
550
+
551
+ prismo mcp doctor validates the local MCP tool surface and prints a ready-to-use client config snippet.`,
542
552
  ci: `Prismo CI
543
553
 
544
554
  Usage:
@@ -707,8 +717,11 @@ async function runCli(argv) {
707
717
  }
708
718
 
709
719
  if (command === "mcp") {
710
- const target = getPositionals(rest)[0] || process.cwd();
711
- runMcpServer({
720
+ const json = rest.includes("--json");
721
+ const positional = getPositionals(rest);
722
+ const subcommand = positional[0] === "doctor" ? "doctor" : "server";
723
+ const target = subcommand === "doctor" ? positional[1] || process.cwd() : positional[0] || process.cwd();
724
+ const mcpDeps = {
712
725
  rootDir: path.resolve(target),
713
726
  packageVersion: PACKAGE_VERSION,
714
727
  scanRepo,
@@ -724,7 +737,14 @@ async function runCli(argv) {
724
737
  runShield,
725
738
  runShieldLast,
726
739
  runShieldSearch,
727
- });
740
+ };
741
+ if (subcommand === "doctor") {
742
+ const result = await runMcpDoctor(mcpDeps);
743
+ if (json) console.log(JSON.stringify(result, null, 2));
744
+ else console.log(renderMcpDoctorTerminal(result));
745
+ return;
746
+ }
747
+ runMcpServer(mcpDeps);
728
748
  return;
729
749
  }
730
750
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "getprismo",
3
- "version": "0.1.15",
3
+ "version": "0.1.17",
4
4
  "description": "Local AI coding workflow scanner for Codex, Claude Code, Cursor, and token-waste diagnostics.",
5
5
  "license": "MIT",
6
6
  "homepage": "https://github.com/shanirsh/prismodev#readme",
@@ -24,7 +24,8 @@
24
24
  "access": "public"
25
25
  },
26
26
  "bin": {
27
- "prismo": "bin/prismo.js"
27
+ "prismo": "bin/prismo.js",
28
+ "getprismo": "bin/prismo.js"
28
29
  },
29
30
  "files": [
30
31
  "bin/",