Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

@j0hanz/code-review-analyst-mcp

Package Overview
Dependencies
Maintainers
1
Versions
31
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install
Package was removed
Sorry, it seems this package was removed from the registry

@j0hanz/code-review-analyst-mcp

Gemini-powered MCP server for code review analysis.

latest
Source
npmnpm
Version
1.7.6
Version published
Maintainers
1
Created
Source

Code Review Analyst MCP Server

npm Node.js TypeScript MCP SDK License

Install in VS Code Install in VS Code Insiders Install in Visual Studio

Install in Cursor

Gemini-powered MCP server for pull request analysis with structured outputs for findings, release risk, and focused patch suggestions.

Overview

This server accepts unified diffs and returns structured JSON results — findings with severity, impact categories, merge risk, test plans, and verbatim search/replace fixes. It uses Gemini Thinking models (Flash for fast tools, Flash for deep analysis) and runs over stdio transport.

Key Features

  • Impact Analysis — Objective severity scoring, breaking change detection, and rollback complexity assessment.
  • Review Summary — Concise PR digest with merge recommendation and change statistics.
  • Deep Code Inspection — Flash model with high thinking level for context-aware analysis using full file contents.
  • Search & Replace Fixes — Verbatim, copy-paste-ready code fixes tied to specific findings.
  • Test Plan Generation — Systematic test case generation with priority ranking and pseudocode.
  • Async Task Support — All tools support MCP task lifecycle with progress notifications.

Requirements

  • Node.js >=24
  • One API key: GEMINI_API_KEY or GOOGLE_API_KEY
  • MCP client that supports stdio servers and tool calls

Quick Start

{
  "mcpServers": {
    "code-review-analyst": {
      "command": "npx",
      "args": ["-y", "@j0hanz/code-review-analyst-mcp@latest"],
      "env": {
        "GEMINI_API_KEY": "YOUR_API_KEY"
      }
    }
  }
}

Client Configuration

VS Code / VS Code Insiders

Install in VS Code Install in VS Code Insiders

Add to .vscode/mcp.json:

{
  "servers": {
    "code-review-analyst": {
      "command": "npx",
      "args": ["-y", "@j0hanz/code-review-analyst-mcp@latest"],
      "env": {
        "GEMINI_API_KEY": "YOUR_API_KEY"
      }
    }
  }
}

Or via CLI:

code --add-mcp '{"name":"code-review-analyst","command":"npx","args":["-y","@j0hanz/code-review-analyst-mcp@latest"]}'
Cursor

Install in Cursor

Add to ~/.cursor/mcp.json:

{
  "mcpServers": {
    "code-review-analyst": {
      "command": "npx",
      "args": ["-y", "@j0hanz/code-review-analyst-mcp@latest"],
      "env": {
        "GEMINI_API_KEY": "YOUR_API_KEY"
      }
    }
  }
}
Visual Studio

Install in Visual Studio

For more info, see Visual Studio MCP docs.

Claude Desktop

Add to claude_desktop_config.json:

{
  "mcpServers": {
    "code-review-analyst": {
      "command": "npx",
      "args": ["-y", "@j0hanz/code-review-analyst-mcp@latest"],
      "env": {
        "GEMINI_API_KEY": "YOUR_API_KEY"
      }
    }
  }
}

For more info, see Claude Desktop MCP docs.

Claude Code
claude mcp add code-review-analyst -- npx -y @j0hanz/code-review-analyst-mcp@latest

For more info, see Claude Code MCP docs.

Windsurf

Add to MCP config:

{
  "mcpServers": {
    "code-review-analyst": {
      "command": "npx",
      "args": ["-y", "@j0hanz/code-review-analyst-mcp@latest"],
      "env": {
        "GEMINI_API_KEY": "YOUR_API_KEY"
      }
    }
  }
}

For more info, see Windsurf MCP docs.

Amp
amp mcp add code-review-analyst -- npx -y @j0hanz/code-review-analyst-mcp@latest

For more info, see Amp MCP docs.

Cline

Add to cline_mcp_settings.json:

