Logo NDepend MCP Server

NDepend MCP Server

Cộng đồng
ndepend

A suite of MCP tools that provides in-depth workspace analysis, advanced code inspection, and automated code-fix capabilities for .NET projects, built on the NDepend API.

Nhà phát hànhndepend
Kho mãNDepend.MCP.Server
Ngôn ngữC#
Bản fork
7
Sao
44
Công cụ có sẵn
0
Phương thức truyền tảistdio
Liên kết
  • Kết nối công cụ với quy trình làm việc AI

    NDepend MCP Server cung cấp các khả năng MCP mà ứng dụng khách và tác nhân AI tương thích có thể sử dụng.

  • 0 công cụ có sẵn

    Xem các thao tác có thể gọi bên dưới, kèm tên và mô tả nếu máy chủ cung cấp.

  • Cấu hình sẵn để sao chép

    Dùng các đoạn cấu hình cài đặt mẫu để thiết lập máy chủ này trong ứng dụng khách MCP bạn muốn dùng.

  • Chỉ số quan tâm đến mã nguồn mở

    44 sao và 7 bản fork từ kho mã được liên kết.

ndepend-logo MCP-logo

NDepend.MCP.Server

The NDepend.MCP.Server is a Model Context Protocol (MCP) server that delivers deep workspace analysis and advanced code inspection capabilities for .NET projects, powered by the NDepend API.

It turns NDepend's deep code insights into AI-powered actions:

  • Fix one or multiple complex issues automatically
  • Generate code queries or rules on demand
  • Interact with NDepend's rich data using natural language
  • Refactor several files at once to improve code quality and maintainability

Its key strengths are:

  • Privacy: NDepend scan runs entirely on-premises - Your code stays private on your machine
  • Reliability: AI gets reliable, structured data instead of raw file dumps
  • Performance: Faster responses and lower token costs
  • Objectivity: No LLM bias—just NDepend's proven analysis

Since the project is open source, you’re free to adapt and extend the server with MCP tools that fit your workflow.

Features

  • Workspace Overview - Provide the LLM with comprehensive, detailed and unbiased information about your .NET workspace—obtained quickly- without sending source code to the LLM and without consuming tokens.
  • Source Code Analysis - Analyze C# source files, quality, and project structure.
  • Dependency Tracking - Explore project dependencies and generate SVG diagrams of your code.
  • Issues List - Identify code issues from NDepend rules, Roslyn Analyzers, and ReSharper Code Inspections.
  • Issues Fix - Provide rich issue data to guide Copilot and the LLM in suggesting proper fixes (suport complex issue fix involving multiple source files).
  • Generate Web Report - Generate a full NDepend web report and open it in the browser. See sample reports here: https://www.ndepend.com/sample-reports/
  • Generate CQLinq Query and Rule - Guide the LLM in creating custom code queries, rules or quality gates based on your requirements.
  • Answer Complex Request About Your Code - Based on the user request, generate and execute complex queries on-the-fly to inspect:
    • Source code files
    • Code quality (lines of code, comment, complexity, maintainability index, code coverage)
    • Code dependencies (usage, coupling, cohesion, Clean Architecture)
    • Object Oriented usage (inheritance, interface, encapsulation, instantiation, SOLID principles enforcement)
    • Naming of code elements
    • State mutability (fields, properties, events)
    • Changes since a baseline
    • Issues, rules or quality gates status

Watch this video featuring the NDepend MCP Server, including five complete demos and an in-depth guide to creating your own C# MCP Server:

MCP-logo

Build

  • Clone or download this repository into a local folder on your machine (referred to as %ndp-mcp-svr-dir%).

  • First get the NDepend zipped redistributable from: https://www.ndepend.com/download

  • Unzip it in %ndp-mcp-svr-dir%\artifacts\ndepend

    artifacts-ndepend-install

  • REQUIRED: Run VisualNDepend.exe once to start your evaluation or register a license.

  • Then rebuild the solution %ndp-mcp-svr-dir%\NDepend.Mcp.Server.sln (.NET 10.0 required)

  • DLLs and executables built can be found here:

