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 集成