Token导航 LogoToken导航TokenDH.com
whobreaks (F1729) logo
开发工具stdio官方级别未说明来源级核验

whobreaks (F1729)

MCP Server

whobreaks

whobreaks是一款实时构建代码库依赖图并分析变更影响的工具,可作为CLI、HTTP API和MCP服务器使用,帮助开发者和AI工具在修改代码前评估影响范围。

工具数

3

提示词数

0

GitHub Stars

3

资源数

0
代码分析开发工具TypeScriptClaude实时监控ClaudeCursorWindsurf

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

作者 / 组织

f1729

提供方

f1729

最后核验

2026/5/17 20:23

运行时

Node.js

快速接入

先看主来源和安装命令,再打开仓库或文档;下面只保留这个条目的关键接入事实。

命令预览

npx whobreaks .

详细介绍

whobreaks

在触碰文件之前,找出什么会破裂。

whobreaks 构建代码库的实时依赖关系图,并在您进行更改之前告诉您任何更改的爆炸半径。可作为人工智能编码工具的CLI、HTTP API和MCP服务器使用。

# Without whobreaks:
AI edits UserService.ts → breaks 14 files → you spend 2 hours fixing

# With whobreaks:
AI queries whobreaks first → knows 14 files depend on UserService → makes safe changes

______________________________________________________________________

快速开始

npx whobreaks .
  ╭──────────────────────────────────────╮
  │  💥 whobreaks v0.1.0                 │
  │  Scanning your codebase...           │
  ╰──────────────────────────────────────╯

  📁 Found 247 files
  ⏱️  Analyzed in 1.2s

  ┌─ Summary ──────────────────────────────┐
  │                                        │
  │  Files:              247               │
  │  Edges:            1,847               │
  │  Avg depth:          4.2               │
  │  Max depth:           11               │
  │                                        │
  └────────────────────────────────────────┘

  ⚠️  Issues Found:

  🔄 Circular Dependencies (3)
     src/services/auth.ts ↔ src/services/user.ts
     src/models/order.ts → src/models/product.ts → src/models/order.ts

  🏝️  Orphan Files — imported by nothing (12)
     src/utils/old-helpers.ts
     src/components/DeprecatedButton.tsx

  🕸️  God Modules — imported by 20+ files (2)
     src/utils/helpers.ts        → 89 dependents
     src/lib/api-client.ts       → 47 dependents

  💣 High-Impact Files — editing these affects the most files
     src/types/index.ts          → 142 files affected
     src/utils/helpers.ts        → 89 files affected

  📁 Output: .whobreaks/graph.json

______________________________________________________________________

MCP设置

whobreaks作为MCP服务器运行,因此AI工具(Claude Code、Cursor、Windsurf)可以在编辑文件之前查询它。设置一次;AI会自动使用它。

克劳德代码

claude mcp add whobreaks npx whobreaks mcp

就是这样。验证:

claude mcp list
# whobreaks: npx whobreaks mcp

光标

创建 .cursor/mcp.json 在项目根目录中:

{
  "mcpServers": {
    "whobreaks": {
      "command": "npx",
      "args": ["whobreaks", "mcp"]
    }
  }
}

VS代码(副驾驶/GitHub副驾驶聊天)

创建 .vscode/mcp.json 在项目根目录中:

{
  "servers": {
    "whobreaks": {
      "type": "stdio",
      "command": "npx",
      "args": ["whobreaks", "mcp"]
    }
  }
}

帆板运动

创建 .windsurf/mcp_config.json 在项目根目录中:

{
  "mcpServers": {
    "whobreaks": {
      "command": "npx",
      "args": ["whobreaks", "mcp"]
    }
  }
}

______________________________________________________________________

告诉AI使用它(CLAUDE.md/.cursorules)

把这个放在你的 CLAUDE.md.cursorrules:

## Architectural awareness

This project has whobreaks running as an MCP server.

Before editing any file, call:
- `get_impact` — see how many files depend on it and which exports are critical
- `get_context` — understand what it imports/exports and its risk level

Before creating a new file or moving an export, call:
- `find_related` — check if similar functionality already exists

Files with 20+ dependents are god modules — treat export changes as breaking changes.
Files in circular dependencies require extra care — changes propagate in both directions.

______________________________________________________________________

可用的MCP工具

工具何时使用
get_impact在编辑任何文件之前,请参阅直接+传递依赖项和关键导出
get_context编辑前——全貌:进口、出口、风险水平、行数
find_related在创建新内容之前,请检查它是否已经存在
get_impact("src/services/user.ts")
→ Editing this file will affect 14 files:
  Direct dependents (3): auth.ts, dashboard.ts, settings.ts
  Transitive (11): app.tsx, router.ts, ... +9 more
  High-usage exports: getUserById, UserSchema

get_context("src/services/user.ts")
→ ## src/services/user.ts
  Imports from (2): db/client.ts, utils/crypto.ts
  Imported by (3): auth.ts, dashboard.ts, settings.ts
  Exports: getUserById (function), UserSchema (type), updateUser (function)
  Risk level: MEDIUM (3 dependents)
  Lines: 187