%ndp-mcp-svr-dir%\artifacts\bin\NDepend.Mcp.StdioServer\Debug\net10.0\NDepend.Mcp.StdioServer.exe
%ndp-mcp-svr-dir%\artifacts\bin\NDepend.Mcp.HttpServer\Debug\net10.0\NDepend.Mcp.HttpServer.exe

MCP Server Registration

The image below shows two screenshots—Visual Studio on the left and VS Code on the right. You can register the NDepend MCP Server from either environment using these menus.

ndepend-logo

This will add to the MCP JSON configuration file (for stdio):

json
{
  "inputs": [],
  "servers": {
    "NDepend.Mcp.Server": {
      "type": "stdio",
      "command": "%ndp-mcp-svr-dir%\\\artifacts\\bin\\NDepend.Mcp.StdioServer\\Debug\\net10.0\\NDepend.Mcp.StdioServer.exe",
      "env": {}
    }
  }
}

or for Steamable HTTP

json
{
  "inputs": [],
  "servers": {
    "NDepend.Mcp.Server": {
      "type": "http",
      "url": "http://localhost:3001/mcp"
    }
  }
}

Github Copilot MCP configuration file for Visual Studio 2026 or VSCode can be found here:

C:\Users\%usr%\AppData\Roaming\Code\User\mcp.json - Global configuration for all solutions
[SOLUTIONDIR]\.vs\mcp.json - Visual Studio only, solution-specific, user-specific
[SOLUTIONDIR]\.mcp.json - Solution-level, can be tracked in source control
[SOLUTIONDIR]\.vscode\mcp.json - Supports both VS Code and Visual Studio

Note that if the same MCP server is listed in both a global configuration file and a solution-specific configuration file, Copilot treats them as separate servers, which can cause conflicts.

Logs

  • If an error occurs while using an NDepend MCP tool, check the log files located at:
%ndp-mcp-svr-dir%\artifacts\logs

Usage

Once configured, you can ask questions like:

  • Initialize + Run Analysis + Web Report:
run ndepend analysis
give me analysis details
build an ndepend web report
  • Code query or rule generation to answer a complex request:
list pairs of class that uses each other
which ctor that register to some events in a non disposable class
check for the SOLID open close principle
list methods that are both poorly maintainable and insufficiently tested
find Clean Architecture violations

query-gen

  • Dependencies:
which callers and callees for this class
show a call graph of this method

query-gen

  • Issue list & fix:
which new issue in files named like Period
fix the first one
which code sprawl related issues

fix-issue

  • Metrics:
which complex method poorly covered by tests
list less maintainable methods
  • Quality Gates:
which quality gate fail
which quality gate got fixed since the baseline
  • Rules:
which Roslyn Analyzer fail?
which ndepend rule fail with more than 5 issues
  • Code Search:
which class is related to Authentification
  • Source Files:
which source file changed since the baseline
describe changes in the third one
show diff for the 5 last

14 Exposed MCP Tools

Initialization Tools

  • ndepend-initialize-from-solution: Initialize the NDepend analysis session with a .NET solution file. If an NDepend project (.ndproj file) is attached to the solution, use it. Else create an NDepend project side-by-side with the solution and analyze it.

    Use when:

    • REQUIRED FIRST STEP before using any other NDepend MCP tool
    • Switching to a different solution

Analysis Tools

  • ndepend-run-analysis: Run the NDepend analysis on the initialized workspace and update all session data (dependencies, issues, metrics, etc...). Returns analysis data loaded (snapshot date, baseline snapshot date, .ndar analysis result file...).

    Use when:

    • User explicitly requests: "run analysis", "analyze the code", "refresh results"
    • Post-fix verification: "I fixed the issues, check again"
    • After code changes or recompilation
  • ndepend-run-analysis-build-report: Run the NDepend analysis, update all session data, and build a web report, open it in the browser.

    Use when:

    • User requests: "show me a web report", "generate HTML report", "visualize the analysis"
    • User wants interactive exploration
    • User asks for visual/graphical outputs

