NDepend.MCP.Server
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.
claude mcp add --transport stdio ndepend-ndepend.mcp.server %ndp-mcp-svr-dir%\\artifacts\\bin\\NDepend.Mcp.StdioServer\\Debug\\net10.0\\NDepend.Mcp.StdioServer.exe
How to use
The NDepend.MCP.Server provides deep workspace analysis and code inspection capabilities for .NET projects, powered by the NDepend API. It exposes a suite of MCP tools that let an AI agent query code quality, dependencies, metrics, and rules, while performing analyses on-premises. You can register the server in your MCP configuration as a stdio server (or via HTTP SSE) and then issue commands to initialize, analyze, generate reports, query code, and extract metrics. The server integrates with Roslyn Analyzers, ReSharper Inspections, and NDepend rules to deliver structured, rich insights without sending your source code to external services unless you explicitly request fixes.
Typical usage flows include initializing an analysis workspace for a solution, running analyses to refresh data, generating HTML web reports, and performing on-the-fly code queries and quality gate checks. You can also generate custom CQLinq queries or rules to tailor quality gates and queries to your project, and then ask the MCP server to execute those queries against the current workspace.
How to install
Prerequisites:
- .NET development environment (for building and running NDepend MCP components)
- NDepend redistributable (download from ndend.com) and a local machine to run it on
- Access to unzip tools and administrative rights if you install into a protected directory
Step-by-step installation:
- Download the NDepend redistributable from the official site and unzip it to a local directory, referred to as %ndp-mcp-svr-dir% in this guide.
- Unzip the NDepend package into %ndp-mcp-svr-dir%\artifacts\ndepend.
- Run VisualNDepend.exe once to start your evaluation or register a license (required before using NDepend tools).
- Build the MCP server solution: open %ndp-mcp-svr-dir%\NDependsMCP.Server.sln and build the project to generate the stdio and sse server executables.
- Locate the built executables, for example:
- %ndp-mcp-svr-dir%\artifacts\bin\NDepend.Mcp.StdioServer\Debug\net10.0\NDepend.Mcp.StdioServer.exe
- %ndp-mcp-svr-dir%\artifacts\bin\NDepend.Mcp.SseServer\Debug\net10.0\NDepend.Mcp.SseServer.exe
- Ensure your MCP configuration references the correct path to the stdio or sse server. If you’re using stdio, configure the command as shown in the example configuration.
- Start the MCP server and register it in your MCP configuration (as stdio or SSE) to begin querying workspace data.
Additional notes
Tips and common considerations:
- The server runs analysis locally; the LLM only accesses source code when explicitly requesting fixes. Privacy is preserved as mentioned in the README.
- If you modify the solution or licensing state, re-run initialization and analysis to refresh the workspace data.
- For Visual Studio or VS Code users, MCP config files can reside globally or at the solution level, but ensure there are no conflicting entries across configurations.
- When using the stdio server, keep the server executable path stable and accessible from the environment where the MCP runs.
- If you switch solutions, re-run the initialization tool to create or attach the appropriate NDepend project or side-by-side project and then run analysis.
- Use the provided commands for generating web reports and performing code searches to leverage the full feature set (queries, dependencies, metrics, quality gates, and rules).
Related MCP Servers
mssql
MSSQL Server MCP implementation written in C#
McpDotNet.Extensions.SemanticKernel
Microsoft SemanticKernel integration for the Model Context Protocol (MCP). Enables seamless use of MCP tools as AI functions.
DatabaseMcpServer
MCP server from ttcc666/DatabaseMcpServer
mcp-dataverse
MCP Server for querying Dataverse using SQL
xperience-community
ASP.NET Core MCP server for Xperience by Kentico projects
console-to-http
Example of converting a stdio MCP server to HTTP using ModelContextProtocol.AspNetCore