Labsco
shaunie2fly logo

ndlovu-code-reviewer

β˜… 2

from shaunie2fly

Manual code reviews are time-consuming and often miss the opportunity to combine static analysis with contextual, human-friendly feedback. This project was created to experiment with MCP tooling that gives AI assistants access to a purpose-built reviewer. Uses the Gemini cli application to process the reviews at this time and linting only for typescript/javascript apps at the moment. Will add API based calls to LLM's in the future and expand linting abilities. It's also cheaper than using coderabbit ;)

πŸ”₯πŸ”₯βœ“ VerifiedFreeAdvanced setup

Code Review MCP Server logo

Code Review MCP Server

A Gemini-CLI (for now), powered code review assistant that runs as a Model Context Protocol (MCP) server.

Why this project exists

Manual code reviews are time-consuming and often miss the opportunity to combine static analysis with contextual, human-friendly feedback. This project was created to experiment with MCP tooling that gives AI assistants access to a purpose-built reviewer:

  • Automates the busywork of gathering diffs and lint results from local, uncommitted changes.
  • Streams that context into the Gemini CLI so the model can focus on actionable insights.
  • Returns a structured JSON review that fits naturally into MCP-compatible clients.

What it does

  • Connects to MCP clients over stdio using the official @modelcontextprotocol/sdk.
  • Runs a "hybrid" review workflow that gathers git diff output and linter findings.
  • Falls back between ESLint, JSHint, and TypeScript to maximise coverage across projects.
  • Safely invokes the Gemini CLI, handling long prompts and timeouts.
  • Ships as TypeScript with Zod-backed types for predictable MCP responses.

Connect from MCP clients

Before wiring the server into any client, make sure you have run npm run build so dist/index.js exists. The commands below assume you execute the client from the repository root so the server can read your git workspace.

Claude Code (VS Code extension)

  1. In VS Code, open the command palette (Cmd/Ctrl+Shift+P) and run Claude: Edit Config File.

  2. Locate the mcpServers section (create it if needed) and add an entry similar to:

    {
      "mcpServers": {
        "ndlovu-code-reviewer": {
          "command": "node",
          "args": ["/absolute/path/to/ndlovu-code-reviewer/dist/index.js"],
          "cwd": "/absolute/path/to/ndlovu-code-reviewer"
        }
      }
    }
  3. Save the file and run Claude: Restart Claude Code (or reload VS Code) so the server appears under Tools.

  4. Enable the tool for a conversation; Claude Code will stream review-local-changes results directly in the sidebar.

Gemini CLI

  1. From the project root run:

    gemini mcp add ndlovu-code-reviewer node $(pwd)/dist/index.js
  2. Verify the registration with gemini mcp list.

  3. Launch gemini from the same repository directory and use the review-local-changes tool (e.g., run :tools in the CLI and select it). The CLI spawns the server and forwards stdout back as the review JSON.

Roo Code

  1. Open Roo Code and click the server icon in the top of the Roo panel.

  2. Choose Add MCP Server β†’ STDIO and fill in:

    • Name: ndlovu-code-reviewer
    • Command: node
    • Arguments: /absolute/path/to/ndlovu-code-reviewer/dist/index.js
    • Working Directory: /absolute/path/to/ndlovu-code-reviewer
  3. Save the configuration and enable the server for your workspace. Roo stores it in either the global mcp_settings.json or the project .roo/mcp.json file.

  4. To share with teammates, commit a .roo/mcp.json that contains your preferred launch command, for example:

    {
      "mcpServers": {
        "ndlovu-code-reviewer": {
          "command": "npm",
          "args": ["run", "start"],
          "cwd": "."
        }
      }
    }

    Roo resolves the working directory relative to the project root, so the npm run start script builds on the repository’s own package scripts.

Codex CLI

  1. Register the server once:

    codex mcp add ndlovu-code-reviewer node $(pwd)/dist/index.js
  2. Use codex mcp list to confirm the entry, then start Codex from the repository root. The CLI exposes review-local-changes as a tool you can call inside interactive runs.