Logo di ILSpy MCP Server

ILSpy MCP Server

Community
bivex

🔓 UNLEASH ILSpy'S POWER. Reverse-engineer DOTNET code at GOD SPEED. AI-assisted debugging that THINKS with you. Decompile ANYTHING. 🚀

Autorebivex
RepositoryILSpy-Mcp
LinguaC#
Fork
7
Stelle
67
Strumenti disponibili
0
Tipo di trasportostdio
Categorie
LicenzaMIT
Link
  • Collega gli strumenti ai flussi di lavoro IA

    ILSpy MCP Server mette a disposizione funzionalità MCP utilizzabili da client e agenti IA compatibili.

  • 0 strumenti disponibili

    Esplora le azioni richiamabili qui sotto, con nomi e descrizioni quando forniti dal server.

  • Configurazione pronta da copiare

    Usa gli esempi di installazione per configurare questo server nel tuo client MCP preferito.

  • Indicatori di interesse open source

    67 stelle e 7 fork nel repository collegato.

ILSpy MCP Server

NuGet Version NuGet Downloads Framework MCP Protocol License: MIT

A Model Context Protocol (MCP) server built on .NET 9 that provides in-memory .NET assembly decompilation and structural analysis capabilities for AI assistants using ILSpy (ICSharpCode.Decompiler).


💡 How It Works

ILSpy MCP Server acts as a bridge between AI assistants (like Claude Code, Cursor, Antigravity) and compiled .NET binaries (.dll, .exe). It enables LLMs to inspect, decompile, and analyze compiled .NET code directly via natural language.

┌─────────────────────────────────────────────────────────────────────────────┐
│                             AI Client / Host                                │
│                     (Claude Code, Cursor, Antigravity)                      │
└───────────────────────────────────┬─────────────────────────────────────────┘
                                    │ stdio (JSON-RPC 2.0)
                                    ▼
┌─────────────────────────────────────────────────────────────────────────────┐
│                             ILSpy MCP Server                                │
│                                                                             │
│  ┌───────────────────────────────────────────────────────────────────────┐  │
│  │ Transport Layer (MCP Tools)                                           │  │
│  │ Mappings: Tool Request ➔ Parameters Validation ➔ Response Formatting  │  │
│  └──────────────────────────────────┬────────────────────────────────────┘  │
│                                     │                                       │
│  ┌──────────────────────────────────▼────────────────────────────────────┐  │
│  │ Application Use Cases                                                 │  │
│  │ Single-responsibility orchestrators (Timeouts, Cancellation, Limits)   │  │
│  └──────────────────────────────────┬────────────────────────────────────┘  │
│                                     │                                       │
│  ┌──────────────────────────────────▼────────────────────────────────────┐  │
│  │ Infrastructure (ILSpy Engine Adapter)                                 │  │
│  │ Wraps ICSharpCode.Decompiler CSharpDecompiler & PEFile Metadata       │  │
│  └──────────────────────────────────┬────────────────────────────────────┘  │
└─────────────────────────────────────┼───────────────────────────────────────┘
                                      │ In-Memory Inspection
                                      ▼
                      ┌───────────────────────────────┐
                      │  Target .NET Assemblies       │
                      │   (.dll / .exe binaries)      │
                      └───────────────────────────────┘

Request Lifecycle & Processing Pipeline

  1. JSON-RPC Communication: The MCP server runs as a background process communicating over standard input/output (stdio) using JSON-RPC 2.0. Logging is redirected to stderr to preserve standard output for protocol payloads.
  2. Tool Selection & Parameter Mapping: When an AI client invokes a tool (e.g., decompile_type or analyze_assembly), the Transport Layer receives the call, validates inputs using strongly-typed domain models (AssemblyPath, TypeName), and prevents path traversal or missing file errors early.
  3. Use Case Execution: The Application Layer invokes a dedicated, single-responsibility use case. It sets up CancellationToken linked to configurable operation timeouts and size safety limits.
  4. ILSpy Engine Processing: The Infrastructure Layer passes the file path to ICSharpCode.Decompiler.CSharp.CSharpDecompiler and PEFile:
    • Parses the PE metadata tables and TypeDefs/MethodDefs.
    • Reconstructs C# Abstract Syntax Trees (AST).
    • Generates formatted, human-readable C# source code or structural metadata in-memory.
  5. Response Formatting & Truncation: Output size is checked against MaxDecompilationSize to protect the LLM context window. The formatted output is sent back to the LLM.