Code Metrics Tools

  • ndepend-search-code-metrics: Collect and analyze code metrics for quality assessment.

    Use when:

    • Refactoring Candidates: "Which code is poorly maintainable?"
    • Quality Assessment: "How complex is the UserService class?"
    • Test Coverage Analysis: "Which methods need more tests?"
    • Size & Complexity: "How many lines of code in this class?"
    • Comparison & Prioritization: "Compare metrics across services"

    Also use for code search when:

    • Discovery & Navigation: "Which classes are related to authentication?"
    • Pattern & Convention: "Which classes follow the *Manager pattern?"
    • File-Based: "What's in the UserService.cs file?"
    • Change Tracking: "Which methods were added since the baseline?"

Dependency Analysis Tools

  • ndepend-list-dependencies: Collect and present dependencies for code elements with comprehensive context. Also generate a HTML SVG diagram of the required dependency.

    Use when:

    • Understanding Usage (Callers): "What calls this method?"
    • Understanding Dependencies (Callees): "What does this method call?"
    • Impact Analysis: "If I change this method, what breaks?"
    • Call Chain Exploration: "Show me the full call chain"
    • Refactoring Planning: "Can I safely delete this method?"
    • Architectural Analysis: "Does the UI layer call the database directly?"
    • Debugging & Troubleshooting: "How is this method being invoked?"
    • Code Review: "What's affected by this new method?"

Issue Management Tools

  • ndepend-list-issues: List issues scoped by user's request with comprehensive details.

    Use when:

    • Code Quality & Review: "List issues in this source file"
    • Technical Debt Management: "Show me all technical debt items"
    • Compliance & Standards: "List all coding standard violations"
    • Reporting & Analytics: "Generate a report of all issues by severity"
  • ndepend-get-issue-details-to-fix-it: Retrieve comprehensive diagnostic information for a specific issue.

    Use when:

    • User asks: "How do I fix issue #X?"
    • User requests detailed information about an issue
    • User wants want the Copilot to fix the issue

Rule Management Tools

  • ndepend-list-all-rules-summary: Return hierarchical categorized summary of all rules in the current project, with each the number of issues found.

    Use when:

    • Discover available rules before calling ndepend-list-rules-detailed or ndepend-list-issues
    • Identify valid values for filterRuleCategories and filterRuleIds before calling ndepend-list-rules-detailed or ndepend-list-issues
    • Audit and governance
  • ndepend-list-rules-detailed: Return paginated list of rules with descriptions and fix guidance.

    Use when:

    • Understanding what a specific rule checks
    • Learning how to fix violations
    • Exploring rule documentation
    • After calling ndepend-list-all-rules-summary to get detailed info

Quality Gate Tools

  • ndepend-list-quality-gates-status: Return status of each quality gate to assess code quality standards.

    Use when:

    • Status Checks: "Did the code pass quality gates?"
    • Failure Investigation: "Which quality gates are failing?"
    • Specific Gate Queries: "Did we pass the test coverage gate?"
    • Pre-Merge Validation: "Can I merge this PR?"
    • Threshold Details: "What are the quality gate thresholds?"
    • Comparison & Trends: "How does this compare to the baseline?"
    • Team Standards: "What quality gates do we have?"
    • Debugging Build Issues: "Why is the build blocked?"

Source Code Tools

  • ndepend-get-sources: Retrieve source code as raw text from NDepend.

    Use when:

    • Viewing Code: "Show me the code for UserService.Authenticate"
    • Understanding Implementation: "How is this method implemented?"
    • Code Review: "Review the code for this method"
    • Debugging & Troubleshooting: "Show me where the error occurs"
    • Learning & Examples: "Show me an example of dependency injection"
    • Refactoring Analysis: "Show me the code before I refactor it"
    • Following Up on Other Tools: "Show me the code with low maintainability"
  • ndepend-diff-sources: Invokes NDepend's diff action to compare a source file's current content against its baseline using the configured source compare tool.

    Use when:

    • "Show me the before and after"
    • "compare with the old version"
    • "What's changed in this method?"
    • "show differences since baseline"

