Dep Scope

io.github.FlorianBruniaux由 GitHub 帳號 FlorianBruniaux 發布v0.4.2更新於 Oct 25, 2026

Symbol-level npm dependency analysis: scan verdicts, native alternatives, migration prompts.

發布方自己的服務:Scope (AEC) - Preview

已驗證STDIO僅桌面開發者工具資料與分析

概覽

AI 產生的概覽

一個本機 MCP 伺服器,對 TypeScript/JavaScript 專案的 npm 相依套件做符號層級分析,並為 AI 助理產生遷移提示詞。

可以做什麼
掃描專案,依相依套件給出保留、移除、改用原生實作或 peer 相依等結論,可選擇檢查重複套件、傳遞性 polyfill 與 Knip 結果。分析單一套件,列出程式碼實際用到的符號。列出可替換為原生 API 或可合併的套件。為指定套件產生結合情境的遷移提示詞。偵測功能重疊或重複的函式庫。
適用情境
適合稽核老舊或相依套件繁多的 TypeScript/JavaScript 專案、整併功能重複的多個函式庫,或準備由 AI 助理依產生的提示詞執行的重構。不適合單純偵測未使用的相依套件,README 建議這類需求改用 Knip。
執行需求
透過 npx 在本機執行,需要 Node.js 18 以上版本,以及含 package.json 的 TypeScript/JavaScript 專案。未宣告帳號、API 金鑰或標頭。README 建議首次掃描前先執行一次 init 指令產生設定檔。
安裝前請注意
掃描會讀取本機專案原始碼與設定檔;結果取決於設定的原始碼目錄,README 提醒範圍過窄可能誤判為未使用,刪除前應先以專案根目錄完整掃描確認。此伺服器只做分析與產生提示詞,本身不會修改程式碼,但若依其移除建議操作而判斷有誤,會造成破壞。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Dep Scope,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

dep-scope

[Florian Bruniaux] Florian BRUNIAUX · AI Founding Engineer @ Méthode Aristote
13 years from developer to CTO / VP Eng · Blog ↗ · Projects ↗

[CI] [npm version] [MCP Registry] [License: MIT] [Node.js]

Symbol-level dependency analysis + LLM-ready migration prompts for TypeScript/JavaScript projects.

"Knip tells you what's unused. dep-scope tells you how you use what you keep, and generates the prompt to remove it."

When to use dep-scope

Good use cases:

  • Legacy project audit: Finding lodash functions that now have native equivalents
  • Library consolidation: Do we really need 3 icon libraries?
  • Migration: Generate a context-aware prompt and let Claude Code do the refactoring
  • Curiosity: "Which symbols from this 50KB library do we actually use?"

Not the right tool if:

  • You just want unused deps → use Knip instead
  • Your codebase is already well-maintained → dep-scope will mostly say "KEEP"

Quick Example

bash
$ dep-scope scan
═══════════════════════════════════════════  dep-scope Analysis Report═══════════════════════════════════════════
Summary:  Total dependencies: 45  ✓ Keep:          38  ↻ Recode Native: 3  ✗ Remove:        2  ⊕ Peer Dep:      4
Action Items:  Remove (unused):    ✗ moment    ✗ has-flag
  Recode to native:    ↻ lodash.debounce (1 symbol) → custom debounce function    ↻ array-includes (1 symbol) → Array.prototype.includes    ↻ left-pad (1 symbol) → String.prototype.padStart

How it compares

FeatureKnipDepcheckModernedep-scope
Unused detection✅ Excellent✅ Good❌⚠️ Basic
Config file scanning✅✅❌✅
Symbol-level analysis❌❌✅✅
Native alternatives database❌❌✅ (lodash)✅ 195 packages
e18e micro-utilities coverage❌❌❌✅
Transitive graph analysis❌❌❌✅
Monorepo workspace support⚠️❌❌✅
Duplicate detection❌❌❌✅
LLM migration prompt❌❌❌✅
MCP Server (AI editors)❌❌❌✅
OSS / free✅✅❌ enterprise✅

Recommendation: Use Knip for unused detection, dep-scope for deeper analysis and migration. They work well together (dep-scope auto-detects Knip if installed).

Installation

CLI (global):

bash
npm install -g @florianbruniaux/dep-scope

Without installation:

bash
npx @florianbruniaux/dep-scope scan

MCP Server (AI editors — no CLI needed):

Add to your editor's MCP config and the server runs on demand via npx. See the MCP Server section below for per-editor config snippets.

From source:

bash
git clone https://github.com/FlorianBruniaux/node-dep-scope.gitcd node-dep-scopenpm install && npm run build && npm install -g .

Quick Start

bash
cd /path/to/your/project
dep-scope init                        # configure dep-scope for your project (interactive)dep-scope scan                        # full scandep-scope scan --root                 # scan full project, including scripts/ tools/ bin/dep-scope scan --check-duplicates     # include duplicate detectiondep-scope scan --check-transitive     # surface transitive polyfills (e18e database)dep-scope scan --each-workspace       # monorepo: scan each package individuallydep-scope migrate                     # generate migration prompts for all candidatesdep-scope migrate lodash              # target a specific packagedep-scope report -o ./audit.md        # markdown report

Setup: dep-scope init