🎯 Recommended LLM Workflow

For best results when analyzing unfamiliar .NET libraries or assemblies, AI assistants follow a 3-step workflow:

  Step 1: DISCOVERY                Step 2: STRUCTURAL INSPECTION         Step 3: DECOMPILATION
┌─────────────────────────┐      ┌───────────────────────────────┐     ┌───────────────────────┐
│ `analyze_assembly`      │ ───► │ `get_type_members`            │ ──► │ `decompile_type`      │
│ `list_assembly_types`   │      │ `find_type_hierarchy`         │     │ `decompile_method`    │
└─────────────────────────┘      │ `search_members_by_name`      │     └───────────────────────┘
                                 │ `find_extension_methods`      │
                                 └───────────────────────────────┘
  1. Discovery: Understand overall structure and namespaces using analyze_assembly or filter types using list_assembly_types.
  2. Structural Inspection: Understand type signatures, public members, and inheritance graphs using get_type_members, find_type_hierarchy, or find_extension_methods without loading full implementation bodies.
  3. Targeted Decompilation: Decompile exact class logic or specific method algorithms using decompile_type or decompile_method.

🛠️ Available MCP Tools

ToolPurposeDescriptionKey Parameters
analyze_assemblyHigh-level ArchitectureHigh-level summary of namespaces, public/internal type counts, and key entry points.assemblyPath, query
list_assembly_typesType DiscoveryLists all types grouped by namespace. Supports namespace filtering.assemblyPath, namespaceFilter
get_type_membersAPI Surface InspectionLists methods, properties, fields, and events for a type without decompiling code bodies.assemblyPath, typeName
find_type_hierarchyInheritance MappingDisplays base classes, implemented interfaces, and derived types.assemblyPath, typeName
decompile_typeFull Type DecompilationDecompiles complete C# source code of a specified class, interface, struct, or enum.assemblyPath, typeName
decompile_methodMethod DecompilationDecompiles only the body and signature of a specific method.assemblyPath, typeName, methodName
search_members_by_nameMember SearchSearches for members matching a substring or pattern across the assembly.assemblyPath, searchTerm
find_extension_methodsExtension DiscoveryFinds all C# extension methods defined in the assembly that target a specific type.assemblyPath, targetTypeName

🚀 Quick Start

Prerequisites

  • .NET 9.0 SDK or higher
  • An MCP-compatible client (Claude Code, Cursor, Antigravity, Claude Desktop, VS Code, etc.)

Option A: Install from NuGet (Recommended)

Install ILSpyMcp.Server globally via NuGet:

bash
dotnet tool install -g ILSpyMcp.Server

To update to the latest release from NuGet:

bash
dotnet tool update -g ILSpyMcp.Server

Option B: Build & Run from Source

Clone the repository and build the project:

bash
git clone https://github.com/gentledepp/ILSpy-Mcp.git
cd ILSpy-Mcp
dotnet build -c Release

You can then run the built DLL directly in your MCP client settings:

json
{
  "mcpServers": {
    "ilspy-mcp": {
      "command": "dotnet",
      "args": ["/path/to/ILSpy-Mcp/bin/Release/net9.0/ILSpy.Mcp.dll"]
    }
  }
}

📦 Packaging & Publishing to NuGet

The project is preconfigured as a .NET Global Tool package (ILSpyMcp.Server).

Build & Pack

Create a .nupkg package in Release mode:

bash
dotnet pack -c Release -o ./nupkg

Publish to NuGet.org

Push the generated package to NuGet.org:

bash
dotnet nuget push ./nupkg/ILSpyMcp.Server.*.nupkg \
  --api-key YOUR_NUGET_API_KEY \
  --source https://api.nuget.org/v3/index.json

Install Local Build (Testing)

Test the locally built package before publishing:

bash
dotnet tool install -g --add-source ./nupkg ILSpyMcp.Server

⚙️ MCP Client Configuration

Claude Code

Register directly with the CLI:

