Ndlovu Code Reviewer

Ndlovu Code Reviewer

Enables AI assistants to perform comprehensive code reviews of local uncommitted changes by combining git diffs with static analysis from linters like ESLint and TypeScript. Returns structured JSON feedback with findings, suggestions, and quality assessments powered by Google's Gemini CLI.

Category
访问服务器

README

zread <p align="center"> <img src="assets/codendlovulogo.png" alt="Code Review MCP Server logo" width="160"> </p>

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.

Requirements

  • Node.js 18 or later (ES modules and AbortSignals are used throughout).
  • npm (installed with Node.js).
  • Git (used to collect local diffs).
  • Google Gemini CLI (gemini) installed and authenticated. See the Gemini quickstart for setup instructions.

Installation

git clone https://github.com/<your-org>/ndlovu-code-reviewer.git
cd ndlovu-code-reviewer
npm install
npm run build

If you plan to iterate on the TypeScript source, you can skip npm run build and rely on the dev script described below.

Usage

Start the MCP server

npm start

The server communicates over stdio, so it is ready to be registered with any MCP-compatible client (e.g. IDE integrations or assistant sandboxes). Once connected, call the review-local-changes tool to trigger the hybrid analysis and receive the JSON review.

How to call the MCP tool

The server exposes a single tool called review-local-changes that performs comprehensive analysis of your local, uncommitted code changes.

Prerequisites:

  • You must have uncommitted changes in your git repository
  • Changed files should be JavaScript, TypeScript, or Vue files (.js, .ts, .tsx, .vue)
  • The Gemini CLI must be installed and authenticated

Using the tool:

Once your MCP client is connected to the server, you can call the review-local-changes tool. The tool:

  1. Automatically detects changes - Finds all modified/added JS/TS/Vue files using git diff
  2. Runs static analysis - Executes the best available linter (ESLint, JSHint, or TypeScript compiler)
  3. Performs AI review - Sends the combined context to Gemini CLI for intelligent analysis
  4. Returns structured results - Provides a JSON response with findings and recommendations

How to use it with Claude Code:

For best results, be explicit about using the code review functionality. While natural language requests sometimes work, the most reliable approach is to use specific keywords:

Most reliable requests (recommended):

  • "Use the code review tool to analyze my changes"
  • "Run code review on my local changes"
  • "Perform a comprehensive code review of my uncommitted changes"
  • "Analyze my code changes with static analysis"

Natural language requests (may work but less reliable):

  • "Please review my local changes"
  • "Can you analyze the code changes I've made?"

Explicit tool invocation (most reliable):

  • "Use the review-local-changes tool"
  • "Call the review-local-changes tool to check my modifications"

The tool has been enhanced with better descriptions to help Claude recognize when to use it, but being specific about "code review," "analyze changes," or mentioning the tool name directly will give you the most consistent results.

Example output format:

{
  "summary": "Overview of changes made",
  "assessment": "Overall code quality evaluation",
  "findings": [
    {
      "filePath": "src/example.js",
      "lineNumber": 42,
      "severity": "warning",
      "category": "style",
      "comment": "Detailed explanation of the issue",
      "suggestion": "Specific recommendation for improvement"
    }
  ]
}

Note: If no relevant files have been changed, the tool will return a "No relevant files changed" message, which is normal behavior.

Local development

  • npm run dev – Launches the server with ts-node for rapid iteration.
  • npm run build – Produces the compiled JavaScript output in dist/.

The project structure is intentionally small:

  • src/ – TypeScript source for the MCP server.
  • dist/ – Compiled JavaScript created by npm run build.
  • assets/ – Static assets, including the logo used above.

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.

Contributing

Contributions are very welcome. If you have ideas for new tools, better linters, or improved prompts:

  1. Open an issue or discussion so we can align on scope.
  2. Fork the repository and create a feature branch.
  3. Add or update documentation/tests where it helps future contributors.
  4. Submit a pull request describing the change and how you validated it.

If you're unsure where to start, feel free to reach out—there is plenty of room to expand the reviewer’s capabilities, add client examples, and tighten the prompts.

License

This project is licensed under the ISC License. See LICENSE (if present) for details.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选