cd c:\development\mcpeek\McPeek
dotnet runThe server will start and listen for MCP requests via stdio.
Add to your MCP settings file (usually in VS Code settings or Cline configuration):
{
"mcpServers": {
"mcpeek": {
"command": "dotnet",
"args": [
"run",
"--project",
"c:\\development\\mcpeek\\DllDecompilerMcp\\DllDecompilerMcp.csproj"
]
}
}
}AI: Use the DecompileFolder tool to decompile all DLLs in C:\MyProject\bin\Debug\net8.0
Expected Response:
{
"Success": true,
"Message": "Successfully decompiled 15 assemblies",
"AssemblyNames": [
"MyProject",
"Microsoft.Extensions.DependencyInjection",
...
],
"TotalFiles": 450
}AI: Search for "IServiceProvider" in the decompiled code
Expected Response:
{
"Success": true,
"Query": "IServiceProvider",
"TotalMatches": 23,
"Results": [
{
"AssemblyName": "Microsoft.Extensions.DependencyInjection",
"FilePath": "ServiceProvider.cs",
"LineNumber": 15,
"LineContent": "public class ServiceProvider : IServiceProvider",
"Context": "...(surrounding code)..."
},
...
]
}AI: First, decompile C:\MyProject\bin\Debug\MyLibrary.dll
Then search for "MyImportantClass"
This workflow:
- Decompiles the specific DLL
- Searches for the class
- AI can then analyze the implementation details
AI: List all loaded assemblies
Expected Response:
{
"Success": true,
"TotalAssemblies": 15,
"Assemblies": [
{
"Name": "MyProject",
"Path": "C:\\MyProject\\bin\\Debug\\MyProject.dll",
"FileCount": 30,
"DecompiledAt": "2025-10-24T12:00:00Z"
},
...
]
}AI: Get cache statistics
Expected Response:
{
"Success": true,
"TotalCachedAssemblies": 15,
"CacheDirectory": "C:\\Users\\User\\AppData\\Local\\Temp\\DllDecompilerMcp\\cache",
"CacheSizeMB": 12.5
}To clear the cache:
AI: Clear the decompilation cache
Objective: Understand how a third-party NuGet package implements a specific feature.
Steps:
- Locate the DLL in your NuGet packages folder (usually
%USERPROFILE%\.nuget\packages) - Decompile:
DecompileDll C:\Users\You\.nuget\packages\SomeLibrary\1.0.0\lib\net8.0\SomeLibrary.dll - Search for the feature:
SearchCode "FeatureName" - Ask AI to explain the implementation
Objective: Analyze decompiled code from a production DLL to understand a bug.
Steps:
- Copy production DLLs to a local folder
- Decompile the folder:
DecompileFolder C:\ProductionDlls - Search for the problematic method:
SearchCode "ProblematicMethod" - Ask AI to identify potential issues in the code
Objective: Generate documentation for an undocumented internal library.
Steps:
- Decompile the library:
DecompileDll C:\InternalLibs\MyLib.dll - List all types: Ask AI to summarize all public classes
- For each class, ask AI to generate documentation based on the decompiled code
Objective: Understand what changes are needed to migrate from one framework version to another.
Steps:
- Decompile old framework DLLs:
DecompileFolder C:\OldFramework\bin - Decompile new framework DLLs:
DecompileFolder C:\NewFramework\bin - Search for specific APIs:
SearchCode "ObsoleteAPI" - Ask AI to identify migration paths
-
Cache is Your Friend: The cache uses SHA256 hashes, so if you decompile the same DLL multiple times, it's instant after the first time.
-
Search Smartly: Use specific search terms to reduce the number of results. The default limit is 50 results per search.
-
Case Sensitivity: By default, searches are case-insensitive. Use the
caseSensitiveparameter if you need exact matches. -
Large Projects: For large projects with many DLLs, decompile one folder at a time to keep things manageable.
-
XML Documentation: The decompiler includes XML documentation comments when available, making the AI's understanding more accurate.
Possible causes:
- The file is not a .NET assembly
- The assembly is obfuscated
- File permissions issue
Solution:
- Verify the file is a valid .NET DLL using
dotnet --infoor ILSpy - Check file permissions
Solution:
AI: Clear the decompilation cache
Then selectively decompile only what you need.
Solution:
- Use more specific search terms
- Add the namespace or class name
- Use the
maxResultsparameter to limit results - Use
caseSensitivesearch for exact matches
- First decompilation: Can take a few seconds per DLL depending on size
- Cached decompilation: Instant (< 100ms)
- Search: Very fast across all loaded assemblies
- Cache location:
%TEMP%\McPeek\cache
- The server only decompiles local DLLs that you explicitly specify
- No network access required
- Cache is stored in your local temp folder
- All operations are read-only (doesn't modify source DLLs)
The MCP server is designed to work seamlessly with AI assistants like:
- GitHub Copilot (VS Code Agent Mode)
- Claude with MCP support
- Custom AI agents built with Semantic Kernel
The AI can:
- Understand complex library implementations
- Explain how specific features work
- Identify patterns and best practices
- Suggest improvements based on decompiled code
- Help with debugging by analyzing actual compiled code