jscpd
ActiveDescription
jscpd is a code duplication detector that finds copy-pasted code across large repositories, useful as a code-quality signal for coding agents.
Key Features
- Copy-paste detector supporting 223 languages and formats
- Multiple output formats including console, JSON, HTML, and XML reports
- MCP protocol integration so AI agents can query similarity in real time
- High accuracy with hybrid token and AST based algorithms
- Flexible thresholds configurable for minimum lines and tokens of duplicated code
Use Cases
💡 Detect newly added duplicate code in CI and block low-quality merges
💡 Let AI coding agents self-check for duplication before commits
💡 Audit code reuse across a large codebase
💡 Use MCP to surface duplicates in real time inside the IDE or editor
Categories
Quick Start
# Install jscpd globally
npm install -g jscpd
# Run detection in the project
jscpd ./src
# Start MCP server for agent queries
jscpd --mcp ./src
# Output an HTML report
jscpd --reporters html ./src