JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 2758
  • Score
    100M100P100Q101301F
  • License MIT

MCP server for AI-powered code reviews using GPT-5 Codex

Package Exports

    This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (codex-review-mcp) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

    Readme

    Codex Review MCP Server

    Get AI-powered code reviews without leaving your conversation. Keep coding with your AI assistant, and when you need a second opinion, just ask for a review - all in the same context window.

    Why This Exists

    You're coding with an AI assistant. It makes changes. You want a quick review. Normally you'd copy/paste code into another chat, wait, copy feedback back. That breaks your flow.

    With this MCP server, your AI assistant can call out for a code review right in the middle of your conversation. No context switching. No copy/paste. The review comes back in the same chat.

    Features

    • 🎯 Zero Configuration - Just add your OpenAI API key
    • 📋 Respects Your Cursor Rules - Automatically reads .cursor/rules/ and enforces YOUR coding standards
    • 🔍 Automatically reviews your uncommitted changes
    • 🤖 Powered by GPT-5 Codex for intelligent code analysis
    • 📊 Returns actionable feedback in Markdown format
    • ⚡ Works with any git repository
    • 🔄 Stays in your conversation context

    Installation

    For Cursor Users

    Add the following configuration to your Cursor MCP settings (~/.cursor/mcp.json or %USERPROFILE%\.cursor\mcp.json on Windows):

    {
      "mcpServers": {
        "codex-reviewer": {
          "command": "npx",
          "args": ["-y", "codex-review-mcp@latest"],
          "env": {
            "OPENAI_API_KEY": "your-openai-api-key-here",
            "CODEX_MODEL": "gpt-5-codex",
            "WORKSPACE_ROOT": "${workspaceFolder}"
          }
        }
      }
    }

    Important: Replace your-openai-api-key-here with your actual OpenAI API key.

    For Claude Desktop Users

    Add to your Claude Desktop MCP configuration:

    {
      "mcpServers": {
        "codex-reviewer": {
          "command": "npx",
          "args": ["-y", "codex-review-mcp@latest"],
          "env": {
            "OPENAI_API_KEY": "your-openai-api-key-here",
            "CODEX_MODEL": "gpt-5-codex"
          }
        }
      }
    }

    Usage

    Once configured, just ask your AI assistant:

    "Do a code review with codex-reviewer"

    That's it! The MCP server automatically figures out what to review:

    • If you have uncommitted changes: Reviews your working tree vs HEAD (what you just coded)
    • If your working tree is clean: Reviews your current branch vs the default branch (main/master)
    • If you're on the default branch with no changes: Reports "No changes to review"

    Example conversation:

    You: "Add a login form with email validation"
    AI: [makes changes]
    AI: "Let me get a code review on this..."
    AI: [calls codex-reviewer MCP - automatically reviews uncommitted changes]
    AI: "The review found a potential issue with the email regex..."

    No need to specify what to review - it just works!

    Advanced Options (Optional)

    Most users won't need these, but they're available if you want more control:

    • target (default: "head"): What to review
      • "head": All uncommitted changes (default - what you just coded)
      • "staged": Only staged changes (git added files)
      • "range": Specific commit range (requires baseRef and headRef)
    • focus: Ask the reviewer to focus on something specific (e.g., "security issues")
    • paths: Review only specific files
    • baseRef / headRef: For reviewing commit ranges
    • maxTokens: Limit the length of the review
    • workspaceDir: Override auto-detection of repository location

    How It Works

    1. Detects Repository: Automatically finds your git repository root
    2. Collects Diff: Runs git diff to get the changes
    3. Gathers Context: Reads your .cursor/rules/, CODE_REVIEW.md, .eslintrc, and other project files
    4. AI Review: Sends to GPT-5 Codex with YOUR project's coding standards
    5. Returns Feedback: Provides actionable Markdown feedback that respects YOUR rules

    Requirements

    • Node.js 18+ (for running the MCP server)
    • Git repository
    • OpenAI API key with access to GPT-5 Codex
    • Cursor or Claude Desktop (or any MCP-compatible client)

    Environment Variables

    • OPENAI_API_KEY (required): Your OpenAI API key
    • CODEX_MODEL (optional, default: "gpt-5-codex"): The model to use for reviews
    • WORKSPACE_ROOT (optional): Path to your workspace (auto-detected in most cases)

    Development

    Local Development Setup

    # Clone the repository
    git clone <your-repo-url>
    cd codex-review-mcp
    
    # Install dependencies
    npm install
    
    # Build
    npm run build
    
    # For local testing, update your MCP config to point to the local build:
    {
      "codex-reviewer": {
        "command": "node",
        "args": ["/absolute/path/to/codex-review-mcp/dist/mcp-server.js"],
        "env": {
          "OPENAI_API_KEY": "your-key",
          "CODEX_MODEL": "gpt-5-codex",
          "WORKSPACE_ROOT": "${workspaceFolder}"
        }
      }
    }

    License

    MIT

    Contributing

    Contributions are welcome! Please open an issue or PR.