Skip to main content
Glama

Critic-MCP — El Crítico Despiadado de Código

Un servidor de código abierto del Protocolo de Contexto de Modelo (MCP) que revisa — solo lectura — el código producido por otros asistentes de codificación de IA (Cursor, OpenCode, Cline, etc.).

Critic-MCP es un "segundo par de ojos": nunca arregla tu código, solo lo critica sin piedad. Expone una sola herramienta (review_code) y no tiene absolutamente ninguna capacidad de escritura de archivos.

¿Qué hace?

La herramienta review_code compara el código que envías con el requisito original (intención) y, a través de un LLM, produce un informe de revisión con las siguientes secciones:

  • Veredicto: APPROVED | MODIFICATION_REQUIRED | REJECTED

  • Requisitos Faltantes — la brecha entre la intención y el código

  • Hallazgos de Seguridad — Inyección SQL, XSS, escalada de privilegios, secretos codificados

  • Hallazgos de Casos Límite — entradas nulas/vacías, valores límite, error por uno, condiciones de carrera

  • Hallazgos de Rendimiento — consultas N+1, fugas de memoria, cómputo redundante

  • Otros Hallazgos + Elementos de Corrección Obligatoria (en orden de prioridad)

Related MCP server: codereview-mcp

Instalación — Dos Pasos

Requisito: Node.js >= 20

Paso 1: Autenticarse (una vez)

Ejecuta la configuración interactiva, que funciona igual que aws configure o gh auth login:

npx -y critic-mcp auth

Pregunta qué proveedor usas (gemini / openai / deepseek), solicita tu clave API y guarda ambas en ~/.critic-mcp.json en tu directorio de inicio (permisos 0600 en Unix).

Paso 2: Añadirlo a tu IDE

Añade solo esto a la configuración MCP de tu IDE:

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

Consulta la sección Integración con Asistentes de IA para detalles específicos del cliente. Eso es todo — tus claves ahora viven en un solo lugar, fuera de cada configuración del IDE.

Las claves nunca se escriben en las configuraciones del IDE. Cuando el servidor se inicia, primero busca en process.env, luego en ~/.critic-mcp.json; si no se encuentra una clave en ninguno, te dirige a npx critic-mcp auth.

Desarrollo local (instalar desde la fuente)

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

Comandos

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

Variables de Entorno (opcional)

Todas son opcionales; la ruta normal para las claves API es npx critic-mcp auth. Las variables de entorno siempre tienen prioridad sobre el archivo de configuración (para configuraciones de CI/servidor).

Variable

Descripción

CRITIC_PROVIDER

gemini, openai o deepseek (vuelve a la elección en ~/.critic-mcp.json, luego a gemini)

GEMINI_API_KEY

Clave de Gemini (anula el archivo cuando se establece)

OPENAI_API_KEY

Clave de OpenAI/DeepSeek (anula el archivo cuando se establece)

GEMINI_MODEL

Nombre del modelo Gemini (predeterminado: gemini-3.6-flash)

OPENAI_MODEL

Nombre del modelo (predeterminado: gpt-4o-mini, deepseek-chat para deepseek)

OPENAI_BASE_URL

URL base para DeepSeek, etc. (deepseek predeterminado a https://api.deepseek.com)

CRITIC_TIMEOUT_MS

Tiempo de espera de solicitud LLM (predeterminado: 120000)

CHUNK_SIZE

Límite de fragmentación (predeterminado: 30000 caracteres)

CRITIC_CONCURRENCY

Solicitudes paralelas durante la revisión fragmentada (predeterminado: 3)

CRITIC_CONFIG_PATH

Anula la ubicación del archivo de configuración (predeterminado: ~/.critic-mcp.json)

Integración con Asistentes de IA

Ninguna de las configuraciones a continuación lleva claves; te autenticas una vez a través del comando auth (Paso 1 arriba). npx requiere que el paquete esté publicado en npm; para un clon local puedes usar en su lugar "command": "node", "args": ["ABSOLUTE_PATH/dist/index.js"].

Cursor

En el archivo .cursor/mcp.json del proyecto (o el global ~/.cursor/mcp.json):

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

Alternativamente: Configuración → MCP → Añadir nuevo servidor MCP, luego pega el JSON.

OpenCode

En el archivo .opencode/opencode.json del proyecto o el global ~/.config/opencode/opencode.json:

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

OpenCode usa la clave mcp (no mcpServers) y el campo environment (no env); command debe ser un array. Ya no necesitas escribir claves en un bloque environment.

Cline (extensión de VS Code)

Abre el panel de Cline → pestaña MCP Servers → Editar MCP Global o Editar MCP del Proyecto, luego edita el JSON:

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

autoApprove permite que Cline ejecute review_code sin confirmación; es seguro porque la herramienta nunca escribe archivos.

Continue.dev

Añade el servidor MCP a ~/.continue/config.json (el transporte stdio es compatible independientemente de tu versión de Continue):

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

Escenario de Prueba Manual

examples/bad_code.js es un ejemplo de Express que contiene deliberadamente inyección SQL, XSS y consultas N+1; examples/intent.txt contiene el requisito original. Invócalo desde cualquier cliente de la siguiente manera:

"Revisa el código en examples/bad_code.js con la herramienta review_code. Requisito: examples/intent.txt"

Espera que el crítico detecte al menos lo siguiente:

  • CRÍTICO: db.query("SELECT * FROM users WHERE email = '" ...) — Inyección SQL

  • CRÍTICO: res.send(comment.body) — XSS almacenado

  • ALTO: Una consulta separada por usuario — problema N+1

Arquitectura

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)

Revisión fragmentada (map-reduce)

Cuando code_snippet excede CHUNK_SIZE (predeterminado 30,000 caracteres), el sistema cambia automáticamente a un flujo map-reduce:

  1. Mapa: El código se divide en los límites de línea; cada fragmento se envía al LLM de forma concurrente (predeterminado 3 solicitudes paralelas, configurable mediante CRITIC_CONCURRENCY). Un fallo de un solo fragmento nunca detiene toda la revisión.

  2. Reducción: Todos los análisis parciales devueltos se fusionan mediante el prompt "Sintetizador" — que nunca debilita los hallazgos y nunca devuelve APPROVED cuando una sola parte reporta CRÍTICO — en un informe final.

El servidor solo devuelve un informe de cadena; no tiene capacidad de escritura de archivos y nunca expone un cliente de red hacia afuera.

Licencia

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.

  1. 1 tool updatev1.0.0
    • First observedreview_code

TDQS

A4.3/5.0

Scored across 1 tool

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

ActivitySlowing
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers

  • A
    license
    A
    quality
    D
    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
    C
    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