Code Query Tools

  • ndepend-gen-code-query-and-rule: Provide prompts to the LLM to make it an expert in code queries and rule generation. The LLM first identifies the code querying features it needs based on the user’s request, then it calls this tool to obtain a prompt for each feature choosen.

    Use when:

    • ALWAYS when user requests an NDepend code query or code rule
    • Complex codebase analysis that can't be handled by other tools

    Available code query kind prompts:

    • code-query-list: Returns collection of code elements with properties
    • code-rule: Quality rule identifying violations
    • quality-gate: Quality criterion with WARN/FAIL thresholds
    • querying-issue-rule: Selects issues and rules
    • trend-metric: Scalar value stored over time to plot chart
    • code-query-scalar: Returns single numeric value

    Available features prompts:

    • code-query-essential (ALWAYS REQUIRED)
    • line-of-code, maintainability, complexity, coverage, comment
    • usage-dependency, parent-children-relationship, inheritance-and-base-class, interface
    • solid-principles, clean-architecture, encapsulation-and-visibility, state-mutability
    • diff-since-baseline, naming, attribute, source-file-declaration
    • event-pattern, constructor-instantiation
  • ndepend-run-code-query-or-rule: Compile and execute code query or rule against the session's analysis result and baseline.

    Use when:

    • After generating a query
    • User requests execution
    • Complex codebase analysis requiring custom queries

    Also use to check whether a generated query compiles (parameters compileOnly set to True). If the query fails to compile, an McpException is thrown containing the compilation errors in its message, allowing the LLM to correct them.

Requirements

  • Windows, Linux or MacOS

  • .NET 10.0 or higher

  • ModelContextProtocol NuGet package (loaded at build time)

  • NDepend version 2026.1.3 or upper redistributable (evaluation or license)

    Note

    This project is open source, but it relies on the NDepend.API, which requires a separate license (either a free evaluation or a paid license) to use.

Contributing

Contributions are welcome! Please feel free to submit pull requests or open issues.

License

