
Security News
pnpm 11.5 Adds Support for Recognizing npm Staged Publishes
pnpm 11.5 now recognizes npm staged publish approvals in release metadata, preventing those releases from being mistaken for lower-trust package publishes.
code-review-analyst-mcp
Advanced tools
Gemini-powered MCP server for pull request analysis with structured outputs for findings, release risk, and focused patch suggestions.
This server runs over stdio transport and exposes three review-focused tools: review_diff, risk_score, and suggest_patch. It also publishes an internal://instructions resource and a get-help prompt for in-client guidance.
ok, result, error).MAX_DIFF_CHARS, default 120000).execution.taskSupport: "optional") with in-memory task store._meta.progressToken.stderr.>=24GEMINI_API_KEY or GOOGLE_API_KEYStandard config for most MCP clients:
{
"mcpServers": {
"code-review-analyst": {
"command": "npx",
"args": ["-y", "code-review-analyst-mcp@latest"],
"env": {
"GEMINI_API_KEY": "YOUR_API_KEY"
}
}
}
}
[!TIP] For local development, build and run directly via
node dist/index.jsafternpm run build.
.vscode/mcp.json
{
"servers": {
"code-review-analyst": {
"command": "npx",
"args": ["-y", "code-review-analyst-mcp@latest"],
"env": {
"GEMINI_API_KEY": "YOUR_API_KEY"
}
}
}
}
CLI install:
code --add-mcp '{"name":"code-review-analyst","command":"npx","args":["-y","code-review-analyst-mcp@latest"]}'
~/.cursor/mcp.json
{
"mcpServers": {
"code-review-analyst": {
"command": "npx",
"args": ["-y", "code-review-analyst-mcp@latest"],
"env": {
"GEMINI_API_KEY": "YOUR_API_KEY"
}
}
}
}
claude_desktop_config.json
{
"mcpServers": {
"code-review-analyst": {
"command": "npx",
"args": ["-y", "code-review-analyst-mcp@latest"],
"env": {
"GEMINI_API_KEY": "YOUR_API_KEY"
}
}
}
}
claude mcp add code-review-analyst -- npx -y code-review-analyst-mcp@latest
review_diffAnalyze a unified diff and return structured findings, overall merge risk, and test recommendations.
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
diff | string | Yes | — | Unified diff text (10..400000 chars schema limit). |
repository | string | Yes | — | Repository identifier (example: org/repo). |
language | string | No | not specified | Primary language hint for analysis. |
focusAreas | string[] | No | security, correctness, regressions, performance | Optional review priorities (1..12 items). |
maxFindings | integer | No | 10 | Max findings returned (1..25). |
Returns (inside result):
summary, overallRisk (low|medium|high), findings[], testsNeeded[]Example:
{
"ok": true,
"result": {
"summary": "One high-risk auth-path change without null guards.",
"overallRisk": "high",
"findings": [
{
"severity": "high",
"file": "src/auth.ts",
"line": 42,
"title": "Missing null check",
"explanation": "Null response can throw and break login.",
"recommendation": "Guard for null before property access."
}
],
"testsNeeded": ["Add auth null-path regression test"]
}
}
risk_scoreScore deployment risk for a diff and explain the score drivers.
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
diff | string | Yes | — | Unified diff text (10..400000 chars schema limit). |
deploymentCriticality | "low" | "medium" | "high" | No | medium | Sensitivity of target deployment. |
Returns (inside result):
score (0..100), bucket (low|medium|high|critical), rationale[]suggest_patchGenerate a focused unified-diff patch for one selected finding.
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
diff | string | Yes | — | Unified diff text containing the issue context. |
findingTitle | string | Yes | — | Short finding title (3..160 chars). |
findingDetails | string | Yes | — | Detailed finding explanation (10..3000 chars). |
patchStyle | "minimal" | "balanced" | "defensive" | No | balanced | Desired patch breadth. |
Returns (inside result):
summary, patch (unified diff text), validationChecklist[]| URI | Name | MIME Type | Description |
|---|---|---|---|
internal://instructions | server-instructions | text/markdown | In-repo usage guide for tools and workflows. |
| Name | Description | Arguments |
|---|---|---|
get-help | Returns server usage instructions. | None |
capabilities.tasks with tool-call task support.execution.taskSupport: "optional".notifications/progress when _meta.progressToken is provided.InMemoryTaskStore).| Mode | Supported | Notes |
|---|---|---|
stdio | Yes | Active transport in src/index.ts. |
| HTTP/SSE/Streamable HTTP | No | Not implemented in current entrypoint. |
| Variable | Description | Default | Required |
|---|---|---|---|
GEMINI_API_KEY | Gemini API key (preferred) | — | One of GEMINI_API_KEY or GOOGLE_API_KEY |
GOOGLE_API_KEY | Alternate Gemini API key env | — | One of GEMINI_API_KEY or GOOGLE_API_KEY |
GEMINI_MODEL | Gemini model id | gemini-2.5-flash | No |
GEMINI_HARM_BLOCK_THRESHOLD | Safety threshold (BLOCK_NONE, BLOCK_ONLY_HIGH, BLOCK_MEDIUM_AND_ABOVE, BLOCK_LOW_AND_ABOVE) | BLOCK_NONE | No |
MAX_DIFF_CHARS | Runtime diff-size budget | 120000 | No |
TASK_TIMEOUT_MS | Task-runner timeout for build/test scripts | unset | No |
stderr; avoid writing non-protocol output to stdout in stdio mode.z.strictObject) with explicit bounds.E_INPUT_TOO_LARGE.readOnlyHint: true and openWorldHint: true (external model call, no local state mutation).Install and run locally:
npm install
npm run build
npm start
Useful scripts:
| Script | Command | Purpose |
|---|---|---|
build | node scripts/tasks.mjs build | Clean, compile, validate instructions, copy assets, set executable bit. |
dev | tsc --watch --preserveWatchOutput | TypeScript watch mode. |
dev:run | node --env-file=.env --watch dist/index.js | Run built server with watch and .env. |
test | node scripts/tasks.mjs test | Full build + Node test runner. |
test:fast | node --test --import tsx/esm ... | Fast test path on TS sources. |
type-check | node scripts/tasks.mjs type-check | TypeScript no-emit checks. |
lint | eslint . | ESLint checks. |
format | prettier --write . | Prettier formatting. |
inspector | npm run build && npx -y @modelcontextprotocol/inspector node dist/index.js ${workspaceFolder} | MCP Inspector for stdio server. |
Inspector examples:
# stdio
npx @modelcontextprotocol/inspector node dist/index.js
E_INPUT_TOO_LARGE: split diff into smaller chunks, then rerun.E_REVIEW_DIFF / E_RISK_SCORE / E_SUGGEST_PATCH: verify API key env vars and retry with narrower input.Gemini request timed out after ...ms.: reduce diff/prompt size or increase timeout in caller.Gemini returned an empty response body.: retry and check upstream model health.package.json).FAQs
Gemini-powered MCP server for code review analysis.
We found that code-review-analyst-mcp demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

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.

Security News
pnpm 11.5 now recognizes npm staged publish approvals in release metadata, preventing those releases from being mistaken for lower-trust package publishes.

Security News
Federal audit finds NIST lacked a plan to clear the NVD backlog, wasted funds on duplicate work, and delayed use of CISA data.

Research
/Security News
A mini Shai-Hulud campaign compromised Red Hat Cloud Services npm packages to steal developer and CI/CD secrets during installation.