A Model Context Protocol (MCP) server for .NET assembly and NuGet package inspection. Helps AI coding agents understand .NET APIs accurately and resolve build errors.
$ dotnet add package HandMirrorMcp
A Model Context Protocol (MCP) server for .NET assembly and NuGet package inspection. HandMirror helps AI coding agents understand .NET APIs accurately and resolve build errors by providing direct access to assembly metadata and NuGet package information.
AI coding assistants often hallucinate or guess API details, leading to build errors and wasted development iterations. HandMirror solves this by:
inspect_assembly - Full analysis of all public types, members, and attributes with XML documentationlist_namespaces - List all namespaces in an assemblyget_type_info - Get detailed information about a specific typesearch_nuget_packages - Search for packages by keywordget_nuget_package_info - Get package metadata and dependenciesget_nuget_package_versions - List all available versionsinspect_nuget_package - Analyze assemblies in a packageinspect_nuget_package_type - Get detailed type info from a packagelist_nuget_sources - List configured NuGet package sourcesclear_nuget_cache - Clear the local NuGet package cacheget_nuget_vulnerabilities - Check for known security vulnerabilitiesinspect_nupkg_contents - Inspect contents of a .nupkg fileextract_nupkg_file - Extract specific files from a .nupkginspect_native_dependencies - Find P/Invoke (DllImport/LibraryImport) and COM types in an assemblyanalyze_csproj - Analyze .NET project files and identify issuesanalyze_solution - Analyze solution filesexplain_build_error - Get explanations for common build errorsanalyze_file_based_app - Analyze file-based appsanalyze_config_file - Analyze configuration filesanalyze_packages_config - Analyze packages.config filesget_system_info - Get system information (OS, .NET runtime, hardware)get_dotnet_info - Get detailed .NET installation informationgit clone https://github.com/rkttu/HandMirrorMcp.git
cd HandMirrorMcp
dotnet build
dotnet run --project HandMirrorMcp
Add the following to your Claude Desktop configuration file:
Windows: %APPDATA%\Claude\claude_desktop_config.json
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
{
"mcpServers": {
"handmirror": {
"command": "dotnet",
"args": ["run", "--project", "C:\\path\\to\\HandMirrorMcp"]
}
}
}
Or if you've built the project:
{
"mcpServers": {
"handmirror": {
"command": "C:\\path\\to\\HandMirrorMcp\\bin\\Debug\\net8.0\\HandMirrorMcp.exe"
}
}
}
Add to your VS Code settings or workspace settings:
{
"servers": {
"handmirror": {
"command": "dotnet",
"args": ["run", "--project", "/path/to/HandMirrorMcp"]
}
}
}
When you need to use an unfamiliar .NET API:
Use inspect_nuget_package_type to show me the HttpClient class from System.Net.Http
When you encounter errors like CS0246, CS1061, or CS7036:
I'm getting CS1061 error. Use inspect_nuget_package to check the Newtonsoft.Json package
and show me the available methods on JObject
Search for packages related to "json serialization" and show me the top results
Check if there are any known vulnerabilities in System.Text.Json version 6.0.0
Analyze my .csproj file at C:\MyProject\MyProject.csproj and identify any issues
HandMirrorMcp/
├── Constants/
│ └── Emoji.cs # Unicode emoji constants for output formatting
├── Prompts/
│ ├── AssemblyInspectorPrompts.cs
│ └── NuGetInspectorPrompts.cs
├── Services/
│ ├── NuGetService.cs # NuGet package operations
│ ├── PeAnalyzerService.cs # PE file analysis
│ ├── RepositoryService.cs # Repository operations
│ └── XmlDocService.cs # XML documentation parsing
├── Tools/
│ ├── AssemblyInspectorTool.cs
│ ├── InteropInspectorTool.cs
│ ├── NuGetInspectorTool.cs
│ ├── ProjectAnalyzerTool.cs
│ └── SystemInfoTool.cs
└── Program.cs
Run the test suite:
dotnet test
The tests use MSTest and connect to the actual MCP server for integration testing.
Contributions are welcome! Please feel free to submit a Pull Request.
git checkout -b feature/AmazingFeature)git commit -m 'Add some AmazingFeature')git push origin feature/AmazingFeature)This project is licensed under the Apache License 2.0 - see the LICENSE file for details.
If you find HandMirror helpful in your development workflow, please consider supporting the project!
Your sponsorship helps maintain and improve this project, add new features, and keep it free for everyone. Every contribution, no matter how small, is greatly appreciated! ⭐
HandMirror - Look before you code 🪞