______________________________________________________________________

观看模式+实时仪表板

npx whobreaks watch . --port 3001

启动文件监视器和HTTP服务器。打开 http://localhost:3001 用于交互式依赖关系图仪表板。

文件更改时,仪表板会自动重新加载。每个节点的大小按依赖计数确定,按风险着色,并可点击以查看完整的影响分析面板。

______________________________________________________________________

HTTP API

运行时可用 whobreaks watchwhobreaks . --port .

端点描述
GET /交互式仪表板
GET /health状态、文件计数、边缘计数、上次更新
GET /graph完整依赖关系图(JSON)
GET /summary架构摘要(通告、孤儿、上帝模块)
GET /impact?file=src/foo.ts影响分析——如果情况发生变化,会发生什么
GET /dependents?file=src/foo.ts导入此文件的文件
GET /dependencies?file=src/foo.ts此文件导入的文件
GET /node?file=src/foo.ts带导出列表的完整节点记录

______________________________________________________________________

输出文件

每次扫描都会写入 .whobreaks/ 在项目根目录中:

文件内容
graph.json完全依赖图,机器可读
summary.md人类可读架构概述

添加 .whobreaks/.gitignore 或承诺 summary.md 作为活的文件。

______________________________________________________________________

命令

npx whobreaks [path]              # One-shot scan (default: current directory)
npx whobreaks watch [path]        # Watch mode + HTTP API + dashboard
npx whobreaks mcp                 # MCP server (uses current directory)

选项:

标志默认值描述
--port 3001HTTP服务器端口(监视模式)
--max-files 无限制已扫描的Cap文件(适用于大型monorepos)
--help显示帮助

______________________________________________________________________

运作原理

┌─────────────────────────────────────────────────┐
│                  whobreaks                       │
│                                                  │
│  ┌──────────┐  ┌──────────┐  ┌──────────────┐  │
│  │  Watcher  │→│ Analyzer  │→│  Graph Store  │  │
│  │(chokidar) │ │ (regex)   │ │ (in-memory)   │  │
│  └──────────┘  └──────────┘  └──────────────┘  │
│                                     │           │
│                          ┌──────────┴────┐      │
│                          │               │      │
│                    ┌─────▼──┐    ┌───────▼──┐   │
│                    │  CLI   │    │ MCP/HTTP  │   │
│                    │ Output │    │  Server   │   │
│                    └────────┘    └──────────┘   │
│                                                  │
│              ┌──────────────────┐                │
│              │  Web Dashboard   │                │
│              │ (D3 force graph) │                │
│              └──────────────────┘                │
└─────────────────────────────────────────────────┘
  • 观察者监视器 手表 **/*.{ts,tsx,js,jsx},消除快速变化
  • 分析器 --基于正则表达式的原始源文本导入/导出提取。删除评论、摘录 import/export 语句,通过以下方式解析说明符 tsconfig.json 路径、工作区包名和文件系统探测。没有编译器开销——在约2.5秒内扫描2500个文件。
  • 图形存储 --在记忆中 Map 具有正向和反向索引。文件更改时的增量更新。
  • MCP服务器@模型上下文协议/sdk 将图形暴露给Claude Code、Cursor、Windsurf和任何兼容MCP的客户端。
  • 仪表盘 --单个HTML文件,D3强制导向图,由内置的HTTP服务器提供服务。无构建步骤。

______________________________________________________________________

与替代品相比

工具弱点vs破发
code-graph-context需要Docker+Neo4j+OpenAI密钥
typescript-graph只需一次拍摄,无观看模式,无人工智能集成
madge仅检测循环存款,不进行影响分析
ts-codebase-analyzer仅限库——无CLI、无监视、无MCP

whobreaks: npx whobreaks . -没有Docker,没有API密钥,没有数据库。零配置。

______________________________________________________________________

发展

git clone https://github.com/f1729/whobreaks
cd whobreaks
npm install
npm run build
node dist/index.js .
npm run dev    # tsc --watch

______________________________________________________________________

许可证

麻省理工学院

目录标签

目录标签

代码分析开发工具TypeScriptClaude实时监控本地部署依赖管理AI辅助编程

支持客户端

ClaudeCursorWindsurf

接入字段

传输方式(transport,传输协议)

stdio

鉴权方式(authType,认证方式)

none

运行时(runtime,运行环境)

Node.js

来源包(packageName,安装包名)

whobreaks

工具数量(toolCount,工具数)

3

资源数量(resourceCount,资源数)

0

提示词数量(promptCount,提示词数)

0

权限和风险

stdionone部署方式未说明

接入前请确认传输方式、认证方式和部署位置,并根据实际工具能力限制访问范围。

安装前确认

不要直接授予不必要的文件、网络或账号权限;先核对安装命令和配置内容。

来源信息

继续浏览同类 MCP