Skip to main content
Glama

Critic-MCP — The Ruthless Code Critic

An open-source Model Context Protocol (MCP) server that reviews — read-only — the code produced by other AI coding assistants (Cursor, OpenCode, Cline, etc.).

Critic-MCP is a "second pair of eyes": it never fixes your code, it only critiques it without mercy. It exposes a single tool (review_code) and has absolutely no file-write capability.

What does it do?

The review_code tool compares the code you send against the original requirement (intent) and, through an LLM, produces a review report with the following sections:

  • Verdict: APPROVED | MODIFICATION_REQUIRED | REJECTED

  • Missing Requirements — the gap between intent and code

  • Security Findings — SQL injection, XSS, privilege escalation, hardcoded secrets

  • Edge-Case Findings — null/empty inputs, boundary values, off-by-one, race conditions

  • Performance Findings — N+1 queries, memory leaks, redundant computation

  • Other Findings + Must-Fix Items (in priority order)

Related MCP server: codereview-mcp

Installation — Two Steps

Requirement: Node.js >= 20

Step 1: Authenticate (one time)

Run the interactive setup, which works just like aws configure or gh auth login:

npx -y critic-mcp auth

It asks which provider you use (gemini / openai / deepseek), prompts for your API key, and saves both to ~/.critic-mcp.json in your home directory (0600 permissions on Unix).

Step 2: Add it to your IDE

Add only this to your IDE's MCP settings:

{ "command": "npx", "args": ["-y", "critic-mcp"] }

See the AI Assistant Integration section for client-specific details. That's it — your keys now live in one place, outside every IDE configuration.

Keys are never written into IDE configs. When the server starts it looks at process.env first, then at ~/.critic-mcp.json; if a key is found in neither, it directs you to npx critic-mcp auth.

Local development (install from source)

git clone https://github.com/layermedya/Critic-MCP.git
cd Critic-MCP
npm ci
npm run build
node dist/index.js auth   # authenticate against your own build

Commands

npm run build       # TypeScript compilation
npm run typecheck   # Type checking
npm test            # Vitest unit tests
npm run test:watch  # Tests in watch mode
npm start           # Start the server on stdio
npm run inspect     # Manual testing in the browser via MCP Inspector

Environment Variables (optional)

All of these are optional; the normal path for API keys is npx critic-mcp auth. Environment variables always take precedence over the config file (for CI/server setups).

Variable

Description

CRITIC_PROVIDER

gemini, openai or deepseek (falls back to the choice in ~/.critic-mcp.json, then to gemini)

GEMINI_API_KEY

Gemini key (overrides the file when set)

OPENAI_API_KEY

OpenAI/DeepSeek key (overrides the file when set)

GEMINI_MODEL

Gemini model name (default: gemini-3.6-flash)

OPENAI_MODEL

Model name (default: gpt-4o-mini, deepseek-chat for deepseek)

OPENAI_BASE_URL

