️⃣ 🏠 🍎 🪟 🐧 - Type information from .NET projects: assembly exploration, namespace discovery, type reflection…
.NET Types Explorer MCP Server
以下摘录自该仓库的 README(片段) · 在 GitHub 读完整 README →
A Model Context Protocol (MCP) server that provides detailed type information from .NET projects for AI coding agents.
Overview
The .NET Types Explorer MCP Server is a powerful tool designed to help AI coding agents understand and work with .NET codebases.
It provides a structured way to explore assemblies, namespaces, and types in .NET projects, making it easier for AI agents to generate accurate and context-aware code suggestions.
The server uses reflection to extract detailed type information from compiled .NET assemblies, including classes, interfaces, methods, properties, fields, and events.
This information is then made available through a set of tools that can be used by AI agents to explore the codebase in a systematic way.
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
Features
- **Assembly Exploration**: Retrieve a list of all assemblies referenced by a .NET project
- **Namespace Exploration**: Discover all namespaces within specified assemblies
- **Type Exploration**: Get detailed information about types within specified namespaces, including:
- Full type names with generic parameters
- Implemented interfaces
- Constructors with parameters
- Methods with return types and parameters
- Properties with types and accessors
- Fields with types and modifiers
- Events with handler types
- **NuGet Package Search**: Search for NuGet packages on nuget.org with filtering and pagination
- **NuGet Package Version Information**: Retrieve version history and dependency information for specific NuGet packages
- **Configurable Assembly Resolution**: Resolve assemblies from build output, NuGet global packages cache (restore-only, no build required), or automatically try both
- **Filtering**: Apply wildcard filters to narrow down results
- **Pagination**: Handle large result sets with built-in pagination
Roadmap
- [x] Add NuGet integration to provide information about actual package versions
- [x] Migrate to official Model Context Protocol C# SDK (modelcontextprotocol/csharp-sdk)
- [x] Support for multiple NuGet package sources (custom/private feeds)
- [ ] Add dependency graph building capabilities
- [ ] Improve multi-project scenario
Prerequisites
- .NET 10.0 SDK or later
- A .NET project that you want to explore
Configuration
NuGet Package Sources
The server supports querying multiple NuGet package sources simultaneously. Configure custom sources in appsettings.json:
**Configuration Options:**
- **Name**: Friendly name for the package source
- **Url**: Full URL to the NuGet v3 API endpoint (must end with /v3/index.json)
- **Enabled**: Set to false to temporarily disable a source without removing it
**Behavior:**
- All enabled sources are queried in parallel for better performance
- Results are automatically deduplicated by package ID and version
- If one source fails, the server continues with the remaining sources
- **Default source behavior**: nuget.org is added ONLY if no sources are configured in appsettings.json
**Source Priority and Deduplication:**
When the same package is found in multiple sources, the server uses a **priority-based strategy**:
1. **Priority is determined by order**: Sources listed first in configuration have **higher priority**
2. **Deterministic results**: The first source in the list always takes precedence for duplicate packages
3. **Parallel queries**: Despite parallel execution, results are processed in priority order
4. **Metadata consistency**: Package metadata (description, download count, etc.) always comes from the highest priority source containing that package
**Example:**
In this configuration, if a package exists in both sources, information from "Internal" will be used.
Assembly Resolution Mode
The server supports different strategies for locating package assemblies. Configure this in appsettings.json:
| Mode | Behavior |
|-|-|
| BuildOutput | Default. Resolve assemblies from the build output directory (e.g. bin/Debug/net10.0/). Requires a full build. |