Critic-MCP
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|REJECTEDRequisitos 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 authPregunta 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 anpx 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 buildComandos
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 InspectorVariables 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 |
|
|
| Clave de Gemini (anula el archivo cuando se establece) |
| Clave de OpenAI/DeepSeek (anula el archivo cuando se establece) |
| Nombre del modelo Gemini (predeterminado: |
| Nombre del modelo (predeterminado: |
| URL base para DeepSeek, etc. (deepseek predeterminado a |
| Tiempo de espera de solicitud LLM (predeterminado: |
| Límite de fragmentación (predeterminado: |
| Solicitudes paralelas durante la revisión fragmentada (predeterminado: |
| Anula la ubicación del archivo de configuración (predeterminado: |
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(nomcpServers) y el campoenvironment(noenv);commanddebe ser un array. Ya no necesitas escribir claves en un bloqueenvironment.
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"]
}
}
}
autoApprovepermite que Cline ejecutereview_codesin 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 SQLCRÍTICO:
res.send(comment.body)— XSS almacenadoALTO: 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:
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.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 toolreview_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.
| Name | Required | Description | Default |
|---|---|---|---|
| intent | Yes | ||
| code_snippet | Yes |
TDQS
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.
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.
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.
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.
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.
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 tool update
v1.0.0- First observed
review_code
TDQS
Scored across 1 tool
With only one tool, there is no possibility of confusion between tools. The single tool's purpose is clearly defined in great detail.
Naming consistency is not applicable as a concept with a single tool. It cannot be penalized and defaults to the highest score.
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).
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
Related MCP Connectors
Security scanner for MCP servers. Detect vulnerabilities, prompt injection, and tool poisoning.
An MCP server that gives your AI access to the source code and docs of all public github repos
Scan any MCP server for tool-poisoning, security, auth & license. Trust score before install.
Scan any public GitHub MCP-server repo for security issues. 37 MCP-specific L1 rules, 8 languages.
Related MCP Servers
- AlicenseAqualityDmaintenanceAn 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.43MIT
- AlicenseAqualityCmaintenanceAn 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.3MIT
- AlicenseNot gradedqualityDmaintenanceMCP server for automated code review using AI agents. It analyzes code diffs or file paths for bugs, security issues, and style violations.MIT
- AlicenseAqualityDmaintenanceDeterministic code review MCP server that provides tools for file selection, rule matching, comment positioning, and reflection, ensuring stable review quality without LLM calls.513 npm1MIT