open-code-review

by raye-deng

28 stars
277 downloads
Not rated
GitHub Website

About

πŸ€– AI code quality gate for AI-generated code. Detects hallucinated packages, phantom dependencies, stale APIs, and more. MCP Server + CLI + CI/CD Action.

Details

Author
raye-deng
GitHub stars
28
Downloads
277
Categories
Developer Tools

- AI hallucination detection (hallucinated imports, stale APIs)
- Deep LLM analysis with cross-file coherence checks
- AI auto-fix (preview and apply fixes)
- Multi-language support (TypeScript, JavaScript, Python, Java, Go, Kotlin)
- 100% local or self-hosted (no cloud dependencies)
- Works with any OpenAI-compatible LLM (e.g., Ollama, remote endpoints)

Setting up with Highlight

This MCP is not yet compatible with Highlight’s one-click setup. However, you can still use it with Highlight by following these steps:

  1. Download and install Highlight from highlightai.com/download
  2. Navigate to the plugins tab and select "Add Custom Plugin"
  3. Configure the plugin with the settings below
    Plugin Name open-code-review
    Command (node, npx, python, etc.)

    Please refer to the README for specific instructions on how to obtain API keys or other required environment variables.

  4. Enable "Start Automatically" if you want the plugin to start when Highlight launches

From the repository

Install the MCP server globally via npm (npx @opencodereview/mcp-server), then add the configuration to your IDE’s MCP settings (e.g., claude_desktop_config.json for Claude Desktop). Once connected, tools such as ocr_scan, ocr_heal, and ocr_explain become available for scanning, auto-fixing, and explaining code issues.

scan_directory

Scan a directory for AI-generated code quality issues. Detects hallucinated imports, phantom packages, stale APIs, security anti-patterns, and more. Supports TypeScript, JavaScript, Python, Java, Go, and Kotlin.

scan_diff

Scan git diff between two branches for code quality issues. Ideal for PR/MR review β€” only analyzes changed files and lines.

explain_issue

Explain a code quality issue detected by OCR. Returns detailed explanation, category context, and fix guidance for the AI agent to act on.

heal_code

Load a file's source code and prepare a repair prompt for the AI agent. The agent (you) should then apply the fix based on the issue description and suggestion. Returns the file content along with the repair context.

Claude Desktop / Cursor

Paste into your MCP client config file to install this server.

{
    "mcpServers": {
        "open-code-review": {
            "open-code-review": {
                "command": "npx",
                "args": [
                    "-y",
                    "@opencodereview/mcp-server"
                ]
            }
        }
    }
}

McpServers

{
    "open-code-review": {
        "command": "npx",
        "args": [
            "-y",
            "@opencodereview/mcp-server"
        ]
    }
}

Open Code Review

> The first open-source CI/CD quality gate built specifically for AI-generated code.
> Detects hallucinated imports, stale APIs, over-engineering, and security anti-patterns β€” powered by local LLMs and any OpenAI-compatible provider.
> Free. Self-hostable. 6 languages.

Open Code Review

npm version
npm version
npm downloads
License: BUSL-1.1
CI
GitHub Stars
PRs Welcome

Works With

Cursor
GitHub Copilot
Claude Code
Windsurf
Codex
Augment Code
Supermaven
Aider

> Any AI tool that generates code β€” if it writes it, OCR reviews it.

What AI Linters Miss

AI coding assistants (Copilot, Cursor, Claude) generate code with defects that traditional tools miss entirely:

| Defect | Example | ESLint / SonarQube |
|--------|---------|-------------------|
| Hallucinated imports | import { x } from 'non-existent-pkg' | ❌ Miss |
| Stale APIs | Using deprecated APIs from training data | ❌ Miss |
| Context window artifacts | Logic contradictions across files | ❌ Miss |
| Over-engineered patterns | Unnecessary abstractions, dead code | ❌ Miss |
| Security anti-patterns | Hardcoded example secrets, eval() | ❌ Partial |

Open Code Review detects all of them β€” across 6 languages, for free.

Demo

L2 HTML Report Screenshot

πŸ“„ View full interactive HTML report

Quick Preview

$ ocr scan src/ --sla L3

╔══════════════════════════════════════════════════════════════╗
β•‘ Open Code Review β€” Deep Scan Report β•‘
β•šβ•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•

Project: packages/core/src
SLA: L3 Deep β€” Structural + Embedding + LLM Analysis

112 issues found in 110 files

Overall Score: 67/100 D
Threshold: 70 | Status: FAILED
Files Scanned: 110 | Languages: typescript | Duration: 12.3s

Deep Scan (L3) β€” How It Works

L3 combines three analysis layers for maximum coverage:

Layer 1: Structural Detection         Layer 2: Semantic Analysis        Layer 3: LLM Deep Scan
β”œβ”€β”€ Hallucinated imports (npm/PyPI)   β”œβ”€β”€ Embedding similarity recall   β”œβ”€β”€ Cross-file coherence check
β”œβ”€β”€ Stale API detection               β”œβ”€β”€ Risk scoring                  β”œβ”€β”€ Logic bug detection
β”œβ”€β”€ Security patterns                 β”œβ”€β”€ Context window artifacts      β”œβ”€β”€ Confidence scoring
β”œβ”€β”€ Over-engineering metrics          └── Enhanced severity ranking     └── AI-powered fix suggestions
└── A+ β†’ F quality scoring

Powered by local LLMs or any OpenAI-compatible API. Run Ollama for 100% local analysis, or connect to any remote LLM provider β€” the interface is the same.

```bash

No reviews yet β€” be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.