Code Review Analyst MCP Server

Gemini-powered MCP server for code review analysis.

Local serverstdio

What is the Code Review Analyst MCP server?

Code Review Analyst MCP server exists for a simple reason — assistants are far more useful when they can act on Code Review Analyst directly instead of describing what you should do. Gemini-powered MCP server for code review analysis.

What you get

Code Lens is a Model Context Protocol server that uses Google Gemini to analyze diffs, review pull requests, detect code smells, generate documentation, and verify logic. It exposes 13 tools, 7 resources, and 5 prompts over stdio transport.

  • PR review pipeline — — generate diffs, assess impact, detect breaking API changes, and produce review summaries with merge recommendations
  • File analysis — — load any source file for refactoring suggestions, code smell detection, documentation generation, and natural-language Q&A
  • Logic verification — — verify algorithms using Gemini's code execution sandbox
  • Structured outputs — — all tools return validated JSON via Zod v4 output schemas
  • Web search — — Google Search with Grounding for up-to-date information retrieval
  • Task lifecycle support — — every tool except load_file can run via MCP tasks with polling, cancellation, and progress updates

What the assistant can call

Once Code Review Analyst is connected, these are the calls the assistant has available:

  • generate_diff — Capture git diff (unstaged/staged) and cache server-side
  • analyze_pr_impact — Assess severity, categories, breaking changes, rollback complexity
  • generate_review_summary — PR summary, risk rating, merge recommendation
  • generate_test_plan — Prioritized test cases and coverage guidance
  • analyze_time_space_complexity — Big-O complexity analysis and degradation detection
  • detect_api_breaking_changes — Detect breaking API/interface changes
  • load_file — Cache a source file for analysis tools
  • refactor_code — Complexity, duplication, naming, grouping suggestions
  • detect_code_smells — Structural code smells (Fowler taxonomy)
  • generate_documentation — JSDoc/TSDoc/docstring stubs for public exports
  • ask_about_code — Natural-language Q&A about a cached file
  • verify_logic — Verify algorithms via Gemini code execution sandbox

Configuration and credentials

You will need 2 environment variables: GEMINI_API_KEY, GOOGLE_API_KEY. The server will not start without them, which is usually why the tools fail to appear on a first run. Keep credentials in your client's env block or a secrets manager rather than in a file you might commit.

Setting it up

@j0hanz/code-lens-mcp on npm is all you need. Most clients run it directly, so configuration is a few lines and a restart.

Choosing this one

Plenty of developer tooling servers cover similar ground. The differences that matter in practice are scope of access and how much setup stands between you and a working tool call. Code Review Analyst's toolset — generate_diff, analyze_pr_impact, generate_review_summary and 11 more — is a fair guide to whether it matches your workflow. It is maintained by j0hanz; worth a glance at recent repository activity before you build anything load-bearing on it.

We check each listing at SyncDev against the project's documentation before it goes live — if something here drifts out of date, it is a bug worth reporting.

Before you rely on it

  • It runs with your machine's permissions. That is convenient and also the reason to think about what you point it at before you approve a tool call.
  • With 14 tools registered it takes up a noticeable share of the context window; turn it off in projects that never touch Code Review Analyst.
  • Missing credentials fail quietly in some clients — if no tools show up, check the environment block first.
  • MCP clients confirm each tool call by default. Leave that on until you have watched what the code review analyst mcp server does with a few real requests.

Available tools

ToolWhat it does
generate_diffCapture git diff (unstaged/staged) and cache server-side
analyze_pr_impactAssess severity, categories, breaking changes, rollback complexity
generate_review_summaryPR summary, risk rating, merge recommendation
generate_test_planPrioritized test cases and coverage guidance
analyze_time_space_complexityBig-O complexity analysis and degradation detection
detect_api_breaking_changesDetect breaking API/interface changes
load_fileCache a source file for analysis tools
refactor_codeComplexity, duplication, naming, grouping suggestions
detect_code_smellsStructural code smells (Fowler taxonomy)
generate_documentationJSDoc/TSDoc/docstring stubs for public exports
ask_about_codeNatural-language Q&A about a cached file
verify_logicVerify algorithms via Gemini code execution sandbox
web_searchGoogle Search with Grounding
ResearchThe Research tool exposed by this server.

How to install the Code Review Analyst MCP server

{
  "mcpServers": {
    "code-lens": {
      "command": "npx",
      "args": ["-y", "@j0hanz/code-lens-mcp@latest"],
      "env": {
        "GEMINI_API_KEY": "your-api-key"
      }
    }
  }
}

Configuration as documented by the project. Restart the client after saving.

Configuration

VariableDescriptionRequired
GEMINI_API_KEYCredential the server authenticates with.Yes
GOOGLE_API_KEYCredential the server authenticates with.Yes

Example prompts to try

  • Use Code Review Analyst to generate diff.
  • Use Code Review Analyst to analyze pr impact.
  • Use Code Review Analyst to generate review summary.

Frequently asked questions

It connects Code Review Analyst to MCP-compatible AI assistants such as Claude and Cursor, exposing 14 tools (generate_diff, analyze_pr_impact, generate_review_summary, and more) that the assistant can call on your behalf. Instead of copying data back and forth by hand, the assistant works with Code Review Analyst directly.