AI Skill Hub 强烈推荐:jscpd MCP工具 是一款优质的MCP工具。已获得 5.6k 颗 GitHub Star,AI 综合评分 8.2 分,在同类工具中表现稳健。如果你正在寻找可靠的MCP工具解决方案,这是一个值得深入了解的选择。
专业的代码克隆检测工具,支持223种编程语言和文件格式。能自动识别源代码中的重复代码片段,帮助开发团队提升代码质量、规范编码规范。适合软件工程师、代码审查人员和AI编程助手集成使用。
jscpd MCP工具 是一款遵循 MCP(Model Context Protocol)标准协议的 AI 工具扩展。通过 MCP 协议,它可以让 Claude、Cursor 等主流 AI 客户端直接访问和操作外部工具、数据源和服务,实现 AI 能力的无缝扩展。无论是文件操作、数据库查询还是 API 调用,都可以通过自然语言在 AI 对话中直接触发,极大提升生产效率。
专业的代码克隆检测工具,支持223种编程语言和文件格式。能自动识别源代码中的重复代码片段,帮助开发团队提升代码质量、规范编码规范。适合软件工程师、代码审查人员和AI编程助手集成使用。
jscpd MCP工具 是一款遵循 MCP(Model Context Protocol)标准协议的 AI 工具扩展。通过 MCP 协议,它可以让 Claude、Cursor 等主流 AI 客户端直接访问和操作外部工具、数据源和服务,实现 AI 能力的无缝扩展。无论是文件操作、数据库查询还是 API 调用,都可以通过自然语言在 AI 对话中直接触发,极大提升生产效率。
# 方式一:通过 Claude Code CLI 一键安装
claude skill install https://github.com/kucherenko/jscpd
# 方式二:手动配置 claude_desktop_config.json
{
"mcpServers": {
"jscpd-mcp--": {
"command": "npx",
"args": ["-y", "jscpd"]
}
}
}
# 配置文件位置
# macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
# Windows: %APPDATA%/Claude/claude_desktop_config.json
# 安装后在 Claude 对话中直接使用 # 示例: 用户: 请帮我用 jscpd MCP工具 执行以下任务... Claude: [自动调用 jscpd MCP工具 MCP 工具处理请求] # 查看可用工具列表 # 在 Claude 中输入:"列出所有可用的 MCP 工具"
// claude_desktop_config.json 配置示例
{
"mcpServers": {
"jscpd_mcp__": {
"command": "npx",
"args": ["-y", "jscpd"],
"env": {
// "API_KEY": "your-api-key-here"
}
}
}
}
// 保存后重启 Claude Desktop 生效
Duplicate code detector for 220+ languages — plus dead code, complexity hotspots, duplication trends over git history, and one health score for the whole codebase. Rust engine, self-contained binary, AI-ready with an MCP server and a token-efficient reporter.
Documentation: https://jscpd.dev
jscpd tokenizes each of its 224 supported formats the way that language defines it — its own comment and string rules, not generic text — then finds duplicated token sequences across files with a rolling Rabin-Karp hash. Opt-in passes catch copies that differ only in names or values (Type-2) or that have a few edited lines (Type-3), and an experimental one uses a code embedding model for functions that do the same thing written differently (Type-4). See How detection works for the full mechanism, and Supported formats for the full list.
Beyond duplicates, jscpd also finds dead code (--dead-code), ranks files by complexity (--complexity), tracks duplication over git history (--history), and rolls it all into one health score (--health) — see Features below.
jscpd v5 is a Rust engine that ships as a self-contained binary — no runtime required — under two npm names (jscpd installs the jscpd command, cpd installs cpd), on PyPI, crates.io, Homebrew, Nix, Docker, and as a GitHub Action.
jscpd integrates into AI-powered workflows through three mechanisms:
npx jscpd .
Then scan a project:
bash jscpd /path/to/code ```
| Method | Command | Notes |
|---|---|---|
| npm | npm install -g jscpd | Installs the jscpd command; prebuilt binary, no Node.js at runtime |
npm (cpd command) | npm install -g cpd | Same binary, exposed as cpd |
| PyPI | pip install jscpd | Platform wheels with both commands; also pipx install jscpd, uv tool install jscpd, or uvx jscpd . to run without installing |
| Cargo | cargo install jscpd | Builds from crates.io; installs both jscpd and cpd |
| Homebrew | brew install jscpd | macOS / Linux |
| Nix | nix run github:kucherenko/jscpd -- /path/to/code | Or nix profile install github:kucherenko/jscpd |
| Docker | docker run --rm -v "$PWD:/src" ghcr.io/kucherenko/jscpd . | Multi-arch image built from the release binaries |
```bash
Super Linter and MegaLinter both run jscpd with threshold: 0 by default, which fails a build on any duplication at all, including clones that were already there. That is the most common reason projects end up setting VALIDATE_JSCPD: false. Gate on new duplication instead, and leave the threshold out:
jscpd . --baseline-from-ref origin/main --fail-on-new-clones 0
--baseline-from-ref scans the base ref's tree with the same configuration and marks the clones that are absent from it as new, and --fail-on-new-clones 0 fails the run when there is one. Every clone is still reported, and --threshold still compares the duplication of the whole tree, so keep threshold: 0 out of the config, or the old clones fail the build as before. The base ref has to be in the checkout: with actions/checkout set fetch-depth: 0, or run git fetch origin main first, otherwise jscpd stops with an error. jscpd needs the whole tree to find clones, so VALIDATE_ALL_CODEBASE: false does not narrow the scan.
When several linters write into one reports directory, give jscpd its own file name so parallel runs cannot overwrite each other:
```bash jscpd . --reporters json --output reports --report-name megalinter-jscpd
| Package | Registry | Description |
|---|---|---|
| [jscpd](rust/jscpd) | [npm](https://www.npmjs.com/package/jscpd) | Installs the jscpd command (prebuilt binary via platform packages) |
| [cpd](rust) | [npm](https://www.npmjs.com/package/cpd) | Installs the cpd command (same binary) |
| [jscpd-\<platform\>](rust/npm) | npm | Platform binary packages pulled in as optional dependencies: jscpd-darwin-arm64, jscpd-darwin-x64, jscpd-linux-x64-gnu, jscpd-linux-arm64-gnu, jscpd-linux-x64-musl, jscpd-linux-arm64-musl, jscpd-windows-x64-msvc, jscpd-windows-arm64-msvc |
| [jscpd](rust/scripts/build-pypi-wheels.py) | [PyPI](https://pypi.org/project/jscpd/) | Platform wheels repacked from the release binaries; installs both jscpd and cpd commands |
| [jscpd](rust/crates/cpd) | [crates.io](https://crates.io/crates/jscpd) | CLI crate; installs both jscpd and cpd binaries |
| [cpd-core](rust/crates/cpd-core) | [crates.io](https://crates.io/crates/cpd-core) | Detection algorithm (Rabin-Karp rolling hash), data models |
| [cpd-tokenizer](rust/crates/cpd-tokenizer) | [crates.io](https://crates.io/crates/cpd-tokenizer) | Source code tokenization (224 formats) |
| [cpd-similarity](rust/crates/cpd-similarity) | [crates.io](https://crates.io/crates/cpd-similarity) | Structural similarity (--similarity): functions from tree-sitter syntax trees and a Clojure reader, normalized trees and their subtree fingerprints, and the exact search for pairs |
| [cpd-finder](rust/crates/cpd-finder) | [crates.io](https://crates.io/crates/cpd-finder) | File walking, orchestration, git blame — the library entry point |
| [cpd-reporter](rust/crates/cpd-reporter) | [crates.io](https://crates.io/crates/cpd-reporter) | Output formatting (15 reporters, duplication and dead code) |
| [cpd-semantic](rust/crates/cpd-semantic) | [crates.io](https://crates.io/crates/cpd-semantic) | Semantic clones (--semantic, experimental): function extraction, code embeddings from a model run in-process or an API, pairing |
| [basta](rust/crates/basta) | npm / crates.io | Dead code detection — unused files, exports, symbols and imports for JavaScript, TypeScript and Python. Installs the basta command; the same engine backs jscpd --dead-code |
成熟的代码质量检测工具,支持格式全面,与MCP集成良好,适合AI编程助手增强代码质量管理能力。
AI Skill Hub 为第三方内容聚合平台,本页面信息基于公开数据整理,不对工具功能和质量作任何法律背书。
建议在沙箱或测试环境中充分验证后,再部署至生产环境,并做好必要的安全评估。
✅ MIT 协议 — 最宽松的开源协议之一,可自由商用、修改、分发,仅需保留版权声明。
总体来看,jscpd MCP工具 是一款质量优秀的MCP工具,在同类工具中具备一定竞争力。AI Skill Hub 将持续追踪其更新动态,建议收藏备用,结合自身场景选择合适时机引入使用。
| 原始名称 | jscpd |
| 原始描述 | 开源MCP工具:Copy/paste detector for programming source code, supports 223 formats. AI-ready 。⭐5.6k · TypeScript |
| Topics | 代码质量克隆检测复制粘贴检测223种格式AI就绪 |
| GitHub | https://github.com/kucherenko/jscpd |
| License | MIT |
| 语言 | TypeScript |
收录时间:2026-05-14 · 更新时间:2026-05-16 · License:MIT · AI Skill Hub 不对第三方内容的准确性作法律背书。
选择 Agent 类型,复制安装指令后粘贴到对应客户端