codex-review-mcp 2.1.1 → 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.
@@ -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,19 +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
  });
121
+ // Global error handlers to prevent server crashes and inform users
122
+ process.on('unhandledRejection', (reason, promise) => {
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.`);
132
+ // Don't exit - let the server continue running
133
+ });
134
+ process.on('uncaughtException', (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.`);
139
+ // Don't exit - let the server continue running
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}`);
110
145
  const transport = new StdioServerTransport();
111
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`);
@@ -33,6 +33,7 @@ export function buildPrompt({ diffText, context, focus, version, isStaticReview
33
33
  '- Do NOT suggest changes that deviate from the project\'s established patterns or introduce external patterns',
34
34
  '- When project guidelines conflict with general best practices, prioritize the project guidelines',
35
35
  '- For accessibility audits: apply axe-core best practices and WCAG 2.1 Level AA guidelines',
36
+ '- When reviewing accessibility audit results or configs: VERIFY the audit tool is configured for WCAG 2.1 Level AA only. FLAG if audits are misconfigured (using WCAG 2.2, Level AAA, or only Level A tags) as these will report violations that don\'t match the Axe browser extension defaults or project compliance requirements. Correct axe-core tags should be: ["wcag2a", "wcag2aa", "wcag21a", "wcag21aa"].',
36
37
  '- CRITICAL Z-INDEX WARNING: Be extremely cautious with z-index changes on modals, overlays, or components. Analyze the entire z-index hierarchy before suggesting changes. Flag any z-index modifications as HIGH RISK and verify they won\'t break stacking context upstream or downstream. Always check for existing z-index patterns in the codebase first.',
37
38
  '- MATERIAL-UI/MUI SPACING: Use theme.spacing() for all margin, padding, and gap values instead of hardcoded px/rem/em values to avoid magic numbers (e.g., gap: theme.spacing(3) for 24px). Flag any hardcoded spacing values.',
38
39
  focusLine,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "codex-review-mcp",
3
- "version": "2.1.1",
3
+ "version": "2.2.1",
4
4
  "main": "index.js",
5
5
  "scripts": {
6
6
  "build": "tsc",