PC

praneybehl/code-review-mcp

开发工具

本页由 AI 翻译,技术细节请以原文为准。 查看原文

34 stars 8 forks 质量 71 趋势 12MIT

一个使用 OpenAI 和 Google 模型用于 Claude 代码的代码审查 MCP 服务器

概览

一台MCP(模型上下文协议)服务器,提供强大的工具,用于使用各种大型语言模型(LLM)进行代码审查。该服务器设计为与Anthropic的Claude Code、Cursor、Windsurf或其他兼容MCP客户端等AI编码助手无缝集成。 该工具最初是为 Claude Code 创建的,但后来扩展支持其他 AI IDE 和 Claude Desktop。请参阅 Claude Code、Cursor 和 Windsurf 的集成指南。 它分析git diff输出中的分阶段变更、与HEAD的差异或分支间的差异,基于任务描述和项目细节提供上下文化的审查。 - 审核git差异(分阶段变更、当前HEAD、分支差异)。- 通过Vercel AI SDK与Google Gemini、OpenAI和Anthropic模型集成。- 允许指定任务描述、审核重点及整体项目背景,以实现定制化评审。- 以清晰、可操作的markdown格式输出评审。

概述(AI 翻译)

版本:1.0.0

一台MCP(模型上下文协议)服务器,提供强大的工具,用于使用各种大型语言模型(LLM)进行代码审查。该服务器设计为与Anthropic的Claude Code、Cursor、Windsurf或其他兼容MCP客户端等AI编码助手无缝集成。

注: 该工具最初为 Claude Code 创建,但后来扩展支持其他 AI IDE 和 Claude Desktop。请参阅 Claude Code、Cursor 和 Windsurf 的集成指南。

它分析git diff输出中的分阶段变更、与HEAD的差异或分支间的差异,基于任务描述和项目细节提供有上下文的审查。

特色

  • 审核git差异(分阶段变更、当前HEAD、分支差异)。
  • 通过Vercel AI SDK与Google Gemini、OpenAI和Anthropic模型集成。
  • 允许指定任务描述、评审重点及整体项目背景,以实现定制化评审。
  • 以清晰、可操作的降价格式输出评审。
  • 设计为从你希望分析的任何 Git 仓库根节点运行。
  • 通过npx轻松安装和运行,便于立即使用。

本页由 AI 翻译,技术细节请以原文为准。

README

以下为原文 README 节选,完整内容请查看原文。

@vibesnipe/code-review-mcp

Version: 1.0.0

An MCP (Model Context Protocol) server that provides a powerful tool to perform code reviews using various Large Language Models (LLMs). This server is designed to be seamlessly integrated with AI coding assistants like Anthropic’s Claude Code, Cursor, Windsurf, or other MCP-compatible clients.

Note: This tool was initially created for Claude Code but has since been expanded to support other AI IDEs and Claude Desktop. See the integration guides for Claude Code, Cursor, and Windsurf.

It analyzes git diff output for staged changes, differences from HEAD, or differences between branches, providing contextualized reviews based on your task description and project details.

Features

  • Reviews git diffs (staged changes, current HEAD, branch differences).
  • Integrates with Google Gemini, OpenAI, and Anthropic models through the Vercel AI SDK.
  • Allows specification of task description, review focus, and overall project context for tailored reviews.
  • Outputs reviews in clear, actionable markdown format.
  • Designed to be run from the root of any Git repository you wish to analyze.
  • Easily installable and runnable via npx for immediate use.

Compatibility

  • Node.js: Version 18 or higher is required.
  • Operating Systems: Works on Windows, macOS, and Linux.
  • Git: Version 2.20.0 or higher recommended.

Prerequisites

  • Node.js: Version 18 or higher is required.
  • Git: Must be installed and accessible in your system’s PATH. The server executes git commands.
  • API Keys for LLMs: You need API keys for the LLM providers you intend to use. These should be set as environment variables:
    • GOOGLE_API_KEY for Google models.
    • OPENAI_API_KEY for OpenAI models.
    • ANTHROPIC_API_KEY for Anthropic models. These can be set globally in your environment or, conveniently, in a .env file placed in the root of the project you are currently reviewing. The server will automatically try to load it.

Installation & Usage

The primary way to use this server is with npx, which ensures you’re always using the latest version without needing a global installation.

Recommended: Using with npx

  1. Navigate to Your Project: Open your terminal and change to the root directory of the Git repository you want to review.

    cd /path/to/your-git-project
    
  2. Run the MCP Server: Execute the following command:

    npx -y @vibesnipe/code-review-mcp
    

    This command will download (if not already cached) and run the @vibesnipe/code-review-mcp server. You should see output in your terminal similar to: [MCP Server] Code Reviewer MCP Server is running via stdio and connected to transport.

在 GitHub 查看完整 README

安装

npx -y @vibesnipe/code-review-mcp
新手?先看 mcpskill.org 教程 →