Run dep-scope init before your first scan. The wizard detects your project and generates a config in 4 questions:

dep-scope init
  Detected: Next.js project  Found dirs: src/, scripts/, app/
? Source directories to scan:  ● Auto-detected: src/, scripts/, app/  (recommended)  ○ Full project root (.) — includes everything  ○ Choose directories manually...
? Include devDependencies in scan? (y/N)? Symbol threshold for RECODE_NATIVE verdict: (5)? Config format:  ● .depscoperc.json  (simple JSON, recommended)  ○ depscope.config.ts  (TypeScript with autocomplete)
✓ Created .depscoperc.json  Preset: react  |  Dirs: src, scripts, app  |  Threshold: 5

Use -y to skip prompts in CI: dep-scope init --yes.

Getting accurate results

Auto-detection covers: src, app, lib, pages, components, hooks, server, scripts, tools, bin, cli. If your project has code elsewhere, pass --root to scan everything, or set srcPaths explicitly in .depscoperc.json:

json
{  "srcPaths": ["src", "app", "scripts", "tools"]}

False positive "unused" verdict? The package may be used in a directory outside the scan scope (scripts/, tools/, etc.). Run dep-scope scan --root to verify before removing anything. When a removal recommendation appears with a narrow scan scope, dep-scope will warn you.

Config file detection

dep-scope automatically scans config files at the project root to avoid false "unused" verdicts for packages referenced as strings — a common pattern for CLI tools, test runners, and framework plugins.

Detected automatically:

Config fileExamples detected
package.json scripts"lint": "oxlint .", "format": "oxfmt ."
vitest.config.*environment: "jsdom", setupFiles: ["@testing-library/jest-dom"]
vite.config.*plugins: ["@vitejs/plugin-vue"]
next.config.*turbo.rules["*.svg"].loaders: ["@svgr/webpack"]
.storybook/main.*addons: ["@storybook/addon-mcp"]

These packages will appear as INVESTIGATE (or KEEP if well-used) rather than REMOVE.

Opt-out — disable specific detectors in .depscoperc.json:

json
{  "stringReferences": {    "disable": ["storybook-config"]  }}

Available detector IDs: package-json-scripts, vitest-config, vite-config, next-config, storybook-config. Use "disable": "all" to turn off config scanning entirely.

Extend with custom detectors — in depscope.config.ts:

ts
import { defineConfig, defineDetector } from "@florianbruniaux/dep-scope";
export default defineConfig({  stringReferences: {    detectors: [      defineDetector({        id: "my-tool-config",        label: "my-tool.config.json",        filePatterns: ["my-tool.config.json"],        async detect(filePath, ctx) {          // return StringReference[] for packages found in this file          return [];        },      }),    ],  },});

MCP Server

dep-scope exposes a Model Context Protocol server so AI editors (Claude Code, Cursor, Windsurf) can query your dependencies inline — no CLI, no markdown files, no copy-paste.

Listed on the official MCP Registry: io.github.FlorianBruniaux/dep-scope

Available tools

ToolParamsWhat it does
scan_projectprojectPath, srcPaths, threshold, includeDev, checkDuplicates, checkTransitive, withKnipFull dependency scan with verdicts
analyze_packagepackageName, projectPath, srcPathsSymbol-level breakdown of one package
get_migration_candidatesprojectPathList all RECODE_NATIVE + CONSOLIDATE packages
generate_migration_promptpackageName, projectPathGenerate a migration prompt inline
find_duplicatesprojectPathDetect overlapping libraries

Setup

Add the following mcpServers entry to your editor's config. The server runs on demand via npx — no global install required.

Claude Code — ~/.claude.json:

json
{  "mcpServers": {    "dep-scope": {      "command": "npx",      "args": ["--package=@florianbruniaux/dep-scope", "-y", "dep-scope-mcp"]    }  }}

Claude Desktop — ~/Library/Application Support/Claude/claude_desktop_config.json:

json
{  "mcpServers": {    "dep-scope": {      "command": "npx",      "args": ["--package=@florianbruniaux/dep-scope", "-y", "dep-scope-mcp"]    }  }}

Cursor — ~/.cursor/mcp.json:

json
{  "mcpServers": {    "dep-scope": {      "command": "npx",      "args": ["--package=@florianbruniaux/dep-scope", "-y", "dep-scope-mcp"]    }  }}

Windsurf — ~/.codeium/windsurf/mcp_config.json:

json
{  "mcpServers": {    "dep-scope": {      "command": "npx",      "args": ["--package=@florianbruniaux/dep-scope", "-y", "dep-scope-mcp"]    }  }}

Once connected, you can ask your AI editor to call scan_project or generate_migration_prompt directly mid-session without running any CLI command.

Documentation

Requirements

  • Node.js >= 18.0.0
  • TypeScript/JavaScript project with package.json

Explore the ecosystem

These projects extend the workflow without duplicating this tool:

Browse the complete open-source galaxy

License

MIT

來源:README.md,提交 a7d5db5

工具

0
SourceWeft 尚未在沙箱中啟動過該軟體包,因此其工具未知。

版本歷史

1
  1. v0.4.2最新Sep 16, 2026

評分

已滿足適用檢查項的 50%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分

其他 Scope 整合