HandMirrorMcp
A Model Context Protocol (MCP) server for .NET assembly and NuGet package inspection
HandMirror MCP Server
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.
๐ฏ Purpose
AI coding assistants often hallucinate or guess API details, leading to build errors and wasted development iterations. HandMirror solves this by:
- Providing accurate, version-specific API information directly from assemblies
- Enabling verification of method signatures, types, and namespaces before writing code
- Helping diagnose and fix .NET build errors quickly
- Supporting analysis of native interop (P/Invoke, COM) dependencies
โจ Features
Assembly Inspection
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 type
NuGet Package Exploration
search_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 .nupkg
Native Interop Analysis
inspect_native_dependencies- Find P/Invoke (DllImport/LibraryImport) and COM types in an assembly
Project Analysis
analyze_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 files
System Information
get_system_info- Get system information (OS, .NET runtime, hardware)get_dotnet_info- Get detailed .NET installation information
๐ Prerequisites
- .NET 8.0 SDK or later
- MCP-compatible client (e.g., Claude Desktop, VS Code with Copilot)
๐ Installation
Build from Source
git clone https://github.com/rkttu/HandMirrorMcp.git
cd HandMirrorMcp
dotnet build
Run the Server
dotnet run --project HandMirrorMcp
โ๏ธ Configuration
Claude Desktop
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"
}
}
}
VS Code with GitHub Copilot
Add to your VS Code settings or workspace settings:
{
"servers": {
"handmirror": {
"command": "dotnet",
"args": ["run", "--project", "/path/to/HandMirrorMcp"]
}
}
}
๐ Usage Examples
Verify API Before Writing Code
When you need to use an unfamiliar .NET API:
Use inspect_nuget_package_type to show me the HttpClient class from System.Net.Http
Diagnose Build Errors
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
Explore NuGet Packages
Search for packages related to "json serialization" and show me the top results
Check Package Vulnerabilities
Check if there are any known vulnerabilities in System.Text.Json version 6.0.0
Analyze Project Issues
Analyze my .csproj file at C:\MyProject\MyProject.csproj and identify any issues
๐๏ธ Architecture
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
๐งช Testing
Run the test suite:
dotnet test
The tests use MSTest and connect to the actual MCP server for integration testing.
๐ฆ Dependencies
- ModelContextProtocol - MCP server implementation
- Microsoft.Extensions.Hosting - .NET hosting abstractions
- Mono.Cecil - .NET assembly inspection
- NuGet.Protocol - NuGet package operations
๐ค Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
๐ License
This project is licensed under the Apache License 2.0 - see the LICENSE file for details.
๐ Acknowledgments
- Model Context Protocol for the MCP specification
- Mono.Cecil for .NET assembly inspection capabilities
- The .NET community for continuous inspiration
๐ Support This Project
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 ๐ช
Related Servers
Scout Monitoring MCP
sponsorPut performance and error data directly in the hands of your AI assistant.
Alpha Vantage MCP Server
sponsorAccess financial market data: realtime & historical stock, ETF, options, forex, crypto, commodities, fundamentals, technical indicators, & more
Vibetest Use
A browser-agent QA swarm with an MCP interface for testing AI-generated websites.
APIWeaver
Dynamically creates MCP servers from web API configurations, integrating any REST API, GraphQL endpoint, or web service into MCP-compatible tools.
Remote MCP Server Authless Test
An example of deploying a remote MCP server on Cloudflare Workers without authentication.
YepCode
Execute any LLM-generated code in the YepCode secure and scalable sandbox environment and create your own MCP tools using JavaScript or Python, with full support for NPM and PyPI packages
MCP Emulator Controller
Control emulators by opening/closing apps, capturing screenshots, and interacting with the screen.
Chronulus AI
Predict anything with Chronulus AI forecasting and prediction agents.
GhidraMCP
Enables LLMs to autonomously reverse engineer applications by exposing core Ghidra functionality.
WTP - Worktree Plus
Let agents manage Git worktrees via the wtp CLI.
MCP Command Server
A server for securely executing commands on the host system, requiring Java 21 or higher.
Solana Dev MCP
An MCP server for Solana development providing basic RPC methods and helpful prompts.