DependencyMCP 服务器
模型上下文协议 (MCP) 服务器,用于分析代码库以生成依赖关系图和架构洞察。该服务器有助于理解跨多种编程语言的代码结构、依赖关系和架构模式。
特征
多语言支持:分析 TypeScript、JavaScript、C#、Python 等语言的依赖关系
依赖图生成:以 JSON 或 DOT 格式创建详细的依赖图
架构分析:推断架构层并根据规则进行验证
文件元数据:从源文件中提取导入、导出和其他元数据
评分系统:根据架构规则和模式评估代码库
安装
克隆存储库
安装依赖项:
构建项目:
配置
添加到您的 MCP 设置文件(通常位于 ~/.config/cline/mcp_settings.json 或同等位置):
环境变量:
MAX_LINES_TO_READ:从每个文件读取的最大行数(默认值:1000)
CACHE_DIR:存储依赖项缓存文件的目录(默认值:.dependency-cache)
CACHE_TTL:缓存生存时间(毫秒)(默认值:1 小时 = 3600000)
可用工具
分析依赖关系
分析代码库中的依赖关系并生成依赖关系图。
获取依赖关系图
获取 JSON 或 DOT 格式的代码库依赖关系图。
获取文件元数据
获取有关特定文件的详细元数据。
获取建筑分数
根据架构规则和模式对代码库进行评分。
示例输出
依赖图(JSON)
建筑乐谱
发展
该服务器使用 TypeScript 构建并使用:
Zod 用于模式验证
diff 用于文件比较
minimatch 用于全局模式匹配
项目结构
添加对新语言的支持
要添加对新编程语言的支持:
将文件扩展名添加到默认的
fileTypes
数组在
parseFileImports
和parseFileExports
中实现特定于语言的正则表达式模式将任何特定于语言的架构模式添加到
inferArchitecturalLayer
执照
麻省理工学院
local-only server
The server can only run on the client's local machine because it depends on local resources.
Tools
分析代码库以生成跨多种编程语言的依赖关系图和架构洞察,帮助开发人员理解代码结构并根据架构规则进行验证。
Related Resources
Related MCP Servers
- AsecurityAlicenseAqualityAnalyzes source code dependencies across multiple programming languages in the specified directory to identify file relationships, assisting in dependency management and project structure understanding.Last updated -11MIT License
- -securityAlicense-qualityA Cloudflare Worker that analyzes source code to provide comprehensive explanations including architecture diagrams, core functionality analysis, and component breakdowns across multiple programming languages.Last updated -6Apache 2.0
CodeLogicofficial
AsecurityAlicenseAqualityInteract with CodeLogic, a Software Intelligence platform that graphs complex code and data architecture dependencies, to boost AI accuracy and insight.Last updated -229Mozilla Public License 2.0- AsecurityAlicenseAqualityProvides tools for analyzing project structures, searching through codebases, managing dependencies, and performing file operations with advanced filtering capabilities.Last updated -691MIT License