ILSpyMcpServer

seungyongshim/ILSpyMcpServer

3.2

If you are the rightful owner of ILSpyMcpServer and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to dayong@mcphub.com.

The ILSpy MCP Server is a Model Context Protocol server that provides AI-powered .NET assembly decompilation and analysis using ILSpy.

Tools
5
Resources
0
Prompts
0

ILSpy MCP Server

A Model Context Protocol (MCP) server that provides AI-powered .NET assembly decompilation and analysis using ILSpy.

Features

  • AI-Powered Analysis: Uses intelligent sampling to analyze decompiled code without overwhelming token usage
  • Selective Decompilation: Decompile specific types or methods instead of entire assemblies
  • Smart Assembly Overview: Get architectural insights and design pattern analysis
  • Member Exploration: Quick API surface exploration without full decompilation

Tools

1. decompile_type

Decompile a specific type (class, interface, struct, enum) from a .NET assembly to C# source code.

Parameters:

  • assemblyPath (required): Path to the .NET assembly file
  • typeName (required): Full name of the type (e.g., 'System.String')
  • query (optional): What specific information you're looking for

Example:

{
  "assemblyPath": "C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\9.0.0\\System.Private.CoreLib.dll",
  "typeName": "System.String",
  "query": "method implementations"
}

2. decompile_method

Decompile a specific method from a type in a .NET assembly.

Parameters:

  • assemblyPath (required): Path to the .NET assembly file
  • typeName (required): Full name of the type containing the method
  • methodName (required): Name of the method to decompile
  • query (optional): What aspect of the method to focus on

Example:

{
  "assemblyPath": "MyLibrary.dll",
  "typeName": "MyNamespace.MyClass",
  "methodName": "ProcessData",
  "query": "algorithm logic"
}

3. list_assembly_types

List all types in a .NET assembly with optional namespace filtering.

Parameters:

  • assemblyPath (required): Path to the .NET assembly file
  • namespaceFilter (optional): Filter types by namespace (case-insensitive)

Example:

{
  "assemblyPath": "MyLibrary.dll",
  "namespaceFilter": "System.Collections"
}

4. analyze_assembly

Get an AI-powered analysis of an entire assembly's structure and design.

Parameters:

  • assemblyPath (required): Path to the .NET assembly file
  • query (optional): What aspects to analyze

Example:

{
  "assemblyPath": "MyLibrary.dll",
  "query": "design patterns and architecture"
}

5. get_type_members

Get a detailed list of all members (methods, properties, fields, events) of a type.

Parameters:

  • assemblyPath (required): Path to the .NET assembly file
  • typeName (required): Full name of the type to inspect

Example:

{
  "assemblyPath": "MyLibrary.dll",
  "typeName": "MyNamespace.MyClass"
}

Installation

Option 1: Using dnx (.NET 10+)

The easiest way to use this tool without installation:

dnx ILSpyMcpServer

Option 2: As a .NET Tool

dotnet tool install -g ILSpyMcpServer

Option 3: From Source

git clone https://github.com/seungyongshim/ILSpyMcpServer.git
cd ILSpyMcpServer/src
dotnet build
dotnet pack
dotnet tool install -g --add-source ./bin/Debug ILSpyMcpServer

Configuration

Claude Desktop

Add to your Claude Desktop configuration file:

Windows: %APPDATA%\Claude\claude_desktop_config.json macOS: ~/Library/Application Support/Claude/claude_desktop_config.json

Using dnx (.NET 10+, Recommended)
{
  "mcpServers": {
    "ilspy": {
      "command": "dnx",
      "args": ["ILSpyMcpServer"]
    }
  }
}
Using installed global tool
{
  "mcpServers": {
    "ilspy": {
      "command": "ilspy-mcp"
    }
  }
}

Other MCP Clients

  • With dnx: dnx ILSpyMcpServer
  • With global tool: ilspy-mcp

Requirements

  • .NET 9.0 or later
  • Compatible with any MCP client that supports stdio transport

How It Works

Instead of dumping entire decompiled source code (which can be thousands of lines), this server:

  1. Uses ILSpy to decompile .NET assemblies
  2. Sends the decompiled code to the AI model via MCP sampling
  3. Returns intelligent analysis, summaries, and insights
  4. Preserves token efficiency while providing valuable information

Use Cases

  • Library Exploration: Understand how third-party libraries work internally
  • Reverse Engineering: Analyze compiled .NET assemblies
  • Learning: Study implementation patterns in .NET framework classes
  • API Discovery: Find and understand available methods and properties
  • Code Review: Analyze decompiled code for security or quality insights

License

MIT

Repository

https://github.com/seungyongshim/ILSpyMcpServer

Author

seungyongshim