Adversarial code verification system using Verifier-Critic debate loop
Elenchus MCP Server
English | 한국어
Adversarial Code Verification System using Verifier↔Critic Debate Loop
Elenchus (ἔλεγχος): Socrates' method of refutation through systematic questioning - exposing contradictions to reach truth.
Overview
Elenchus is a Model Context Protocol (MCP) server that implements adversarial code verification. Unlike simple linting or static analysis, Elenchus orchestrates a debate between Verifier and Critic agents to systematically uncover issues through dialectical reasoning.
Why Adversarial Verification?
| Traditional Approach | Elenchus Approach |
|---|---|
| Single-pass analysis | Multi-round debate |
| Checklist-based | Intent-based semantic analysis |
| Fixed rules | Adaptive convergence |
| Silent on clean code | Explicit negative assertions |
The Verifier↔Critic Loop
┌──────────────────────────────────────────────────────────────┐
│ VERIFICATION LOOP │
├──────────────────────────────────────────────────────────────┤
│ Round 1: Verifier → Examines code, RAISES issues │
│ Round 2: Critic → Challenges issues (VALID/INVALID/PARTIAL)│
│ Round 3: Verifier → Defends, resolves, or finds new issues │
│ Round 4: Critic → Re-evaluates, checks coverage │
│ ...continues until convergence... │
│ Final: Verdict (PASS / FAIL / CONDITIONAL) │
└──────────────────────────────────────────────────────────────┘
Key Features
🔄 Adversarial Debate System
- Verifier: Finds issues with evidence
- Critic: Challenges findings, validates claims
- Role Enforcement: Strict alternation with compliance scoring
📊 Intent-Based Convergence
- Semantic understanding instead of keyword matching
- 5 category coverage (Security, Correctness, Reliability, Maintainability, Performance)
- Edge case documentation requirements
- Negative assertions for clean code
🧠 LLM-Based Evaluation (Optional)
- Convergence Assessment: LLM judges verification quality (vs rigid boolean checks)
- Severity Classification: Context-aware impact analysis
- Edge Case Validation: Verifies actual analysis, not just keyword presence
- False Positive Detection: Evidence-based issue validation
🔍 Automatic Impact Analysis
- Multi-language dependency graph (15 languages via tree-sitter)
- Ripple effect prediction
- Cascade depth calculation
- Risk level assessment
🌐 Multi-Language Support
Dependency analysis powered by tree-sitter AST parsing:
| Category | Languages |
|---|---|
| Web | TypeScript, TSX, JavaScript, CSS |
| Systems | Rust, Go, C, C++ |
| Enterprise | Java, C# |
| Scripting | Python, Ruby, PHP, Bash, PowerShell |
💾 Session Management
- Checkpoint/rollback support
- Global session storage
- Audit trail preservation
⚡ Token Optimization (Optional)
- Differential analysis (verify only changed code)
- Response caching
- Selective chunking
- Tiered verification pipeline
Quick Start
Add to your MCP client configuration:
{
"mcpServers": {
"elenchus": {
"command": "npx",
"args": ["-y", "@jhlee0409/elenchus-mcp"]
}
}
}
Then use naturally with your AI assistant:
"Please verify src/auth for security issues"
See Installation for client-specific setup instructions.
Installation
Supported Clients
| Client | Status | Notes |
|---|---|---|
| Claude Desktop | ✅ Supported | macOS, Windows |
| Claude Code | ✅ Supported | CLI tool |
| VS Code (Copilot) | ✅ Supported | Requires v1.102+ |
| Cursor | ✅ Supported | 40 tool limit applies |
| Other MCP C |
Tools (1)
verify_codeInitiates an adversarial debate loop to verify code for security, correctness, and performance issues.Configuration
{"mcpServers": {"elenchus": {"command": "npx", "args": ["-y", "@jhlee0409/elenchus-mcp"]}}}