ILDecompilerMCP.Tool 1.0.0

ILDecompiler MCP Server Tool

This .NET tool runs an MCP (Model Context Protocol) server that provides utilities for IL (Intermediate Language) decompilation and other example functionalities.

Features

  • Exposes an IL decompiler as an MCP tool.
  • Includes an example Echo tool.

Installation

1. Pack the Tool

Navigate to the root directory of the ILDecompilerMCP solution and run the following command to create the NuGet package for the tool:

dotnet pack src/ILDecompilerMCP.csproj -o ./nupkg

This will create a .nupkg file in the nupkg directory at the root of the solution.

2. Install the Tool Locally

Once the package is created, you can install it as a .NET global tool from the local source:

dotnet tool install --global --add-source ./nupkg ILDecompilerMCP.Tool

If you need to update the tool later, you can use:

dotnet tool update --global --add-source ./nupkg ILDecompilerMCP.Tool

To uninstall the tool:

dotnet tool uninstall --global ILDecompilerMCP.Tool

Usage

Once installed, you can run the MCP server from anywhere in your terminal by simply typing its command name:

ildecompiler-mcp

This will start the MCP server, listening via stdio. Clients can then connect to this server to use its tools.

Available Tools

The server currently exposes the following tools:

1. DecompileObjectDefinition

  • Description: Decompiles an object definition (class, struct, interface, enum) from a specified DLL file, given the path to the directory containing the DLL and the DLL's name.
  • Input Parameters:
    • packageLibDirectory (string): The full path to the directory containing the target DLL (e.g., /path/to/.nuget/packages/packagename/version/lib/tfm/).
    • dllName (string): The name of the DLL file to decompile within the packageLibDirectory (e.g., "Newtonsoft.Json.dll").
    • fullTypeName (string): The fully qualified name of the type to decompile (e.g., "Newtonsoft.Json.JsonConvert").
  • Output (ObjectDefinitionResponse object):
    • Success (boolean): Indicates if the decompilation was successful.
    • ObjectDefinition (string, optional): The decompiled C# code if successful.
    • ErrorMessage (string, optional): An error message if decompilation failed.

2. Echo

  • Description: Echoes back two provided message strings. This is primarily an example tool.
  • Input Parameters:
    • message1 (string): The first message to echo.
    • message2 (string): The second message to echo.
  • Output (ObjectDefinitionResponse object):
    • Success (boolean): Always true for this example.
    • ObjectDefinition (string): A string concatenating the echoed messages.
    • ErrorMessage (string, optional): Typically null for this example.

This package has no dependencies.

Version Downloads Last updated
1.0.0 4 05/07/2025