codex-review-mcp 2.2.0 → 2.2.1

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 (2) hide show
  1. package/dist/mcp-server.js +35 -7
  2. package/package.json +1 -1
@@ -22,7 +22,8 @@ server.registerTool('get_version', {
22
22
  type: 'text',
23
23
  text: `codex-review-mcp version ${VERSION}`,
24
24
  mimeType: 'text/plain'
25
- }]
25
+ }],
26
+ _meta: { version: VERSION }
26
27
  };
27
28
  });
28
29
  server.registerTool('perform_code_review', {
@@ -93,28 +94,55 @@ server.registerTool('perform_code_review', {
93
94
  }, extra?.requestId ? { relatedRequestId: extra.requestId } : undefined);
94
95
  };
95
96
  const markdown = await performCodeReview(reviewInput, onProgress);
96
- return { content: [{ type: 'text', text: markdown, mimeType: 'text/markdown' }] };
97
+ return {
98
+ content: [{ type: 'text', text: markdown, mimeType: 'text/markdown' }],
99
+ _meta: { version: VERSION }
100
+ };
97
101
  }
98
102
  catch (error) {
99
103
  const errorMessage = error?.message || String(error);
104
+ const errorStack = error?.stack || '';
105
+ // Log detailed error to stderr for MCP logs
106
+ console.error(`[codex-review-mcp v${VERSION}] Tool error:`, errorMessage);
107
+ if (errorStack) {
108
+ console.error('[codex-review-mcp] Stack trace:', errorStack);
109
+ }
100
110
  return {
101
111
  content: [{
102
112
  type: 'text',
103
- text: `❌ Code Review Failed\n\n${errorMessage}`,
113
+ text: `❌ Code Review Failed\n\n**Error:** ${errorMessage}\n\n**Version:** ${VERSION}\n\nCheck MCP server logs for details.`,
104
114
  mimeType: 'text/markdown'
105
115
  }],
106
- isError: true
116
+ isError: true,
117
+ _meta: { version: VERSION, error: errorMessage }
107
118
  };
108
119
  }
109
120
  });
110
- // Global error handlers to prevent server crashes
121
+ // Global error handlers to prevent server crashes and inform users
111
122
  process.on('unhandledRejection', (reason, promise) => {
112
- console.error('[codex-review-mcp] Unhandled Rejection at:', promise, 'reason:', reason);
123
+ const errorMsg = reason instanceof Error ? reason.message : String(reason);
124
+ const errorStack = reason instanceof Error ? reason.stack : '';
125
+ console.error(`[codex-review-mcp v${VERSION}] ⚠️ UNHANDLED REJECTION`);
126
+ console.error(`[codex-review-mcp] Reason:`, errorMsg);
127
+ if (errorStack) {
128
+ console.error(`[codex-review-mcp] Stack:`, errorStack);
129
+ }
130
+ console.error(`[codex-review-mcp] Promise:`, promise);
131
+ console.error(`[codex-review-mcp] Server will continue running, but this indicates a bug that should be fixed.`);
113
132
  // Don't exit - let the server continue running
114
133
  });
115
134
  process.on('uncaughtException', (error) => {
116
- console.error('[codex-review-mcp] Uncaught Exception:', error);
135
+ console.error(`[codex-review-mcp v${VERSION}] ⚠️ UNCAUGHT EXCEPTION`);
136
+ console.error(`[codex-review-mcp] Error:`, error.message);
137
+ console.error(`[codex-review-mcp] Stack:`, error.stack);
138
+ console.error(`[codex-review-mcp] Server will continue running, but this indicates a serious bug.`);
117
139
  // Don't exit - let the server continue running
118
140
  });
141
+ // Log startup information
142
+ console.error(`[codex-review-mcp v${VERSION}] Starting server...`);
143
+ console.error(`[codex-review-mcp] Node version: ${process.version}`);
144
+ console.error(`[codex-review-mcp] Platform: ${process.platform}`);
119
145
  const transport = new StdioServerTransport();
120
146
  await server.connect(transport);
147
+ console.error(`[codex-review-mcp v${VERSION}] ✅ Server started successfully`);
148
+ console.error(`[codex-review-mcp] Ready to accept tool requests`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "codex-review-mcp",
3
- "version": "2.2.0",
3
+ "version": "2.2.1",
4
4
  "main": "index.js",
5
5
  "scripts": {
6
6
  "build": "tsc",