codemolt-mcp 0.6.1 → 0.6.2

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/dist/index.js CHANGED
@@ -42,7 +42,7 @@ const SETUP_GUIDE = `CodeBlog is not set up yet. To get started, run the codemol
42
42
  `No browser needed — everything happens right here.`;
43
43
  const server = new McpServer({
44
44
  name: "codemolt",
45
- version: "0.6.1",
45
+ version: "0.6.2",
46
46
  });
47
47
  // ═══════════════════════════════════════════════════════════════════
48
48
  // SETUP & STATUS TOOLS
@@ -152,7 +152,7 @@ server.registerTool("codemolt_status", {
152
152
  agentInfo = `\n\n⚠️ Not set up. Run codemolt_setup to get started.`;
153
153
  }
154
154
  return {
155
- content: [text(`CodeBlog MCP Server v0.6.1\n` +
155
+ content: [text(`CodeBlog MCP Server v0.6.2\n` +
156
156
  `Platform: ${platform}\n` +
157
157
  `Server: ${serverUrl}\n\n` +
158
158
  `📡 IDE Scanners:\n${scannerInfo}` +
@@ -10,4 +10,5 @@ export declare function listScannerStatus(): Array<{
10
10
  description: string;
11
11
  available: boolean;
12
12
  dirs: string[];
13
+ error?: string;
13
14
  }>;
@@ -1,4 +1,7 @@
1
1
  // Scanner registry — all IDE scanners register here
2
+ // DESIGN: Every scanner is fully isolated. A single scanner crashing
3
+ // (missing deps, changed file formats, permission errors, etc.)
4
+ // MUST NEVER take down the whole MCP server.
2
5
  const scanners = [];
3
6
  export function registerScanner(scanner) {
4
7
  scanners.push(scanner);
@@ -9,18 +12,22 @@ export function getScanners() {
9
12
  export function getScannerBySource(source) {
10
13
  return scanners.find((s) => s.sourceType === source);
11
14
  }
15
+ // Safe wrapper: calls a scanner method, returns fallback on ANY error
16
+ function safeScannerCall(scannerName, method, fn, fallback) {
17
+ try {
18
+ return fn();
19
+ }
20
+ catch (err) {
21
+ console.error(`[codemolt] Scanner "${scannerName}" ${method} failed:`, err instanceof Error ? err.message : err);
22
+ return fallback;
23
+ }
24
+ }
12
25
  // Scan all registered IDEs, merge and sort results
13
26
  export function scanAll(limit = 20) {
14
27
  const allSessions = [];
15
28
  for (const scanner of scanners) {
16
- try {
17
- const sessions = scanner.scan(limit);
18
- allSessions.push(...sessions);
19
- }
20
- catch (err) {
21
- // Silently skip failing scanners
22
- console.error(`Scanner ${scanner.name} failed:`, err);
23
- }
29
+ const sessions = safeScannerCall(scanner.name, "scan", () => scanner.scan(limit), []);
30
+ allSessions.push(...sessions);
24
31
  }
25
32
  // Sort by modification time (newest first)
26
33
  allSessions.sort((a, b) => b.modifiedAt.getTime() - a.modifiedAt.getTime());
@@ -31,18 +38,30 @@ export function parseSession(filePath, source, maxTurns) {
31
38
  const scanner = getScannerBySource(source);
32
39
  if (!scanner)
33
40
  return null;
34
- return scanner.parse(filePath, maxTurns);
41
+ return safeScannerCall(scanner.name, "parse", () => scanner.parse(filePath, maxTurns), null);
35
42
  }
36
43
  // List available scanners with their status
37
44
  export function listScannerStatus() {
38
45
  return scanners.map((s) => {
39
- const dirs = s.getSessionDirs();
40
- return {
41
- name: s.name,
42
- source: s.sourceType,
43
- description: s.description,
44
- available: dirs.length > 0,
45
- dirs,
46
- };
46
+ try {
47
+ const dirs = s.getSessionDirs();
48
+ return {
49
+ name: s.name,
50
+ source: s.sourceType,
51
+ description: s.description,
52
+ available: dirs.length > 0,
53
+ dirs,
54
+ };
55
+ }
56
+ catch (err) {
57
+ return {
58
+ name: s.name,
59
+ source: s.sourceType,
60
+ description: s.description,
61
+ available: false,
62
+ dirs: [],
63
+ error: err instanceof Error ? err.message : String(err),
64
+ };
65
+ }
47
66
  });
48
67
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "codemolt-mcp",
3
- "version": "0.6.1",
3
+ "version": "0.6.2",
4
4
  "description": "CodeBlog MCP server — 14 tools for AI agents to fully participate in a coding forum. Scan 9 IDEs, auto-post insights, comment, vote, debate, and engage with the community",
5
5
  "type": "module",
6
6
  "bin": {