Base URL for DeepSeek etc. (deepseek defaults to https://api.deepseek.com)

CRITIC_TIMEOUT_MS

LLM request timeout (default: 120000)

CHUNK_SIZE

Chunking limit (default: 30000 characters)

CRITIC_CONCURRENCY

Parallel requests during chunked review (default: 3)

CRITIC_CONFIG_PATH

Overrides the config file location (default: ~/.critic-mcp.json)

AI Assistant Integration

None of the configurations below carry any keys; you authenticate once via the auth command (Step 1 above). npx requires the package to be published on npm; for a local clone you can instead use "command": "node", "args": ["ABSOLUTE_PATH/dist/index.js"].

Cursor

In the project-level .cursor/mcp.json (or the global ~/.cursor/mcp.json):

{
  "mcpServers": {
    "critic": {
      "command": "npx",
      "args": ["-y", "critic-mcp"]
    }
  }
}

Alternatively: Settings → MCP → Add new MCP server, then paste the JSON.

OpenCode

In the project-level .opencode/opencode.json or the global ~/.config/opencode/opencode.json:

{
  "mcp": {
    "critic": {
      "type": "local",
      "command": ["npx", "-y", "critic-mcp"],
      "enabled": true
    }
  }
}

OpenCode uses the mcp key (not mcpServers) and the environment field (not env); command must be an array. You no longer need to write keys into an environment block.

Cline (VS Code extension)

Open the Cline panel → MCP Servers tab → Edit Global MCP or Edit Project MCP, then edit the JSON:

{
  "mcpServers": {
    "critic": {
      "command": "npx",
      "args": ["-y", "critic-mcp"],
      "disabled": false,
      "autoApprove": ["review_code"]
    }
  }
}

autoApprove lets Cline run review_code without confirmation; it is safe because the tool never writes files.

Continue.dev

Add the MCP server to ~/.continue/config.json (stdio transport is supported regardless of your Continue version):

{
  "experimental": {
    "modelContextProtocolServers": [
      {
        "transport": {
          "type": "stdio",
          "command": "npx",
          "args": ["-y", "critic-mcp"]
        }
      }
    ]
  }
}

Manual Test Scenario

examples/bad_code.js is an Express example that deliberately contains SQL injection, XSS, and N+1 queries; examples/intent.txt holds the original requirement. Invoke it from any client as follows:

"Review the code in examples/bad_code.js with the review_code tool. Requirement: examples/intent.txt"

Expect the critic to catch at least the following:

  • CRITICAL: db.query("SELECT * FROM users WHERE email = '" ...) — SQL injection

  • CRITICAL: res.send(comment.body) — stored XSS

  • HIGH: A separate query per user — N+1 problem

Architecture

src/index.ts   -> MCP server, zod validation, error handling + `auth` argv routing
src/cli.ts     -> Interactive authentication flow (`critic-mcp auth`)
src/config.ts  -> Global config (~/.critic-mcp.json) + credential resolution (env → file)
src/prompt.ts  -> Ruthless Critic system prompt + chunked-review prompts
src/llm.ts     -> Provider layer + timeout protection + map-reduce orchestration
src/chunker.ts -> Line-ending based chunking (for code above the limit)

Chunked review (map-reduce)

When code_snippet exceeds CHUNK_SIZE (default 30,000 characters), the system automatically switches to a map-reduce flow:

  1. Map: The code is split at line boundaries; every chunk is sent to the LLM concurrently (default 3 parallel requests, configurable via CRITIC_CONCURRENCY). A single chunk failure never halts the whole review.

  2. Reduce: All returned partial analyses are merged by the "Synthesizer" prompt — which never weakens findings and never returns APPROVED when a single part reports CRITICAL — into one final report.

The server only returns a string report; it carries no file-write capability and never exposes a network client outward.

License

MIT

Available Tools

1 tool
review_codeA

Read-only code critic. Analyzes the provided code snippet against its stated intent and returns a detailed, ruthless review report: missing requirements, security vulnerabilities (SQLi, XSS, privilege escalation), edge cases and performance issues (N+1, memory leaks). Never writes files — returns the report as text only.

ParametersJSON Schema
NameRequiredDescriptionDefault
intentYes
code_snippetYes

TDQS

A4.6/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Since no annotations are provided, the description must fully disclose behavioral traits. It does so clearly: never writes files, returns only a text report, and performs a ruthless review. It also lists specific vulnerability categories checked (SQLi, XSS, privilege escalation) and performance issues (N+1, memory leaks).

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is two sentences long, front-loaded with the core purpose ('Read-only code critic'). Every phrase adds value — no filler. The first sentence establishes scope, the second disclaims side effects and clarifies output format.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool has only 2 parameters, no output schema, and no annotations, the description fairly covers the inputs, behavior, and output. An agent should be able to invoke it correctly. A minor gap: the description doesn't mention the output format structure (e.g., bullet points vs. paragraphs), but this is acceptable for a complex, free-text report.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate. The description explains the purpose of the two parameters implicitly: 'code snippet' and 'its stated intent' map directly to code_snippet and intent. It does not detail their types or constraints, but the schema already provides min/max lengths and types.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description uses a clear verb-resource pair ('Analyzes the provided code snippet') and immediately states it is read-only. It lists specific review categories (missing requirements, security vulnerabilities, edge cases, performance issues), leaving no ambiguity about what the tool does.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description explicitly states the tool is 'Read-only' and 'Never writes files', which guides when to use it (analysis without side effects). However, it does not mention when not to use it or provide alternatives, though sibling tools are absent, so there is no need for exclusion.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. 1 tool updatev1.0.0
    • First observedreview_code

TDQS

A4.3/5.0
Disambiguation5/5

With only one tool, there is no possibility of confusion between tools. The single tool's purpose is clearly defined in great detail.

Naming Consistency5/5

Naming consistency is not applicable as a concept with a single tool. It cannot be penalized and defaults to the highest score.

Tool Count2/5

A single tool severely limits the server's functionality. While the tool is comprehensive, it would benefit from being broken down into more focused tools (e.g., review_security, review_performance).

Completeness2/5

The server covers only the 'review' aspect. For a code review tool, this is acceptable, but it lacks any supporting tools for follow-up actions like re-review, fetching additional context, or managing review sessions.

Maintenance

ActivityMaintained
ResponsivenessNo issues

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

  • A
    license
    A
    quality
    B
    maintenance
    An MCP server that provides local code quality analysis for AI coding assistants, supporting file analysis, git diff review, and full project scanning with quality scoring.
    4
    3
    MIT
  • A
    license
    A
    quality
    B
    maintenance
    An MCP server that lets AI agents review code using language models, supporting git diffs, files, and snippets with severity levels. Works with Ollama (local) and hosted providers like OpenAI, Anthropic, and OpenRouter.
    3
    MIT

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/layermedya/Critic-MCP'

If you have feedback or need assistance with the MCP directory API, please join our Discord server