Registry / devops / jscpd-server

jscpd-server

JSON →
library4.2.4jsnpmunverified

Standalone REST API and MCP server for on-demand code duplication detection using jscpd v4.2.4. Scans a codebase on startup and exposes HTTP endpoints to check snippets for duplicates, returning location and statistics. Integrates with AI assistants via the Model Context Protocol. Uses leveldb for persistent storage or in-memory by default. Released under MIT, maintained by kucherenko. Key differentiator is the MCP integration for AI-assisted duplicate detection.

npm install jscpd-server
INSTALL
IMPORT
SIG · JSCPD-SERVER
J
jscpd-server
devopsjavascriptv4.2.4
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

default
import { createServer } from 'jscpd-server';
const jscpdServer = require('jscpd-server');
This package is ESM-only; CommonJS require will fail.

Creates and starts a jscpd-server scanning a project directory, persisting to leveldb, then accepting code check requests.

import { createServer } from 'jscpd-server'; const server = await createServer({ path: '/path/to/project', port: 3000, store: 'leveldb', }); server.start(); // Now send a POST to http://localhost:3000/api/check // with {"code": "your code", "format": "javascript"}
Debug
Known issues
breakingjscpd-server v4 requires ESM (type: module) — CommonJS require will throw ERR_REQUIRE_ESM.
fix
Use `import { createServer } from 'jscpd-server';` in an ESM context or with Node --experimental-modules.
affects: >=4.0.0
gotchaWithout `--store leveldb`, server stores codebase in memory; restarting causes full rescan (slow for large projects).
fix
Pass `--store leveldb` or set `store: 'leveldb'` programmatically.
affects: >=4.0.0
gotchaRequest body size limited to 10MB; larger payloads return 413 Payload Too Large.
fix
Split large snippets or reduce input size.
affects: >=4.0.0
deprecatedThe `--noSymlinks` option is deprecated and will be removed in v5; use `--no-symlinks` instead.
fix
Use `--no-symlinks` flag.
affects: >=4.0.0
Errors
Common errors & fixes
Error [ERR_REQUIRE_ESM]: require() of ES Module /path/to/jscpd-server/index.js from /path/to/app.js not supported.
jscpd-server v4+ is ESM-only; you cannot use require().
fix
Use `import { createServer } from 'jscpd-server';` in an ESM file or set `"type": "module"` in package.json.
POST http://localhost:3000/api/check 400 Bad Request: Invalid format: ''
Missing or invalid `format` field in request body.
fix
Include a valid format string (e.g., "javascript", "python").
Error: EACCES: permission denied, open '/path/to/leveldb/...'
LevelDB store directory has incorrect permissions.
fix
Ensure the user running the server has write permissions to the store path.
Upgrade
Version history
4.2.4latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
7 hits · last 30 days
node
6
Resources
jscpd-server — npm install jscpd-server · libregistry