DotNetMetadataMcpServer
A Model Context Protocol (MCP) server that provides detailed type information from .NET projects for AI coding agents.
claude mcp add --transport stdio v0v1kkk-dotnetmetadatamcpserver /path/to/DotNetMetadataMcpServer --homeEnvVariable /home/user \ --env DOTNET_HOME="Path to the directory containing the published executable, or environment containing the executable"
How to use
The .NET Types Explorer MCP Server exposes a set of tools that let an AI agent explore a .NET codebase. It can inspect assemblies referenced by a project, enumerate namespaces within those assemblies, and drill into individual types to surface detailed information such as full type names (including generics), implemented interfaces, constructors and their parameters, methods with return types and parameter lists, properties and their types, fields with modifiers, and events with their handler types. In addition to type exploration, the server provides NuGet package search and version information, enabling agents to discover relevant dependencies and their metadata. The server supports configurable assembly resolution to either use the build output, the NuGet cache, or a combination, and includes filtering and pagination to handle large results. With these capabilities, an AI agent can build an accurate, context-rich understanding of a .NET codebase, making it easier to generate precise code suggestions and navigate complex projects.
How to install
Prerequisites:
- .NET 9.0 SDK or later
- Access to a .NET project you want to explore (for local native installation) or familiarity with running Docker images
Option 1: Native Installation
- Clone the repository: git clone <repository-url>
- Build the project: dotnet build -c Release
- Publish the project: dotnet publish -c Release -r <runtime-identifier> --self-contained false Replace <runtime-identifier> with your target platform (e.g., win-x64, linux-x64, osx-x64).
Option 2: Docker
- Pull the image from Docker Hub: docker pull vrogozhin/dotnet-types-explorer-mcp:latest
- Or build locally: git clone https://github.com/V0v1kkk/DotNetMetadataMcpServer.git cd DotNetMetadataMcpServer docker build -t dotnet-types-explorer-mcp .
- Run the container: docker run --rm -i -v /path/to/your/dotnet/projects:/workspace vrogozhin/dotnet-types-explorer-mcp:latest
If you prefer native mode, ensure the published executable path is correctly referenced in the MCP configuration.
Additional notes
Tips and notes:
- Prerequisites in appsettings.json: You can configure multiple NuGet sources and adjust AssemblyResolutionMode (BuildOutput, NuGetCache, Auto). See the NuGet sources and AssemblyResolutionMode sections in the README for details.
- NuGet sources are queried in parallel, but results are deduplicated and presented with priority-based metadata from the highest-priority source containing a package.
- When using Docker, you can map your dotnet projects directory to /workspace inside the container to simplify access to projects during exploration.
- For native deployment, point the mcpServers configuration to the published executable path and provide any necessary environment variables (e.g., home directory, runtime options).
- If you run into permissions or path issues, verify that the executable has execute permissions and that the container or host process can access the mapped workspace.
- The server supports filtering and pagination to manage large result sets when listing assemblies, namespaces, types, or NuGet results.
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