This project is open source under the MIT License. It depends on the proprietary NDepend.API (https://www.ndepend.com/) which must be obtained separately (evaluation or license). No rights to the NDepend API are granted by this project.

Dùng MCP NDepend MCP Server với nhiều mô hình AI

TypingMind kết nối các công cụ MCP ở cấp không gian làm việc, nên sau khi kết nối NDepend MCP Server, bạn có thể dùng với nhiều mô hình AI khác nhau trong TypingMind thay vì phải thiết lập riêng cho từng mô hình. MCP này chạy cục bộ thông qua trình kết nối MCP của TypingMind trên thiết bị của bạn.

Hướng dẫn thiết lập để dùng trình kết nối cục bộ

Dùng cách này khi máy chủ MCP cần truy cập các tệp, ứng dụng hoặc tài nguyên riêng tư trên máy tính của bạn.

1

Mở cài đặt MCP

Trong TypingMind, vào Cài đặt, Cài đặt nâng cao, rồi đến Giao thức ngữ cảnh mô hình và chọn Cài trình kết nối.

  1. Mở TypingMind trong trình duyệt của bạn.
  2. Nhấp vào biểu tượng Cài đặt.
  3. Vào Cài đặt nâng cao.
  4. Mở mục Giao thức ngữ cảnh mô hình.
  5. Nhấp vào Cài trình kết nối rồi chọn Thiết bị này.
Màn hình thiết lập trình kết nối MCP của TypingMind với tùy chọn Thiết bị này được chọn
2

Chạy lệnh trình kết nối

Chọn Thiết bị này, sao chép lệnh từ TypingMind và chạy trong Terminal. Giữ tiến trình chạy trong khi bạn dùng MCP.

  1. Sao chép lệnh thiết lập hiển thị trong TypingMind.
  2. Mở Terminal trên macOS hoặc Windows Terminal trên Windows.
  3. Dán và chạy lệnh.
  4. Xác nhận cài đặt gói nếu Terminal hỏi bạn có muốn tiếp tục không.
  5. Giữ tiến trình trong cửa sổ Terminal chạy trong khi dùng các công cụ MCP.
3

Thêm NDepend MCP Server làm máy chủ

Khi trạng thái trình kết nối là Sẵn sàng, nhấp vào Sửa máy chủ và dán cấu hình máy chủ MCP.

  1. Đợi đến khi trạng thái trình kết nối hiển thị Sẵn sàng.
  2. Nhấp vào Sửa máy chủ.
  3. Dán cấu hình máy chủ MCP của NDepend MCP Server.
  4. Lưu danh sách máy chủ.
  5. Làm mới nếu bạn muốn xác nhận trình kết nối vẫn sẵn sàng.
Cài đặt MCP của TypingMind hiển thị máy chủ đang hoạt động và nút Sửa máy chủ
{
  "mcpServers": {
    "ndepend-mcp-server": {
      "command": "npx",
      "args": [
        "-y",
        "<mcp-server-package>"
      ]
    }
  }
}
4

Dùng kết nối với nhiều mô hình

Lưu danh sách máy chủ, mở Plugin, bật các công cụ MCP của NDepend MCP Server, sau đó chọn bất kỳ mô hình AI nào được hỗ trợ trong TypingMind và dùng các công cụ trong cuộc trò chuyện hoặc gán chúng cho một tác nhân AI.

  1. Mở trang Plugin trong TypingMind.
  2. Bật các công cụ MCP của NDepend MCP Server.
  3. Bắt đầu cuộc trò chuyện và chọn mô hình AI bạn muốn dùng.
  4. Dùng các công cụ MCP trong cuộc trò chuyện hoặc gán chúng cho một tác nhân AI.
  5. Chuyển sang mô hình AI khác bất cứ khi nào cần mà không phải kết nối lại MCP.
Cuộc trò chuyện TypingMind dùng các công cụ MCP đã bật với một mô hình AI được chọn
Bạn có thể dùng NDepend MCP Server giúp tôi làm việc này không?
NDepend MCP Server
Được. Tôi đã đọc.
Đây là kết quả tôi tìm được bằng NDepend MCP Server.

Câu hỏi thường gặp

Máy chủ MCP NDepend MCP Server dùng để làm gì?

NDepend MCP Server là máy chủ MCP cho phép các ứng dụng AI tương thích kết nối với công cụ và ngữ cảnh bên ngoài. Trong TypingMind, bạn chỉ cần thêm máy chủ MCP này một lần để các công cụ của nó có sẵn trong không gian làm việc AI của bạn.

Bạn có thể dùng MCP NDepend MCP Server với nhiều mô hình AI trong TypingMind không?

Có. TypingMind kết nối các công cụ MCP ở cấp không gian làm việc, nên bạn có thể dùng NDepend MCP Server với nhiều mô hình AI như Claude, ChatGPT, Gemini hoặc các mô hình khác đã cấu hình trong TypingMind mà không cần thiết lập máy chủ MCP riêng cho từng mô hình.

Vì sao nên dùng MCP NDepend MCP Server với TypingMind?

TypingMind là một trong những giao diện trò chuyện với LLM tốt nhất vì tập hợp nhiều mô hình AI, prompt, plugin, tác nhân AI, khóa API và công cụ MCP vào một không gian làm việc. Khi kết nối NDepend MCP Server, bạn có thể dùng các công cụ MCP của dịch vụ này với những mô hình ưa thích, đồng thời giữ quy trình trò chuyện gọn gàng trong TypingMind.

Làm cách nào để kết nối MCP NDepend MCP Server với TypingMind?

NDepend MCP Server hoạt động thông qua trình kết nối MCP cục bộ của TypingMind. Đây là lựa chọn phù hợp nhất khi máy chủ MCP cần truy cập tệp cục bộ, ứng dụng máy tính, công cụ dòng lệnh hoặc tài nguyên riêng trên máy tính của bạn.

MCP NDepend MCP Server cung cấp những công cụ nào trong TypingMind?

NDepend MCP Server cung cấp các chức năng MCP mà bạn có thể bật từ trang Plugin của TypingMind để dùng trong trò chuyện hoặc gán cho tác nhân AI.

Bạn có cần chia sẻ khóa API với TypingMind để dùng MCP NDepend MCP Server không?

Không. TypingMind ưu tiên xử lý cục bộ và cho phép bạn kiểm soát nhà cung cấp mô hình, khóa API, prompt và cấu hình MCP. Nếu NDepend MCP Server yêu cầu xác thực, hãy thêm các header, cài đặt OAuth hoặc cấu hình cục bộ cần thiết cho máy chủ MCP đó khi tạo kết nối.

Máy chủ MCP liên quan

Xem tất cả

Tạo ngay không gian làm việc AI riêng

Đăng ký bản tin của chúng tôi để nhận thông báo về tính năng mới và các đợt tặng quà sắp tới 👇