jscpd CLI
Duplicate code detector for 220+ languages with an MCP server for agents and a token-efficient report
- 6,545 ★ on the repository
- Last commit
- MIT
Extended access
Why this level
- Runs locally and scans project source code for duplicates
- The --mcp flag starts a stdio MCP server that keeps the index in memory
Install
- Works in
In your terminal, with SkillFoxx CLI
npx skillfoxx add cli/jscpdDetects the agents on your machine, shows the access level and pins the version.
Other ways to install
Access and checks
How we reviewExtended accessThe tool runs code or makes network calls and only reads external data.
- Runs locally and scans project source code for duplicates
- The --mcp flag starts a stdio MCP server that keeps the index in memory
This is third-party code. Review the repository files before installing.
What it does
jscpd tokenizes code following each language's own rules for strings and comments, then finds duplicated token sequences across files with a Rabin-Karp hash. Beyond copy-paste, it can find dead code, rank files by complexity and track duplication trends across git history. A dedicated flag starts a built-in MCP server over stdio so an agent can check a code snippet for duplication or look for structurally similar functions on its own.
Who it is for. For developers and code-quality engineers who want to find duplication and dead code by hand or through an agent.
Good fit when
- You need to check a project for duplicate code before merging
- An agent should check a code snippet for matches before refactoring
- You need to wire duplication checks into CI as a GitHub Action
Not a fit when
- You need static analysis of logic bugs rather than code matches
- Your file format is not among the 224 supported ones
Example request
Find and fix code duplication in this codebaseLimitations
The tool only reads the project source and never edits anything itself. MCP mode scans once at startup and keeps the result in memory, so start time can be noticeable on very large monorepos.
How to disable. Remove the package: npm uninstall -g jscpd (or cpd if installed under that name), or remove the binary installed via Homebrew, Cargo or the Docker image.
FAQ
Do I need Node.js to run it?
No, starting with version five jscpd is a self-contained Rust binary; Node.js is only needed if you install it via npm.
How does MCP mode differ from a normal scan?
The jscpd --mcp command scans the project once and starts an MCP server over stdio, so an agent can check individual snippets for duplication and look for similar functions on demand.
Discussion
No questions or reviews yet.
Related
CLI toolsAn MCP server that indexes code with tree-sitter and returns individual functions and classes to the agent instead of whole files
An MCP server and CLI for code research: search and understand your project and all of GitHub with fewer tokens
A dependency-free CLI and MCP server that builds a call graph of a repository so the agent understands code without reading whole files
An MCP to LSP bridge: the agent gets types, references, diagnostics and refactoring from rust-analyzer, pyright and gopls.
A local codebase index with ten MCP tools: dependency graph, git history, code health and architectural decisions without re-grepping on every step
An MCP server that lets an agent read files, search code and run commands in a workspace
README in short
The README describes jscpd as a duplicate code detector for 220+ languages with a Rust engine, distributed as a self-contained binary via npm, PyPI, Cargo, Homebrew, Nix or Docker. Beyond copy-paste detection, it computes dead code, file complexity, duplication trends over git history, and one overall health score. It also documents an AI mode: a token-efficient report for LLM pipelines and a built-in stdio MCP server. MIT licensed.