Critic-MCP
Critic-MCP — Безжалостный критик кода
Open-source сервер Model Context Protocol (MCP), который рецензирует — только для чтения — код, созданный другими AI-ассистентами программирования (Cursor, OpenCode, Cline и др.).
Critic-MCP — это «второй взгляд»: он никогда не исправляет ваш код, он только безжалостно его критикует. Он предоставляет единственный инструмент (review_code) и не имеет абсолютно никаких возможностей записи в файлы.
Что он делает?
Инструмент review_code сравнивает отправленный вами код с исходным требованием (намерением) и через LLM создает отчет с рецензией, содержащий следующие разделы:
Вердикт:
APPROVED|MODIFICATION_REQUIRED|REJECTEDОтсутствующие требования — разрыв между намерением и кодом
Проблемы безопасности — SQL-инъекции, XSS, повышение привилегий, хардкоженные секреты
Проблемы с крайними случаями — null/пустые входные данные, граничные значения, ошибки на единицу, состояния гонки
Проблемы производительности — N+1 запросы, утечки памяти, избыточные вычисления
Прочие замечания + Обязательные к исправлению пункты (в порядке приоритета)
Related MCP server: codereview-mcp
Установка — два шага
Требование: Node.js >= 20
Шаг 1: Аутентификация (однократно)
Запустите интерактивную настройку, которая работает так же, как aws configure или gh auth login:
npx -y critic-mcp authОна спрашивает, какого провайдера вы используете (gemini / openai / deepseek), запрашивает ваш API-ключ и сохраняет оба в ~/.critic-mcp.json в вашей домашней директории (права 0600 на Unix).
Шаг 2: Добавьте его в вашу IDE
Добавьте только это в настройки MCP вашей IDE:
{ "command": "npx", "args": ["-y", "critic-mcp"] }Смотрите раздел Интеграция с AI-ассистентами для деталей, специфичных для клиента. Вот и всё — теперь ваши ключи хранятся в одном месте, вне любой конфигурации IDE.
Ключи никогда не записываются в конфиги IDE. Когда сервер запускается, он сначала смотрит в
process.env, затем в~/.critic-mcp.json; если ключ не найден ни в одном из них, он направляет вас кnpx critic-mcp auth.
Локальная разработка (установка из исходников)
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Команды
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Переменные окружения (опционально)
Все они опциональны; обычный путь для API-ключей — npx critic-mcp auth. Переменные окружения всегда имеют приоритет над конфигурационным файлом (для CI/серверных настроек).
Переменная | Описание |
|
|
| Gemini ключ (переопределяет файл, если установлен) |
| OpenAI/DeepSeek ключ (переопределяет файл, если установлен) |
| Имя модели Gemini (по умолчанию: |
| Имя модели (по умолчанию: |
| Базовый URL для DeepSeek и т.д. (deepseek по умолчанию: |
| Таймаут запроса LLM (по умолчанию: |
| Лимит разбиения на части (по умолчанию: |
| Параллельные запросы при рецензировании по частям (по умолчанию: |
| Переопределяет местоположение конфигурационного файла (по умолчанию: |
Интеграция с AI-ассистентами
Ни одна из приведенных ниже конфигураций не содержит ключей; вы проходите аутентификацию один раз с помощью команды auth (шаг 1 выше). npx требует, чтобы пакет был опубликован на npm; для локального клона вы можете использовать "command": "node", "args": ["ABSOLUTE_PATH/dist/index.js"].
Cursor
В файле .cursor/mcp.json на уровне проекта (или глобальном ~/.cursor/mcp.json):
{
"mcpServers": {
"critic": {
"command": "npx",
"args": ["-y", "critic-mcp"]
}
}
}Альтернативно: Settings → MCP → Add new MCP server, затем вставьте JSON.
OpenCode
В файле .opencode/opencode.json на уровне проекта или глобальном ~/.config/opencode/opencode.json:
{
"mcp": {
"critic": {
"type": "local",
"command": ["npx", "-y", "critic-mcp"],
"enabled": true
}
}
}OpenCode использует ключ
mcp(неmcpServers) и полеenvironment(неenv);commandдолжен быть массивом. Вам больше не нужно записывать ключи в блокenvironment.
Cline (расширение для VS Code)
Откройте панель Cline → вкладка MCP Servers → Edit Global MCP или Edit Project MCP, затем отредактируйте JSON:
{
"mcpServers": {
"critic": {
"command": "npx",
"args": ["-y", "critic-mcp"],
"disabled": false,
"autoApprove": ["review_code"]
}
}
}
autoApproveпозволяет Cline запускатьreview_codeбез подтверждения; это безопасно, так как инструмент никогда не записывает файлы.
Continue.dev
Добавьте MCP сервер в ~/.continue/config.json (транспорт stdio поддерживается независимо от вашей версии Continue):
{
"experimental": {
"modelContextProtocolServers": [
{
"transport": {
"type": "stdio",
"command": "npx",
"args": ["-y", "critic-mcp"]
}
}
]
}
}Ручной тестовый сценарий
examples/bad_code.js — это пример Express, который намеренно содержит SQL-инъекцию, XSS и N+1 запросы; examples/intent.txt содержит исходное требование. Запустите его из любого клиента следующим образом:
«Проверь код в examples/bad_code.js с помощью инструмента review_code. Требование: examples/intent.txt»
Ожидается, что критик обнаружит как минимум следующее:
КРИТИЧЕСКИ:
db.query("SELECT * FROM users WHERE email = '" ...)— SQL-инъекцияКРИТИЧЕСКИ:
res.send(comment.body)— сохраненный XSSВЫСОКИЙ: Отдельный запрос для каждого пользователя — проблема N+1
Архитектура
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)Рецензирование по частям (map-reduce)
Когда code_snippet превышает CHUNK_SIZE (по умолчанию 30 000 символов), система автоматически переключается на поток map-reduce:
Map: Код разбивается по границам строк; каждый фрагмент отправляется в LLM конкурентно (по умолчанию 3 параллельных запроса, настраивается через
CRITIC_CONCURRENCY). Сбой одного фрагмента никогда не останавливает всю рецензию.Reduce: Все возвращенные частичные анализы объединяются с помощью промпта «Синтезатор» — который никогда не ослабляет выводы и никогда не возвращает APPROVED, если одна часть сообщает о КРИТИЧЕСКОМ — в один финальный отчет.
Сервер возвращает только строковый отчет; он не имеет возможности записи в файлы и никогда не открывает наружу сетевого клиента.
Лицензия
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. Dates show when Glama detected each change.
1 tool update
v1.0.0- First observed
review_code
TDQS
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
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
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
- AlicenseAqualityBmaintenanceAn 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
- AlicenseAqualityBmaintenanceAn 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 gradedqualityBmaintenanceMCP server for automated code review using AI agents. It analyzes code diffs or file paths for bugs, security issues, and style violations.MIT
- AlicenseAqualityBmaintenanceDeterministic code review MCP server that provides tools for file selection, rule matching, comment positioning, and reflection, ensuring stable review quality without LLM calls.5191MIT
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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