{
  "mcpServers": {
    "code-review-analyst": {
      "command": "npx",
      "args": ["-y", "@j0hanz/code-review-analyst-mcp@latest"],
      "env": {
        "GEMINI_API_KEY": "YOUR_API_KEY"
      }
    }
  }
}

For more info, see Cline MCP docs.

Zed

Add to Zed settings.json:

{
  "context_servers": {
    "code-review-analyst": {
      "command": {
        "path": "npx",
        "args": ["-y", "@j0hanz/code-review-analyst-mcp@latest"],
        "env": {
          "GEMINI_API_KEY": "YOUR_API_KEY"
        }
      }
    }
  }
}

For more info, see Zed MCP docs.

Augment

Add to settings.json:

{
  "augment.advanced": {
    "mcpServers": [
      {
        "name": "code-review-analyst",
        "command": "npx",
        "args": ["-y", "@j0hanz/code-review-analyst-mcp@latest"],
        "env": {
          "GEMINI_API_KEY": "YOUR_API_KEY"
        }
      }
    ]
  }
}
Docker
{
  "mcpServers": {
    "code-review-analyst": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "-e",
        "GEMINI_API_KEY=YOUR_API_KEY",
        "ghcr.io/j0hanz/code-review-analyst-mcp:latest"
      ]
    }
  }
}

Or build locally:

docker build -t code-review-analyst-mcp .

Tools

