Critic-MCP
A ruthless, read-only code review MCP server that analyzes code produced by AI coding assistants, catching missing requirements, security vulnerabilities, edge cases, and performance issues without ever modifying files.
README
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)
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.envfirst, then at~/.critic-mcp.json; if a key is found in neither, it directs you tonpx 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
mcpkey (notmcpServers) and theenvironmentfield (notenv);commandmust be an array. You no longer need to write keys into anenvironmentblock.
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"]
}
}
}
autoApprovelets Cline runreview_codewithout 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:
- 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. - 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
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。