jscpd
Officialjscpd
프로그래밍 소스 코드용 복사/붙여넣기 감지기입니다. 224개 이상의 형식을 지원합니다. MCP 서버와 토큰 효율적인 리포터로 AI에 대비되어 있습니다. 이제 Rust 기반 엔진을 탑재하여 24-37배 더 빠릅니다.
jscpd는 Rabin-Karp 알고리즘을 구현하여 파일 전체에서 중복된 코드 블록을 찾습니다.
빠른 시작
# Install (all platforms — installs the jscpd command)
curl -fsSL https://jscpd.dev/install.sh | bash
# TypeScript engine (Node.js, v4.x)
npm install -g jscpd@4
jscpd /path/to/code
# or use without installing
npx jscpd@4 /path/to/code
# Rust engine (v5.x, 24-37x faster) — installs the jscpd command
npm install -g jscpd@5
jscpd /path/to/code
# Rust engine — cpd command only
npm install -g cpd
cpd /path/to/code
# Rust-native install (exposes both jscpd and cpd)
cargo install jscpd
# Nix (installs both jscpd and cpd)
nix run github:kucherenko/jscpd -- /path/to/code
# or install permanently
nix profile install github:kucherenko/jscpd
# Homebrew (macOS/Linux)
brew install jscpdRelated MCP server: tree-sitter-analyzer
문서
문서 | 설명 |
Node.js 엔진 — CLI, 리포터, 구성, 감지 모드 | |
Rust 엔진 — 설치, CLI, 리포터, blame, Rust API | |
AI 리포터, 에이전트 스킬, MCP 서버 | |
TypeScript 및 Rust 프로그래밍 API | |
GitHub Action, pre-commit 훅 | |
Monorepo 패키지 및 crate 개요 |
두 엔진
TypeScript (v4) | Rust (v5) | |
npm 패키지 | ||
CLI 명령 |
|
|
속도 | 기준 | 24-37배 더 빠름 |
형식 | 224 | 223 |
Node.js 필요 | 예 | 아니요 (자체 포함 바이너리) |
프로그래밍 API | TypeScript ( | Rust ( |
LevelDB 저장소 | 예 | 아니요 |
리포터 | 13 | 13 |
jscpd@5는 jscpd 명령을 설치합니다. cpd npm 패키지는 cpd 명령을 설치합니다. 둘 다 동일한 Rust 바이너리를 포함합니다. 단일 설치에서 두 명령 이름을 모두 사용하려면 crates.io를 사용하세요: cargo install jscpd.
새로운 기능
v5.0.x — Rust 엔진
jscpd v5는 jscpd@5 (jscpd 명령 설치) 또는 cpd (cpd 명령 설치)로 제공되는 처음부터 다시 작성된 Rust 버전입니다. 자체 포함 바이너리 — Node.js 런타임이 필요 없습니다.
동일한 인터페이스, 24-37배 더 빠름:
v4의 모든 CLI 옵션이 유지됩니다 — 대체 설치:
jscpd→jscpd@5동일한
.jscpd.json구성 파일, 동일한 감지 알고리즘, 동일한 리포터223개 언어 형식과 교차 형식 감지(Vue SFC, Svelte, Astro, Markdown)
v5의 새로운 기능:
24-37배 더 빠른 감지 (실제 프로젝트 기준, benchmark 참조)
소규모 코드베이스(548개 파일): 34배 더 빠름
중간 규모 코드베이스(9K개 파일): 37배 더 빠름
대규모 코드베이스(17K개 파일, 900MB): 24배 더 빠름
Git blame — 나란히 보는 작성자 비교 (
--blame --reporters console-full)--workers— 파일 토큰화 및 감지의 병렬 처리 제어(기본값: 자동, 모든 CPU 코어 사용, v4에서는 사용 불가)13개 리포터:
console,console-full,json,xml,csv,html,markdown,badge,sarif,ai,xcode,threshold,silentAI 리포터 — LLM 파이프라인을 위한 토큰 효율적 출력(console보다 약 79% 적은 토큰)
--mcp— stdio 기반 내장 MCP 서버: AI 어시스턴트를 바이너리에 지정하면 코드베이스에서 스니펫의 중복을 확인할 수 있습니다 (docs 참조)--summary— 코드베이스 요약: 토큰, 줄, 크기, 복잡도 추정치 기준 상위 파일 및 폴더 — 스캔에서 바로 리팩토링 핫스팟 확인 (docs 참조)자체 포함 바이너리 — 7개 플랫폼용 사전 빌드(macOS arm64/x64, Linux arm64/x64, Windows arm64/x64)
아직 v5에 없음 (이 기능들은 v4를 사용하세요):
LevelDB/Redis 저장소 (
--store leveldb)Node.js 프로그래밍 API (
jscpd(),detectClones())
전체 CLI 참조 및 v4와의 차이점은 Rust 문서를 참조하세요.
v4.2.x — TypeScript 엔진
사용자 정의 토크나이저 백엔드 —
prismjs를 reprism 기반 자체 백엔드로 교체. 실제 프로젝트에서 토큰화가 약 11.5% 빨라짐교차 형식 감지 — Vue SFC, Svelte, Astro, Markdown을 블록 단위로 토큰화하여 파일 유형 간 감지 가능
새로운 형식: Apex, CFML/ColdFusion, GDScript 및 70개 이상의 추가 형식(총 224개, 기존 152개에서 증가)
Shebang 감지 — 확장자가 없는 스크립트의 언어 자동 감지
--store-path— 병렬 실행을 위한 LevelDB 캐시 디렉터리 구성--skipComments—--mode weak의 약어--formats-names— 파일 이름(예:Makefile,Dockerfile)을 형식에 매핑--noTips— CI에서 팁 출력 억제버그 수정: 전체 파일 중복이 조용히 누락되던 문제 (#728), Lisp/Elisp 파일의 ReDoS (#737), 잘못된
package.json으로 인한 프로세스 충돌 (#739), Vue SFC 교차 파일 감지 (#737), Vue SFC 열 번호 (#737), 50개의 의존성 보안 취약점
전체 CLI 참조는 TypeScript 문서를 참조하세요.
패키지
패키지 | 설명 |
CLI 및 Node.js API(v4.x) | |
REST API + MCP 서버 | |
핵심 감지 알고리즘 | |
파일 감지, 리포터 | |
소스 코드 토큰화 | |
HTML 리포트 | |
SVG 배지 | |
SARIF (GitHub Code Scanning) | |
LevelDB 영구 저장소 | |
Redis 분산 저장소 | |
cpd (Rust 엔진) | Rust 기반 엔진(v5.x) — |
jscpd를 사용하는 곳
jscpd npm 패키지는 월 1,000만 회 이상 다운로드되며, 약 5,000개 저장소가 GitHub의 dependents 그래프에 이를 명시하고 있습니다.
분석 플랫폼에 번들로 포함:
GitHub Super Linter — 공식 GitHub 린터 애그리게이터로, jscpd를 복사/붙여넣기 감지기로 번들합니다
MegaLinter — CI용 오픈소스 린터 애그리게이터로,
ci_light를 포함한 모든 변형에 jscpd를 포함합니다Codacy — 자동화된 코드 분석 플랫폼으로, jscpd가 중복 엔진을 구동합니다
주목할 만한 프로젝트에서 사용:
OpenClaw — 개인 AI 어시스턴트로, 체크 스크립트에서 jscpd를 중복 게이트로 실행합니다
DeepSeek Harness — DeepSeek의 플러그인 하네스로, CI에 jscpd 구성이 포함되어 있습니다
degit — Rich Harris의 프로젝트 스캐폴더
MEGA webclient — MEGA.nz 웹 클라이언트
Alibaba AppWorks — jscpd를 라이브러리로 내장합니다
OVHcloud manager — OVHcloud의 고객 제어판
KiroCrew — 스스로 개선되는 지속적 개발 워크스페이스
성능
macOS(Apple Silicon)에서 벤치마크했으며, 대상별 10회 실행(CopilotKit은 3회)했습니다. v4는 비교 가능한 파일 스캔을 위해 --no-gitignore -i "node_modules"로 실행했습니다.
대상 | 파일 | 크기 | jscpd v4 | jscpd v5 | 속도 향상 |
fixtures | 548 | 1.5 MB | 1.03s | 0.03s | 34.3x |
svelte | 9K | 38 MB | 15.80s | 0.43s | 36.9x |
CopilotKit | 17K | 159 MB | 82.89s | 3.44s | 24.1x |
전체 방법론과 원시 데이터는 performance-comparison.md를 참조하세요.
AI 지원 기능
jscpd는 세 가지 메커니즘을 통해 AI 기반 워크플로에 통합됩니다:
AI 리포터
LLM 파이프라인을 위한 토큰 효율적 출력 (기본 console 리포터보다 약 79% 적은 토큰):
jscpd --reporters ai /path/to/source # v4
cpd --reporters ai /path/to/source # v5
cpd --reporters ai --summary /path/to/source # v5: + compact codebase summary에이전트 스킬
AI 코딩 어시스턴트에게 jscpd 사용 방법과 감지된 중복 리팩토링 방법을 가르치는 설치 가능한 두 가지 스킬:
스킬 | 용도 | 설치 |
| 도구 참조 — CLI 옵션, AI 리포터 형식, 구성 구문 |
|
| 안내형 리팩토링 워크플로 — 클론 읽기, 전략 선택, 적용, 검증 |
|
설치 후 에이전트에게 "코드 중복을 찾아 수정해"라고 요청하면, 에이전트가 올바른 옵션으로 jscpd를 호출하고 결과에 따라 작업을 수행합니다.
자세한 내용은 AI-Ready 문서를 참조하세요.
기여
개발 환경 설정(Rust 및 TypeScript), 테스트 정책, 그리고 pull request 승인을 위한 요구 사항은 CONTRIBUTING.md를 참조하세요. 보안 문제는 공개 이슈가 아닌 보안 정책을 통해 접수해 주세요.
저장소 kucherenko/jscpd를 포크하세요
포크한 버전을 클론하세요 (
git clone https://github.com/{your-id}/jscpd)의존성을 설치하세요 (
pnpm install)개발 모드로 실행하세요:
pnpm dev변경 사항을 추가하세요
테스트를 추가하고 확인하세요:
pnpm test빌드하세요:
pnpm buildPR을 생성하세요
후원자
모든 후원자분들께 감사드립니다! 🙏 [후원자가 되기]
스폰서
스폰서가 되어 이 프로젝트를 지원해 주세요. 귀하의 로고가 웹사이트 링크와 함께 여기에 표시됩니다. [스폰서가 되기]
라이선스
MIT © Andrey Kucherenko
Available Tools
5 toolscheck_current_directoryScan the project againARead-onlyIdempotent
Scan the paths the server was started with again and return the fresh clone list and counts. Use it after creating, editing or deleting files, so that the other tools answer from current content. Returns {files, kinds, clones, returned, duplicatedLines, percentage, byKind, duplications[]} with the duplications of get_file_clones, biggest first. Reads the files only, and replaces the previous scan; it can take a few seconds on a large project.
| Name | Required | Description | Default |
|---|---|---|---|
| kinds | No | The kinds of clone to look for: exact (type1), renamed (type2), similar (type3; 'gap' or 'ast' for one of its two mechanisms) and semantic (type4). Without it: exact, what jscpd reports with this server's options. Renamed and similar clones may need one scan more, and semantic ones run an embedding model, which takes a while the first time. | |
| limit | No | Maximum number of clones in the response. 'clones' always carries the full count, so a small limit still tells you how much was found. |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already establish read-only, idempotent, non-destructive, closed-world behavior. The description adds meaningful context beyond that: it reads files only, replaces the previous scan, and can take a few seconds on a large project.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is front-loaded with the action and purpose, then covers usage, return shape, and side effects without filler. Every sentence adds useful information for invoking or interpreting the tool.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
There is no output schema, but the description explicitly lists the return shape and notes that duplications are biggest first. For a two-parameter scan tool with annotations covering safety, the description is complete enough to call and interpret correctly.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so the schema already documents both parameters in detail, including the kinds enum and limit behavior. The description does not add parameter-specific semantics beyond what the schema provides, so the baseline 3 is appropriate.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
States a specific verb and resource: scanning the paths the server was started with and returning a fresh clone list and counts. It also distinguishes itself by tying its duplication output to get_file_clones and by explaining that other tools should answer from current content after a scan.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Explicitly says to use it after creating, editing, or deleting files so other tools answer from current content. It does not state when not to use it, which keeps it below a full 5, but the usage context is clear.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
check_duplicationCheck a snippet for duplicationARead-onlyIdempotent
Check whether a code snippet duplicates code that already exists in the scanned project. Use it before writing or committing a function, class or block, to find the existing code you should reuse instead; pass kinds ["exact", "renamed", "similar"] to find copies with other names or edited lines as well. Returns {format, kinds, count, returned, duplications[]}, each duplication with 'kind', 'format' (the language of the code that matched), 'file', 'fileStartLine', 'fileEndLine', 'lines' (how many of those lines count as duplicated, as in jscpd's reports: fewer when the match runs over other blocks of the file), 'snippetStartLine', 'snippetEndLine' and 'tokens'; similar and semantic ones add 'similarity' (and 'method': gap or ast), and ast and semantic ones add 'name' (the name of the project's function) and 'snippetName'. Exact matches come first, then renamed, similar and semantic ones. A request without 'kinds' gets its ast matches under 'similar' with 'similarCount', as earlier versions answered. A Markdown, Vue, Svelte or Astro snippet is split into blocks the way a scan splits such a file, so the code of a fence or a script matches code in its language; by meaning, only the functions in a component's scripts are compared. A snippet or a block of code in it shorter than the server's --min-tokens (50 by default) cannot match, and a 'note' says so. Kinds that could not be searched are listed under 'unavailable' with the reason. The snippet is compared with the last scan: call check_current_directory first if files changed.
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes | The source code to check, verbatim. Whole functions or blocks work best. | |
| kinds | No | The kinds of clone to look for: exact (type1), renamed (type2), similar (type3; 'gap' or 'ast' for one of its two mechanisms) and semantic (type4). Without it: exact, what jscpd reports with this server's options. Renamed and similar clones may need one scan more, and semantic ones run an embedding model, which takes a while the first time. | |
| limit | No | Maximum number of duplications in the response. 'count' always carries the full count, so a small limit still tells you how much was found. | |
| format | Yes | Language of the snippet: a jscpd format name such as 'javascript', 'typescript', 'python', 'java', or a file extension such as 'js', 'py' (`jscpd --list` lists all 224). | |
| similarity | No | The share of subtrees two functions' normalized syntax trees must have in common to be an ast match: 1 finds copies with other names, each standing for one name, and other literals only, 0.8 also one-line edits, 0.7 a couple of added or removed statements. Giving it asks for ast matches. Defaults to the server's --similarity, or 0.8. Functions of JavaScript, TypeScript, Python, Java, Kotlin, Scala, C#, Go, Rust, C, C++, PHP, Ruby, Swift and Clojure. In ast matches each function's syntax tree is normalized: the names of the functions and methods it calls and its operators count, local names, field names and literals do not, as long as each name stands for one name on the other side, and two functions score the share of subtrees their trees have in common. Test files are left out. |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations only cover the safe-read profile; the description adds substantial behavior: results are ordered exact → renamed → similar → semantic, a --min-tokens threshold (50 default) prevents short snippets from matching, unfindable kinds appear under 'unavailable', semantic search runs an embedding model that is slow the first time, and renamed/similar may need an extra scan. It also documents the legacy no-'kinds' response shape, which is real behavioral variance.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Purpose and usage are front-loaded in the first sentence, and the dense return-format detail is justified because no output schema exists. It does read as one long wall of text bundling edge cases (Markdown/Vue/Svelte/Astro splitting, threshold notes) that could be sectioned, but little is truly wasted.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
With no output schema, the description takes on the full burden and delivers: it enumerates every returned field, explains the 'lines' vs match-span distinction, and covers degraded responses ('note', 'unavailable'). An agent has everything needed to call this and interpret the result.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100%, so the schema already carries most parameter meaning. The description still adds cross-parameter semantics the schema does not: supplying 'similarity' implicitly requests ast matches, and omitting 'kinds' changes how ast results are reported ('similar' with 'similarCount'), plus the note that ast matching only covers a listed set of languages.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
States a specific verb and resource ('Check whether a code snippet duplicates code that already exists in the scanned project') and scopes it to the last scan. It is clearly distinguishable from siblings like get_file_clones (project-wide listing) and compare_folders (folder-to-folder).
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Gives an explicit trigger ('Use it before writing or committing a function, class or block, to find the existing code you should reuse instead') and an explicit prerequisite/alternative: 'call check_current_directory first if files changed'. Both when-to-use and when-to-refresh are covered.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
compare_foldersCompare two folders function by functionARead-onlyIdempotent
Compare two folders function by function, in one language or across languages: a port and its original (the source first, the target second), or two implementations of one app (iOS and Android). Every function of one folder is paired with the function of the other that does the same job, by the embedding model, and what has no counterpart is listed. Returns the JSON report of jscpd --compare: 'code' and 'tests' sections, each with 'sides' (per folder: 'functions', 'matched', 'percentage', 'files', 'unmatched', 'readyToPort': unported functions whose callees are all ported) and 'pairs' (each with both functions, 'similarity', 'level' high/medium/low, 'renamed' and 'matchedBy' code or name). Read a few low pairs and the pairs matched by name before relying on them. Needs the embedding model; the first comparison of two folders embeds every function and can take minutes, later ones reuse the cached vectors.
| Name | Required | Description | Default |
|---|---|---|---|
| left | Yes | The first folder (or file): the source of a port, or one of two implementations. It must lie inside the scanned folders: give it relative to one of them, or absolute. | |
| limit | No | Maximum number of entries of each list ('pairs', 'unmatched', 'readyToPort', 'files') in the response. 'functions' always carries the full count, so a small limit still tells you how much was found. | |
| right | Yes | The second folder (or file): the target of a port, or the other implementation. It must lie inside the scanned folders too, and must not contain the first or lie inside it. |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Beyond the readOnly/idempotent annotations, the description discloses the operational cost ('needs the embedding model', 'the first comparison ... can take minutes, later ones reuse the cached vectors') and describes the full returned report. It also flags correctness risk by warning that name-matched and low-level pairs should be spot-checked, which the annotations cannot convey.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
It is front-loaded with purpose and argument ordering and every sentence carries information. The long parenthetical enumeration of returned sections is dense but justified because no output schema exists, though it could be tightened.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
With no output schema, the description fully carries the return-value burden: it names the 'code'/'tests' sections, the per-side fields including 'readyToPort', and the 'pairs' fields including 'similarity', 'level', 'renamed' and 'matchedBy'. Combined with model requirements and caching behavior, an agent has what it needs to call this correctly.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is already 100%, so the baseline is 3, but the description adds the semantic ordering rule (left is the source, right the target) and implies the left/right containment constraint the schema also states. The 'limit' parameter's truncation behavior is left entirely to the schema, so it isn't a full 5.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description gives a specific verb and resource — compare two folders function by function — and immediately names the two scenarios it serves (a port and its original, or two implementations of one app such as iOS and Android). That is enough to distinguish it from the sibling tools get_statistics, check_duplication and get_file_clones, which operate on duplication statistics or clone lists rather than cross-folder function pairing.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
It spells out both intended scenarios and the argument ordering (source first, target second), and it adds a concrete interpretation rule: read a few low-similarity pairs and the pairs matched by name before relying on them. It never explicitly states when not to use it or names a sibling as the alternative for plain clone or duplication queries, so a 4 rather than a 5.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_file_clonesList the clones of one fileARead-onlyIdempotent
List every clone of the last scan that involves one file, to see which other files share code with it. Use it before refactoring, splitting or deleting a file. Returns {file, kinds, clones, returned, duplications[]}, each duplication with 'kind', 'format', 'fileA', 'startA', 'endA', 'fileB', 'startB', 'endB', 'lines' and 'tokens' ('similarity' and 'method' for similar and semantic ones), biggest first; the file may be fileA or fileB. A path that was not part of the scan gets clones 0 and a 'note'.
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | The file, relative to the scan root as other results show paths (e.g. 'src/cart.js'), or absolute. | |
| kinds | No | The kinds of clone to look for: exact (type1), renamed (type2), similar (type3; 'gap' or 'ast' for one of its two mechanisms) and semantic (type4). Without it: exact, what jscpd reports with this server's options. Renamed and similar clones may need one scan more, and semantic ones run an embedding model, which takes a while the first time. | |
| limit | No | Maximum number of clones in the response. 'clones' always carries the full count, so a small limit still tells you how much was found. |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already declare read-only, idempotent, non-destructive behavior, and the description goes beyond them: it discloses the ordering (biggest first), the edge case where an unscanned path returns 0 clones plus a 'note', and the cost/latency caveats for semantic clones and extra scans.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Purpose, usage, and return shape are front-loaded in that order with no filler sentences. The long enumeration of return fields is dense but earns its place given there is no output schema.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
With no output schema, the description fully compensates by specifying the response envelope, per-clone fields, ordering, and the not-found shape. An agent has everything needed to call and interpret it.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100%, so baseline is 3; the description adds meaning by explaining that results may place the requested file as either fileA or fileB, and by describing the unscanned-path outcome that affects the 'path' parameter. It does not elaborate on kinds/limit beyond the schema, so not a 5.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
Specific verb and resource — 'List every clone of the last scan that involves one file' — plus a scoping phrase ('which other files share code with it') that separates it from siblings like check_duplication and get_statistics.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Gives a concrete usage context ('before refactoring, splitting or deleting a file'), which is clear guidance on when to reach for it. It does not name an alternative tool or state when not to use it, so it falls short of a 5.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_statisticsProject duplication statisticsARead-onlyIdempotent
Report the duplication statistics of the last scan, for the clones of the kinds asked: for the whole project and per format, the files, lines and tokens analyzed, the clones, and the duplicated lines and tokens with their percentages, plus the number of clones of each kind ('byKind'). Use it to judge overall duplication, or to compare before and after a refactoring (call check_current_directory in between). It reflects the last scan, not the files on disk now.
| Name | Required | Description | Default |
|---|---|---|---|
| kinds | No | The kinds of clone to look for: exact (type1), renamed (type2), similar (type3; 'gap' or 'ast' for one of its two mechanisms) and semantic (type4). Without it: exact, what jscpd reports with this server's options. Renamed and similar clones may need one scan more, and semantic ones run an embedding model, which takes a while the first time. |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Beyond the annotations, the description discloses important snapshot semantics: it reflects the last scan, not the files currently on disk. It also enumerates the reported statistics, including the 'byKind' breakdown. It does not cover cost or timing details, though those appear in the parameter schema.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is front-loaded with the core purpose and the key caveat about the last scan. The first sentence is dense and long, but each part carries useful information and the later sentences add workflow guidance efficiently.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
With no output schema, the description does a good job listing the returned statistics and explaining the stale-scan behavior. It omits precise output shape details, but gives enough for an agent to understand what the call yields and when to use it.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100% and the sole 'kinds' parameter is fully documented in the schema, including defaults, enum meanings, and performance notes. The description only alludes to 'the clones of the kinds asked' and does not add meaning beyond the schema.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description states a specific verb and resource ('Report the duplication statistics of the last scan') and clarifies the aggregate scope ('whole project and per format'), which helps distinguish it from per-file tools like get_file_clones. It does not explicitly contrast with check_duplication, so sibling differentiation is good but not complete.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
It gives clear usage contexts: judging overall duplication and comparing before/after a refactoring, with the concrete instruction to call check_current_directory in between. It does not state when not to use it or name get_file_clones as the alternative for per-file clone data.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
5 tool updates
v5.4.2- Changed
check_current_directory2 fields changed- added
Input schema / properties / kindsAdded value: +{ + "description": "The kinds of clone to look for: exact (type1), renamed (type2), similar (type3; 'gap' or 'ast' for one of its two mechanisms) and semantic (type4). Without it: exact, what jscpd reports with this server's options. Renamed and similar clones may need one scan more, and semantic ones run an embedding model, which takes a while the first time.", + "examples": [ + [ + "exact", + "renamed", + "similar" + ], + [ + "semantic" + ] + ], + "items": { + "enum": [ + "exact", + "renamed", + "similar", + "gap", + "ast", + "semantic", + "type1", + "type2", + "type3", + "type4" + ], + "type": "string" + }, + "type": "array", + "uniqueItems": true +} - changed
Input schema / properties / limit / descriptionPrevious value: -"Maximum number of clones to include in the response. 'clones' always carries the untruncated total, so a small limit still tells you how much was found."New value: +"Maximum number of clones in the response. 'clones' always carries the full count, so a small limit still tells you how much was found."
- Changed
check_duplication7 fields changed- added
Input schema / additionalPropertiesAdded value: +false - changed
Input schema / properties / code / descriptionPrevious value: -"The source code to check, verbatim (whole functions or blocks work best; it must reach the server's --min-tokens threshold, 50 tokens by default)"New value: +"The source code to check, verbatim. Whole functions or blocks work best." - changed
Input schema / properties / format / descriptionPrevious value: -"Language of the snippet: a jscpd format name such as 'javascript', 'typescript', 'python', 'java', or a file extension such as 'js', 'py' (run `jscpd --list` for all 224). Unknown values return an error naming the problem."New value: +"Language of the snippet: a jscpd format name such as 'javascript', 'typescript', 'python', 'java', or a file extension such as 'js', 'py' (`jscpd --list` lists all 224)." - added
Input schema / properties / kindsAdded value: +{ + "description": "The kinds of clone to look for: exact (type1), renamed (type2), similar (type3; 'gap' or 'ast' for one of its two mechanisms) and semantic (type4). Without it: exact, what jscpd reports with this server's options. Renamed and similar clones may need one scan more, and semantic ones run an embedding model, which takes a while the first time.", + "examples": [ + [ + "exact", + "renamed", + "similar" + ], + [ + "semantic" + ] + ], + "items": { + "enum": [ + "exact", + "renamed", + "similar", + "gap", + "ast", + "semantic", + "type1", + "type2", + "type3", + "type4" + ], + "type": "string" + }, + "type": "array", + "uniqueItems": true +} - changed
Input schema / properties / limit / descriptionPrevious value: -"Maximum number of duplications to include in the response. 'count' always carries the untruncated total, so a small limit still tells you how much was found."New value: +"Maximum number of duplications in the response. 'count' always carries the full count, so a small limit still tells you how much was found." - changed
Input schema / properties / similarity / descriptionPrevious value: -"Also return project functions whose syntax-tree structure is similar to the snippet's functions, when the similarity ratio reaches this value. 1 means exact matches only (no 'similar' section); 0.85 catches renames, literal changes and one-line edits; 0.7 tolerates a couple of added or removed statements. Defaults to the server's --similarity setting (1 unless configured). JavaScript/TypeScript only; other formats ignore it."New value: +"The share of subtrees two functions' normalized syntax trees must have in common to be an ast match: 1 finds copies with other names, each standing for one name, and other literals only, 0.8 also one-line edits, 0.7 a couple of added or removed statements. Giving it asks for ast matches. Defaults to the server's --similarity, or 0.8. Functions of JavaScript, TypeScript, Python, Java, Kotlin, Scala, C#, Go, Rust, C, C++, PHP, Ruby, Swift and Clojure. In ast matches each function's syntax tree is normalized: the names of the functions and methods it calls and its operators count, local names, field names and literals do not, as long as each name stands for one name on the other side, and two functions score the share of subtrees their trees have in common. Test files are left out." - changed
Input schema / properties / similarity / examplesPrevious value: -[ - 0.85 -]New value: +[ + 0.8 +]
- Added
compare_folders - Changed
get_file_clones4 fields changed- added
Input schema / additionalPropertiesAdded value: +false - added
Input schema / properties / kindsAdded value: +{ + "description": "The kinds of clone to look for: exact (type1), renamed (type2), similar (type3; 'gap' or 'ast' for one of its two mechanisms) and semantic (type4). Without it: exact, what jscpd reports with this server's options. Renamed and similar clones may need one scan more, and semantic ones run an embedding model, which takes a while the first time.", + "examples": [ + [ + "exact", + "renamed", + "similar" + ], + [ + "semantic" + ] + ], + "items": { + "enum": [ + "exact", + "renamed", + "similar", + "gap", + "ast", + "semantic", + "type1", + "type2", + "type3", + "type4" + ], + "type": "string" + }, + "type": "array", + "uniqueItems": true +} - changed
Input schema / properties / limit / descriptionPrevious value: -"Maximum number of clones to include in the response. 'clones' always carries the untruncated total, so a small limit still tells you how much was found."New value: +"Maximum number of clones in the response. 'clones' always carries the full count, so a small limit still tells you how much was found." - changed
Input schema / properties / path / descriptionPrevious value: -"The file to inspect, either relative to the scan root exactly as paths appear in other tool results (e.g. 'src/cart.js') or absolute"New value: +"The file, relative to the scan root as other results show paths (e.g. 'src/cart.js'), or absolute."
- Changed
get_statistics1 field changed- added
Input schema / properties / kindsAdded value: +{ + "description": "The kinds of clone to look for: exact (type1), renamed (type2), similar (type3; 'gap' or 'ast' for one of its two mechanisms) and semantic (type4). Without it: exact, what jscpd reports with this server's options. Renamed and similar clones may need one scan more, and semantic ones run an embedding model, which takes a while the first time.", + "examples": [ + [ + "exact", + "renamed", + "similar" + ], + [ + "semantic" + ] + ], + "items": { + "enum": [ + "exact", + "renamed", + "similar", + "gap", + "ast", + "semantic", + "type1", + "type2", + "type3", + "type4" + ], + "type": "string" + }, + "type": "array", + "uniqueItems": true +}
4 tool updates
v5.2.0- Changed
check_current_directory3 fields changed- added
Input schema / additionalPropertiesAdded value: +false - added
Input schema / properties / limit / defaultAdded value: +100 - changed
Input schema / properties / limit / descriptionPrevious value: -"Maximum number of clones to include in the response (default 100); 'clones' always carries the untruncated total"New value: +"Maximum number of clones to include in the response. 'clones' always carries the untruncated total, so a small limit still tells you how much was found."
- Changed
check_duplication6 fields changed- changed
Input schema / properties / code / descriptionPrevious value: -"Source code snippet to check"New value: +"The source code to check, verbatim (whole functions or blocks work best; it must reach the server's --min-tokens threshold, 50 tokens by default)" - changed
Input schema / properties / format / descriptionPrevious value: -"Language format (javascript, python, ...) or file extension (js, py, ...); see `cpd --list`"New value: +"Language of the snippet: a jscpd format name such as 'javascript', 'typescript', 'python', 'java', or a file extension such as 'js', 'py' (run `jscpd --list` for all 224). Unknown values return an error naming the problem." - added
Input schema / properties / format / examplesAdded value: +[ + "javascript", + "python", + "ts" +] - added
Input schema / properties / limit / defaultAdded value: +100 - changed
Input schema / properties / limit / descriptionPrevious value: -"Maximum matches to include in the response (default 100); 'count' always carries the untruncated total"New value: +"Maximum number of duplications to include in the response. 'count' always carries the untruncated total, so a small limit still tells you how much was found." - added
Input schema / properties / similarityAdded value: +{ + "description": "Also return project functions whose syntax-tree structure is similar to the snippet's functions, when the similarity ratio reaches this value. 1 means exact matches only (no 'similar' section); 0.85 catches renames, literal changes and one-line edits; 0.7 tolerates a couple of added or removed statements. Defaults to the server's --similarity setting (1 unless configured). JavaScript/TypeScript only; other formats ignore it.", + "examples": [ + 0.85 + ], + "exclusiveMinimum": 0, + "maximum": 1, + "type": "number" +}
- Changed
get_file_clones4 fields changed- added
Input schema / properties / limit / defaultAdded value: +100 - changed
Input schema / properties / limit / descriptionPrevious value: -"Maximum clones to include in the response (default 100); 'clones' always carries the untruncated total"New value: +"Maximum number of clones to include in the response. 'clones' always carries the untruncated total, so a small limit still tells you how much was found." - changed
Input schema / properties / path / descriptionPrevious value: -"File path, relative to the scan root (as shown in other tool results) or absolute"New value: +"The file to inspect, either relative to the scan root exactly as paths appear in other tool results (e.g. 'src/cart.js') or absolute" - added
Input schema / properties / path / examplesAdded value: +[ + "src/cart.js" +]
- Changed
get_statistics1 field changed- added
Input schema / additionalPropertiesAdded value: +false
4 tool updates
v0.1.0- First observed
check_current_directory - First observed
check_duplication - First observed
get_file_clones - First observed
get_statistics
TDQS
Scored across 5 tools
The five tools target clearly distinct inputs and outputs: snippet check, file clone listing, folder comparison, statistics reporting, and rescanning. The descriptions explicitly clarify boundaries, such as 'last scan' vs 'fresh scan', leaving little room for misselection.
All tool names follow a consistent snake_case verb_noun pattern (get_statistics, check_duplication, get_file_clones, check_current_directory, compare_folders). No mixed conventions or vague verbs.
Five tools neatly cover the duplication analysis domain: scan, stats, snippet check, file clones, and folder comparison. Each tool has a clear role, and the set is neither thin nor bloated.
Core workflows are covered, but there is no tool to retrieve the full clone list from the last scan without rescanning (check_current_directory always rescans), and no way to adjust parameters like min-tokens. These are minor gaps that agents can work around.
Maintenance
Related MCP Connectors
Zero-config MCP security scanner for AI-generated apps. 25K+ vulnerability patterns.
Source code plagiarism, peer similarity, and AI-generated-code detection for AI agents.
Security scanner for MCP servers. Detect vulnerabilities, prompt injection, and tool poisoning.
Search GitHub, npm, PyPI, StackOverflow, ArXiv from one MCP — built for coding agents.
Related MCP Servers
- AlicenseAqualityAmaintenanceFramework-aware code intelligence MCP server that builds a cross-language dependency graph from source code. 53 integrations (Laravel, Django, Rails, Spring, NestJS, Next.js, and more) across 68 languages. 100+ tools for navigation, impact analysis, refactoring, security scanning, session memory, and CI/PR reports — up to 97% token reduction.298,194 npm201MIT
- AlicenseBqualityAmaintenanceAn MCP code-intelligence server for AI agents with pre-indexed AST cache, 62 MCP tools, and TOON-compressed output, enabling token-efficient code analysis and project health grading entirely locally.91,244 PyPI61MIT
- AlicenseNot gradedqualityCmaintenanceA local MCP server that indexes TypeScript/JavaScript projects and returns budget-aware, dependency-optimized context packs for AI coding assistants.1MIT
- AlicenseNot gradedqualityCmaintenanceToken-efficient MCP server for multi-language project analysis (Java, TypeScript, JavaScript, Markdown, Python) with plugins, semantic search, and static analysis.MIT