bash
claude mcp add ilspy-mcp --command "ilspy-mcp" --scope user

Or add to .mcp.json in your workspace:

json
{
  "mcpServers": {
    "ilspy-mcp": {
      "type": "stdio",
      "command": "ilspy-mcp",
      "args": []
    }
  }
}

Cursor & Antigravity

Add to your MCP server configuration:

json
{
  "mcpServers": {
    "ilspy-mcp": {
      "command": "ilspy-mcp",
      "args": []
    }
  }
}

Claude Desktop

Add to claude_desktop_config.json:

json
{
  "mcpServers": {
    "ilspy-mcp": {
      "command": "ilspy-mcp",
      "args": []
    }
  }
}

💬 Natural Language Prompt Examples

  • Analyze Assembly Structure:

    "Analyze the architecture of /path/to/MyService.dll and list key entry points."

  • Explore Types:

    "List all public types in the namespace MyService.Core inside /path/to/MyService.dll."

  • Inspect API Surface:

    "Show me all public methods and properties of UserManager in /path/to/MyService.dll."

  • Decompile Class Implementation:

    "Decompile the OrderProcessor class in /path/to/ECommerce.dll and explain how payments are processed."

  • Decompile Specific Method:

    "Decompile the ValidateToken method of JwtHandler from /path/to/Auth.dll."


🔧 Environment Configuration

Customize execution behavior via environment variables:

VariableDescriptionDefault
ILSpy__MaxDecompilationSizeMaximum allowed output size in bytes (protects context windows)1048576 (1 MB)
ILSpy__DefaultTimeoutSecondsOperation timeout limit in seconds30
ILSpy__MaxConcurrentOperationsMaximum concurrent decompilation threads10

Example setting in .mcp.json:

json
{
  "mcpServers": {
    "ilspy-mcp": {
      "command": "ilspy-mcp",
      "env": {
        "ILSpy__MaxDecompilationSize": "2097152",
        "ILSpy__DefaultTimeoutSeconds": "60"
      }
    }
  }
}

🏗️ Architecture & Security

  • Clean Hexagonal Architecture: Strictly decoupled into Domain, Application, Infrastructure, and Transport.
  • Read-Only Operation: The server performs pure read-only disassembly and reflection; it never writes or modifies files on disk.
  • Path Validation: Input assembly paths are checked against illegal characters, path traversal attempts, and file existence.
  • Context Protection: Decompilation output is limited by configurable byte size boundaries to avoid blowing LLM context budgets.
  • Stderr Logging: All diagnostic logging goes to stderr, leaving stdout dedicated strictly for MCP protocol communication.

📜 License

Distributed under the MIT License.

Installazione

TypingMind
Prerequisiti:

Node.js 18+

{
  "mcpServers": {
    "bivex-ilspy-mcp": {
      "command": "",
      "args": []
    }
  }
}

Usa MCP ILSpy MCP Server con più modelli IA

TypingMind collega gli strumenti MCP a livello di area di lavoro: una volta connesso ILSpy MCP Server, puoi usarlo con diversi modelli IA in TypingMind, senza configurarlo separatamente per ogni modello. Questa integrazione MCP viene eseguita localmente sul tuo dispositivo tramite il connettore MCP di TypingMind.

Guida alla configurazione del connettore locale

Usa questo metodo quando il server MCP deve accedere a file locali, app o risorse private sul tuo computer.

1

Apri le impostazioni MCP

In TypingMind, vai su Impostazioni, Impostazioni avanzate, poi su Model Context Protocol e scegli Configura MCP.

  1. Apri TypingMind nel tuo browser.
  2. Fai clic sull'icona Impostazioni.
  3. Vai a Impostazioni avanzate.
  4. Apri la sezione Model Context Protocol.
  5. Fai clic su Configura MCP e scegli Questo dispositivo.
Schermata di configurazione del connettore MCP di TypingMind con Questo dispositivo selezionato
2

Esegui il comando del connettore

