Skip to main content
Glama

DependencyMCP Server

by mkearl

DependencyMCP 서버

코드베이스를 분석하여 종속성 그래프와 아키텍처 통찰력을 생성하는 모델 컨텍스트 프로토콜(MCP) 서버입니다. 이 서버는 여러 프로그래밍 언어의 코드 구조, 종속성 및 아키텍처 패턴을 이해하는 데 도움을 줍니다.

특징

  • 다국어 지원 : TypeScript, JavaScript, C#, Python 등의 종속성을 분석합니다.
  • 종속성 그래프 생성 : JSON 또는 DOT 형식으로 자세한 종속성 그래프를 생성합니다.
  • 아키텍처 분석 : 아키텍처 계층을 추론하고 규칙에 따라 검증합니다.
  • 파일 메타데이터 : 소스 파일에서 가져오기, 내보내기 및 기타 메타데이터를 추출합니다.
  • 점수 시스템 : 코드베이스를 아키텍처 규칙 및 패턴에 따라 평가합니다.

설치

  1. 저장소를 복제합니다
  2. 종속성 설치:

지엑스피1

  1. 프로젝트를 빌드하세요:
npm run build

구성

MCP 설정 파일(일반적으로 ~/.config/cline/mcp_settings.json 또는 이와 동등한 위치에 있음)에 다음을 추가합니다.

json { mcpServers: { \DependencyMCP: { \command: \node, \args: [\path/to/dependency-mcp/dist/index.js], \env: { \MAX_LINES_TO_READ: \1000, \CACHE_DIR: \path/to/dependency-mcp/.dependency-cache, \CACHE_TTL: \3600000 } } }

환경 변수:

  • MAX_LINES_TO_READ: 각 파일에서 읽을 수 있는 최대 줄 수(기본값: 1000)
  • CACHE_DIR: 종속성 캐시 파일을 저장할 디렉토리(기본값: .dependency-cache)
  • CACHE_TTL: 캐시 수명(밀리초)(기본값: 1시간 = 3600000)

사용 가능한 도구

종속성 분석

코드베이스의 종속성을 분석하고 종속성 그래프를 생성합니다.

const result = await client.callTool("DependencyMCP", "analyze_dependencies", { path: "/path/to/project", excludePatterns: ["node_modules", "dist"], // optional maxDepth: 10, // optional fileTypes: [".ts", ".js", ".cs"] // optional });

get_dependency_graph

JSON 또는 DOT 형식으로 코드베이스의 종속성 그래프를 가져옵니다.

const result = await client.callTool("DependencyMCP", "get_dependency_graph", { path: "/path/to/project", format: "dot" // or "json" (default) });

파일_메타데이터 가져오기

특정 파일에 대한 자세한 메타데이터를 가져옵니다.

const result = await client.callTool("DependencyMCP", "get_file_metadata", { path: "/path/to/file.ts" });

아키텍처 점수 얻기

코드베이스를 아키텍처 규칙과 패턴에 맞춰 평가합니다.

const result = await client.callTool("DependencyMCP", "get_architectural_score", { path: "/path/to/project", rules: [ { pattern: "src/domain/**/*", allowed: ["src/domain/**/*"], forbidden: ["src/infrastructure/**/*"] } ] });

출력 예

종속성 그래프(JSON)

{ "src/index.ts": { "path": "src/index.ts", "imports": ["./utils", "./services/parser"], "exports": ["analyze", "generateGraph"], "namespaces": [], "architecturalLayer": "Infrastructure", "dependencies": ["src/utils.ts", "src/services/parser.ts"], "dependents": [] } }

건축 점수

{ "score": 85, "violations": [ "src/domain/user.ts -> src/infrastructure/database.ts violates architectural rules" ], "details": "Score starts at 100 and deducts 5 points per violation" }

개발

서버는 TypeScript로 구축되었으며 다음을 사용합니다.

  • 스키마 검증을 위한 Zod
  • 파일 비교를 위한 diff
  • 글로브 패턴 매칭을 위한 미니매치

프로젝트 구조

dependency-mcp/ ├── src/ │ └── index.mts # Main server implementation ├── package.json ├── tsconfig.json └── README.md

새로운 언어에 대한 지원 추가

새로운 프로그래밍 언어에 대한 지원을 추가하려면:

  1. 기본 fileTypes 배열에 파일 확장자 추가
  2. parseFileImportsparseFileExports 에서 언어별 정규식 패턴 구현
  3. inferArchitecturalLayer 에 언어별 아키텍처 패턴을 추가합니다.

특허

MIT

-
security - not tested
F
license - not found
-
quality - not tested

local-only server

The server can only run on the client's local machine because it depends on local resources.

여러 프로그래밍 언어에 대한 종속성 그래프와 아키텍처 통찰력을 생성하기 위해 코드베이스를 분석하여 개발자가 코드 구조를 이해하고 아키텍처 규칙에 따라 검증할 수 있도록 돕습니다.

  1. 특징
    1. 설치
      1. 구성
        1. 사용 가능한 도구
          1. 종속성 분석
          2. get\_dependency\_graph
          3. 파일\_메타데이터 가져오기
          4. 아키텍처 점수 얻기
        2. 출력 예
          1. 종속성 그래프(JSON)
          2. 건축 점수
        3. 개발
          1. 프로젝트 구조
          2. 새로운 언어에 대한 지원 추가
        4. 특허

          Related MCP Servers

          • A
            security
            A
            license
            A
            quality
            Analyzes 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 -
            1
            Python
            MIT License
          • -
            security
            A
            license
            -
            quality
            A Model Context Protocol tool for analyzing code repositories, performing security scans, and assessing code quality across multiple programming languages.
            Last updated -
            Python
            MIT License
            • Apple
            • Linux
          • -
            security
            A
            license
            -
            quality
            A 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 -
            2
            TypeScript
            Apache 2.0
          • -
            security
            F
            license
            -
            quality
            A server component of the Model Context Protocol that provides intelligent analysis of codebases using vector search and machine learning to understand code patterns, architectural decisions, and documentation.
            Last updated -
            4
            Python

          View all related MCP servers

          MCP directory API

          We provide all the information about MCP servers via our MCP API.

          curl -X GET 'https://glama.ai/api/mcp/v1/servers/mkearl/dependency-mcp'

          If you have feedback or need assistance with the MCP directory API, please join our Discord server