A Model Context Protocol (MCP) server that provides .NET assembly decompilation and analysis capabilities.
ILSpy MCP Server enables AI assistants (like Claude Code, Cursor) to decompile and analyze .NET assemblies directly through natural language commands. It integrates ILSpy to provide powerful reverse-engineering capabilities.
- .NET 9.0 SDK or higher
- MCP-compatible client (Claude Code, Cursor, Claude Desktop, etc.)
Install as a global dotnet tool from NuGet:
dotnet tool install -g ILSpyMcp.ServerTo update to the latest version:
dotnet tool update -g ILSpyMcp.ServerFor Claude Code, register the MCP server:
claude mcp add ilspy-mcp --command "ilspy-mcp" --scope userOr create/update .mcp.json in your project root:
{
"mcpServers": {
"ilspy-mcp": {
"type": "stdio",
"command": "ilspy-mcp",
"args": []
}
}
}For Cursor, add to your MCP settings:
{
"mcpServers": {
"ilspy-mcp": {
"command": "ilspy-mcp",
"args": []
}
}
}For Claude Desktop, add to claude_desktop_config.json:
{
"mcpServers": {
"ilspy-mcp": {
"command": "ilspy-mcp",
"args": []
}
}
}Decompile the String class from /path/to/System.Runtime.dll
List all types in the assembly /path/to/MyLibrary.dll
Find the CalculateTotal method in /path/to/Calculator.dll
Show me the type hierarchy for ProductService in /path/to/ECommerce.dll
Search for members containing "Authenticate" in /path/to/Auth.dll
| Tool | Description |
|---|---|
decompile_type |
Decompile and analyze a .NET type from a DLL |
decompile_method |
Decompile and analyze a specific method |
list_assembly_types |
List all types in an assembly |
analyze_assembly |
Get architectural overview of an assembly |
get_type_members |
Get complete API surface of a type |
find_type_hierarchy |
Find inheritance relationships |
search_members_by_name |
Search for members by name |
find_extension_methods |
Find extension methods for a type |
The server can be configured via environment variables:
ILSpy__MaxDecompilationSize: Maximum size of decompiled code in bytes (default: 1048576 = 1 MB)ILSpy__DefaultTimeoutSeconds: Default timeout for operations in seconds (default: 30)ILSpy__MaxConcurrentOperations: Maximum number of concurrent operations (default: 10)
This server follows a clean architecture with clear separation of concerns:
- Domain: Core business logic and entities
- Application: Use cases and application services
- Infrastructure: External system adapters (ILSpy, file system)
- Transport: MCP protocol layer
- All operations are read-only (no file modifications)
- Assembly path validation
- Timeout and cancellation support
- Request context propagation
MIT β see LICENSE for details.