Scegli Questo dispositivo, copia il comando da TypingMind ed eseguilo nel terminale. Lascia il processo in esecuzione mentre usi MCP.

  1. Copia il comando di configurazione mostrato da TypingMind.
  2. Apri Terminale su macOS o Windows Terminal su Windows.
  3. Incolla ed esegui il comando.
  4. Conferma l'installazione del pacchetto se il terminale ti chiede di procedere.
  5. Tieni aperta la finestra del terminale con il processo in esecuzione mentre usi gli strumenti MCP.
3

Aggiungi ILSpy MCP Server come server

Quando lo stato del connettore è Pronto, fai clic su Modifica server e incolla la configurazione del server MCP.

  1. Attendi che lo stato del connettore sia Pronto.
  2. Fai clic su Modifica server.
  3. Incolla la configurazione del server MCP di ILSpy MCP Server.
  4. Salva l'elenco dei server.
  5. Aggiorna per verificare che il connettore sia ancora pronto.
Impostazioni MCP di TypingMind con un server attivo e il pulsante Modifica server
{
  "mcpServers": {
    "bivex-ilspy-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "ILSpy-Mcp"
      ]
    }
  }
}
4

Usa la connessione con diversi modelli

Salva l'elenco dei server, apri Plugin, abilita gli strumenti MCP di ILSpy MCP Server, poi seleziona un modello IA supportato in TypingMind e usa gli strumenti in chat o assegnali a un agente IA.

  1. Apri la pagina Plugin in TypingMind.
  2. Abilita gli strumenti MCP di ILSpy MCP Server.
  3. Avvia una chat e scegli il modello IA che vuoi usare.
  4. Usa gli strumenti MCP in chat o assegnali a un agente IA.
  5. Passa a un altro modello IA quando serve, senza riconnettere MCP.
Chat di TypingMind che usa gli strumenti MCP abilitati con un modello IA selezionato
Puoi usare ILSpy MCP Server per aiutarmi con questa attività?
ILSpy MCP Server
Certo. Ho letto.
Ecco cosa ho trovato con ILSpy MCP Server.

Domande frequenti

A cosa serve il server MCP ILSpy MCP Server?

ILSpy MCP Server è un server MCP che consente ai client IA compatibili di accedere a strumenti e informazioni di contesto esterni. In TypingMind puoi aggiungere questo server MCP una sola volta e rendere disponibili i suoi strumenti nella tua area di lavoro IA.

Posso usare ILSpy MCP Server MCP con più modelli IA in TypingMind?

Sì. TypingMind collega gli strumenti MCP a livello di area di lavoro, quindi puoi usare ILSpy MCP Server con diversi modelli IA come Claude, ChatGPT, Gemini o altri modelli che hai configurato in TypingMind, senza dover configurare il server MCP separatamente per ogni modello.

Perché usare il connettore MCP ILSpy MCP Server con TypingMind?

TypingMind è una delle migliori interfacce per chattare con gli LLM perché riunisce più modelli IA, prompt, plugin, agenti IA, chiavi API e strumenti MCP in un'unica area di lavoro. Collegando ILSpy MCP Server, puoi usare i suoi strumenti MCP con i tuoi modelli preferiti e mantenere organizzato il tuo flusso di lavoro in chat su TypingMind.

Come collego ILSpy MCP Server MCP a TypingMind?

ILSpy MCP Server funziona tramite il connettore MCP locale di TypingMind. È la soluzione ideale quando il server MCP deve accedere a file locali, app desktop, strumenti da riga di comando o risorse private sul tuo computer.

Quali strumenti offre ILSpy MCP Server MCP in TypingMind?

ILSpy MCP Server mette a disposizione funzionalità MCP che puoi attivare dalla pagina Plugin di TypingMind e usare in chat o assegnare agli agenti IA.

Devo condividere le mie chiavi API con TypingMind per usare ILSpy MCP Server MCP?

No. TypingMind privilegia il funzionamento in locale e ti permette di mantenere il controllo su fornitori di modelli, chiavi API, prompt e configurazione MCP. Se ILSpy MCP Server richiede l'autenticazione, aggiungi le intestazioni, le impostazioni OAuth o la configurazione locale necessarie per quel server MCP quando crei la connessione.

Server MCP correlati

Vedi tutti

Crea subito la tua area di lavoro IA

Iscriviti alla nostra newsletter per ricevere aggiornamenti sulle nuove funzionalità e sulle prossime iniziative a premi 👇