DecompilerServer
A powerful MCP (Model Context Protocol) server for decompiling and analyzing .NET assemblies, with specialized support for Unity's Assembly-CSharp.dll files. DecompilerServer provides comprehensive decompilation, search, and code analysis capabilities through a rich set of tools and APIs.
claude mcp add --transport stdio pardeike-decompilerserver dotnet run --project DecompilerServer/DecompilerServer.csproj \ --env DOTNET_ENVIRONMENT="Production" \ --env DECOMPILER_LOG_LEVEL="Info"
How to use
DecompilerServer is a .NET-based MCP server that provides extensive decompilation, analysis, and code generation capabilities for .NET assemblies, including Unity projects that use Assembly-CSharp.dll. After starting the server, you can load assemblies, search for types and members, inspect details, decompile sources, analyze usage and relationships, and generate patches or stubs. The toolset is organized into core operations (loading/unloading assemblies, warming indexes), discovery (namespaces, types, members, attributes), analysis (member details, decompiled source, IL), relationships (usages, callers, callees, overrides), code generation (Harmony patches, detour stubs), and advanced features like batch decompilation and transpiler target suggestions. Typical workflows include loading an assembly, exploring its namespaces and types, retrieving decompiled source for specific members, and then using code generation tools to prepare patches or extension wrappers for modding or instrumentation.
To use the MCP tools, clients send JSON payloads with a tool field and arguments. Examples include loading an assembly, listing namespaces, searching for types, getting member details, and obtaining decompiled sources. Unity projects can be analyzed by loading Assembly-CSharp.dll and then exploring Player-related types or generating Harmony patch skeletons for modding. The server emphasizes high performance through caching and lazy loading, enabling efficient repeated analyses of large assemblies.
How to install
Prerequisites:
- .NET 8.0 SDK or later
- Compatible host OS: Windows, macOS, or Linux
Installation steps:
-
Clone the repository: git clone https://github.com/pardeike/DecompilerServer.git cd DecompilerServer
-
Build the solution: dotnet build DecompilerServer.sln
-
Run tests (optional): dotnet test
-
Start the server: dotnet run --project DecompilerServer/DecompilerServer.csproj
-
(Optional) Configure AI/tool integrations by editing the various config files shown in the README (e.g., Codex config, Copilot config, Claude JSON, VS Code settings) to point at the running server executable or to pass initial arguments as needed.
Additional notes
Tips and common issues:
- Ensure you have the correct .NET 8.0 SDK installed; mismatch can cause build failures.
- When loading Unity assemblies, provide the path to Unity's Assembly-CSharp.dll and, if needed, the game directory for Unity-specific context.
- Caching behavior improves performance for repeated decompilations; if memory pressure is high, consider adjusting cache settings (if exposed in your deployment).
- The MCP endpoint IDs follow a stable format <mvid-32hex>:<token-8hex>:<kind-code> (T for Type, M for Method, P for Property, F for Field, E for Event, N for Namespace) to support automation.
- For AI tool integrations, ensure the respective config files reference the correct path to DecompilerServer.exe or the dotnet run target in development environments.
- If you run into port or binding issues, verify that any reverse proxy or firewall rules allow localhost or the intended host port used by the MCP server.
Related MCP Servers
mssql
MSSQL Server MCP implementation written in C#
McpDotNet.Extensions.SemanticKernel
Microsoft SemanticKernel integration for the Model Context Protocol (MCP). Enables seamless use of MCP tools as AI functions.
DatabaseMcpServer
MCP server from ttcc666/DatabaseMcpServer
mcp-dataverse
MCP Server for querying Dataverse using SQL
xperience-community
ASP.NET Core MCP server for Xperience by Kentico projects
console-to-http
Example of converting a stdio MCP server to HTTP using ModelContextProtocol.AspNetCore