ILSpy MCP Server - Decompile and analyze .NET assemblies using ILSpy via Model Context Protocol
$ dotnet add package ILSpyMcpServerA Model Context Protocol (MCP) server that provides AI-powered .NET assembly decompilation and analysis using ILSpy.
decompile_typeDecompile a specific type (class, interface, struct, enum) from a .NET assembly to C# source code.
Parameters:
assemblyPath (required): Path to the .NET assembly filetypeName (required): Full name of the type (e.g., 'System.String')query (optional): What specific information you're looking forExample:
{
"assemblyPath": "C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\9.0.0\\System.Private.CoreLib.dll",
"typeName": "System.String",
"query": "method implementations"
}
decompile_methodDecompile a specific method from a type in a .NET assembly.
Parameters:
assemblyPath (required): Path to the .NET assembly filetypeName (required): Full name of the type containing the methodmethodName (required): Name of the method to decompilequery (optional): What aspect of the method to focus onExample:
{
"assemblyPath": "MyLibrary.dll",
"typeName": "MyNamespace.MyClass",
"methodName": "ProcessData",
"query": "algorithm logic"
}
list_assembly_typesList all types in a .NET assembly with optional namespace filtering.
Parameters:
assemblyPath (required): Path to the .NET assembly filenamespaceFilter (optional): Filter types by namespace (case-insensitive)Example:
{
"assemblyPath": "MyLibrary.dll",
"namespaceFilter": "System.Collections"
}
analyze_assemblyGet an AI-powered analysis of an entire assembly's structure and design.
Parameters:
assemblyPath (required): Path to the .NET assembly filequery (optional): What aspects to analyzeExample:
{
"assemblyPath": "MyLibrary.dll",
"query": "design patterns and architecture"
}
get_type_membersGet a detailed list of all members (methods, properties, fields, events) of a type.
Parameters:
assemblyPath (required): Path to the .NET assembly filetypeName (required): Full name of the type to inspectExample:
{
"assemblyPath": "MyLibrary.dll",
"typeName": "MyNamespace.MyClass"
}
The easiest way to use this tool without installation:
dnx ILSpyMcpServer
dotnet tool install -g ILSpyMcpServer
git clone https://github.com/seungyongshim/ILSpyMcpServer.git
cd ILSpyMcpServer/src
dotnet build
dotnet pack
dotnet tool install -g --add-source ./bin/Debug ILSpyMcpServer
Add to your Claude Desktop configuration file:
Windows: %APPDATA%\Claude\claude_desktop_config.json
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
{
"mcpServers": {
"ilspy": {
"command": "dnx",
"args": ["ILSpyMcpServer"]
}
}
}
{
"mcpServers": {
"ilspy": {
"command": "ilspy-mcp"
}
}
}
dnx ILSpyMcpServerilspy-mcpInstead of dumping entire decompiled source code (which can be thousands of lines), this server:
MIT
https://github.com/seungyongshim/ILSpyMcpServer
seungyongshim