[!IMPORTANT] Call generate_diff first (mode: "unstaged" or "staged"). All review tools read the cached server-side diff (diff://current) and do not accept a direct diff parameter.

generate_diff

Generate and cache the current branch diff for downstream review tools.

ParameterTypeRequiredDescription
modestringYesunstaged (working tree) or staged (git index).

Returns: diffRef, stats (files, added, deleted), generatedAt, mode, message.

analyze_pr_impact

Assess the impact and risk of cached pull request changes using the Flash model.

ParameterTypeRequiredDescription
repositorystringYesRepository identifier (e.g. org/repo).
languagestringNoPrimary language hint.

Returns: severity (low/medium/high/critical), categories[], breakingChanges[], affectedAreas[], rollbackComplexity, summary.

generate_review_summary

Summarize a pull request diff and assess high-level risk using the Flash model.

ParameterTypeRequiredDescription
repositorystringYesRepository identifier (e.g. org/repo).
languagestringNoPrimary language hint.

Returns: summary, overallRisk (low/medium/high), keyChanges[], recommendation, stats (filesChanged, linesAdded, linesRemoved).

inspect_code_quality

Deep-dive code review using the Flash model with high thinking (16K token budget).

ParameterTypeRequiredDescription
repositorystringYesRepository identifier (e.g. org/repo).
languagestringNoPrimary language hint.
focusAreasstring[]NoAreas to inspect: security, correctness, etc.
maxFindingsnumberNoMaximum findings to return (1-25).

Returns: summary, overallRisk (low/medium/high/critical), findings[] (severity, file, line, title, explanation, recommendation), testsNeeded[], contextualInsights[].

[!NOTE] Diff size bounded by MAX_DIFF_CHARS (default 120,000). Expect 60-120s latency due to deep thinking.

suggest_search_replace

Generate verbatim search-and-replace blocks to fix a specific finding using the Flash model with high thinking.

ParameterTypeRequiredDescription
findingTitlestringYesShort title of the finding to fix.
findingDetailsstringYesDetailed explanation of the bug or risk.

Returns: summary, blocks[] (file, search, replace, explanation), validationChecklist[].

generate_test_plan

Create a test plan covering the changes in the diff using the Flash model with thinking (8K token budget).

ParameterTypeRequiredDescription
repositorystringYesRepository identifier (e.g. org/repo).
languagestringNoPrimary language hint.
testFrameworkstringNoTest framework (e.g. jest, vitest, pytest).
maxTestCasesnumberNoMaximum test cases to return (1-30).

Returns: summary, testCases[] (name, type, file, description, pseudoCode, priority), coverageSummary.

Resources

URITypeDescription
internal://instructionstext/markdownServer usage instructions.

Prompts

NameArgumentsDescription
get-helpReturn the server usage instructions.
review-guidetool, focusAreaGuided workflow for a specific tool and focus area.

Configuration

CLI Arguments

OptionDescriptionEnv Var Equivalent
--model, -mOverride default modelGEMINI_MODEL
--max-diff-charsOverride max diff sizeMAX_DIFF_CHARS

Environment Variables

VariableDescriptionDefaultRequired
GEMINI_API_KEYGemini API keyYes
GOOGLE_API_KEYAlternative API key (if GEMINI_API_KEY not set)No
GEMINI_MODELOverride default model selectionNo
GEMINI_HARM_BLOCK_THRESHOLDSafety threshold (BLOCK_NONE, BLOCK_ONLY_HIGH, etc.)BLOCK_NONENo
MAX_DIFF_CHARSMax chars for diff input120000No
MAX_CONCURRENT_CALLSMax concurrent Gemini requests10No
MAX_CONCURRENT_BATCH_CALLSMax concurrent inline batch requests2No
MAX_CONCURRENT_CALLS_WAIT_MSMax wait time for a free Gemini slot2000No
MAX_SCHEMA_RETRY_ERROR_CHARSMax chars from schema error injected into retry text1500No
GEMINI_BATCH_MODERequest mode for Gemini calls (off, inline)offNo
GEMINI_BATCH_POLL_INTERVAL_MSPoll interval for batch job status2000No
GEMINI_BATCH_TIMEOUT_MSMax wait for batch completion120000No

Models

ToolModelThinking Level
analyze_pr_impactgemini-3-flash-previewminimal
generate_review_summarygemini-3-flash-previewminimal
inspect_code_qualitygemini-3-flash-previewhigh
suggest_search_replacegemini-3-flash-previewhigh
generate_test_plangemini-3-flash-previewmedium

Workflows

Quick PR Triage

  • Call analyze_pr_impact to get severity and category breakdown.
  • If low/medium — call generate_review_summary for a quick digest.
  • If high/critical — proceed to deep inspection.

Deep Code Inspection

  • Call inspect_code_quality with the cached diff.
  • Use focusAreas to target specific concerns (security, performance).
  • Review findings and contextualInsights.

Remediation & Testing

  • For each finding, call suggest_search_replace with findingTitle and findingDetails.
  • Call generate_test_plan to create a verification strategy.
  • Apply fixes and implement tests.

Development

npm ci            # Install dependencies
npm run dev       # TypeScript watch mode
npm run dev:run   # Run built server with .env and --watch
ScriptCommandPurpose
npm run buildnode scripts/tasks.mjs buildClean, compile, validate, copy
npm testnode scripts/tasks.mjs testBuild + run all tests
npm run test:fastnode --test --import tsx/esm ...Run tests without build
npm run linteslint .Lint all files
npm run lint:fixeslint . --fixLint and auto-fix
npm run formatprettier --write .Format all files
npm run type-checknode scripts/tasks.mjs type-checkType-check without emitting
npm run inspectorBuild + launch MCP InspectorDebug with MCP Inspector

Debugging with MCP Inspector

npx @modelcontextprotocol/inspector node dist/index.js

Build & Release

Releases are triggered via GitHub Actions workflow_dispatch with version bump selection (patch/minor/major/custom).

The pipeline runs lint, type-check, test, and build, then publishes to three targets in parallel:

  • npm@j0hanz/code-review-analyst-mcp with OIDC trusted publishing and provenance
  • Dockerghcr.io/j0hanz/code-review-analyst-mcp (linux/amd64, linux/arm64)
  • MCP Registryio.github.j0hanz/code-review-analyst

Troubleshooting

IssueSolution
Missing GEMINI_API_KEY or GOOGLE_API_KEYSet one of the API key env vars in your MCP client config.
E_INPUT_TOO_LARGEDiff exceeds budget. Split into smaller diffs.
Gemini request timed outDeep analysis tasks may take 60-120s. Increase your client timeout.
Too many concurrent Gemini callsReduce parallel tool calls or increase MAX_CONCURRENT_CALLS.
No tool output visibleEnsure your MCP client is not swallowing stderr — the server uses stdio transport.

License

MIT

FAQs

Package last updated on 25 Feb 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts