# Il2cpp Dump Analyzer

> Agentic RAG system for analyzing IL2CPP dump.cs files from Unity games

- **Type:** MCP server
- **Install:** `agentstack add mcp-djfaizp-il2cpp-dump-analyzer`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [djfaizp](https://agentstack.voostack.com/s/djfaizp)
- **Installs:** 0
- **Category:** [AI & ML](https://agentstack.voostack.com/c/ai-and-ml)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [djfaizp](https://github.com/djfaizp)
- **Source:** https://github.com/djfaizp/il2cpp-dump-analyzer

## Install

```sh
agentstack add mcp-djfaizp-il2cpp-dump-analyzer
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# IL2CPP Dump Analyzer Agentic RAG MCP System

[](https://opensource.org/licenses/MIT)
[](https://nodejs.org/)
[](https://www.typescriptlang.org/)
[](https://modelcontextprotocol.io/)
[](https://www.docker.com/)

A cutting-edge **Agentic Retrieval-Augmented Generation (RAG)** system for analyzing IL2CPP dump.cs files from Unity games. This system implements the Model Context Protocol (MCP) server specification with **intelligent agentic capabilities** that provide automated task orchestration, context-aware analysis, and enhanced workflow execution within the MCP framework.

## 🚀 Key Features

### 🤖 Agentic Intelligence Layer
- **Intelligent MCP Tool Orchestration**: Automatically selects and chains MCP tools for complex analysis tasks
- **Context-Aware Processing**: Preserves analysis context and results across multiple MCP tool calls
- **Smart Task Decomposition**: Breaks complex IL2CPP analysis requests into manageable subtasks
- **Result Synthesis**: Intelligently aggregates and correlates results from multiple MCP tools
- **Adaptive Caching**: Implements smart caching strategies that learn from usage patterns
- **Performance Optimization**: Monitors and optimizes agentic workflows for speed and efficiency

### 🔍 Advanced IL2CPP Analysis
- **Semantic Code Processing**: Specialized IL2CPPCodeChunker preserves code context and meaning
- **Vector-Powered Search**: Uses Xenova's Transformers.js with all-MiniLM-L6-v2 model (384-dimensional embeddings)
- **Supabase Vector Database**: High-performance vector search with pgvector extension
- **Hash-based Change Detection**: Intelligent change detection to avoid reprocessing unchanged files
- **Metadata Extraction**: Comprehensive assembly metadata, version tracking, and compilation analysis

### 🛠️ Comprehensive Tool Suite (21 MCP Tools)
- **Search Tools (3)**: Semantic code search, metadata search, and advanced querying
- **Analysis Tools (15)**: MonoBehaviour discovery, class hierarchies, design patterns, dependencies, and asset analysis
- **Generation Tools (3)**: C# wrapper generation, method stubs, and Unity MonoBehaviour templates

### 🔌 MCP Integration Excellence
- **Official MCP SDK**: Full compliance with Model Context Protocol specification v1.12.0
- **Multiple Transports**: Stdio, HTTP, and Server-Sent Events (SSE) support
- **Robust Validation**: Zod schemas ensure comprehensive parameter validation
- **Advanced Error Handling**: Intelligent error recovery with detailed logging and retry mechanisms
- **Resource Management**: Efficient memory usage and connection pooling

## Prerequisites

- **Node.js 18.x or higher**
- **TypeScript** (for development)
- **Supabase account** (required for vector database storage)
- **IL2CPP dump.cs file** from a Unity game

## Installation

1. **Clone the repository:**
   ```bash
   git clone https://github.com/yourusername/il2cpp-dump-analyzer-mcp.git
   cd il2cpp-dump-analyzer-mcp
   ```

2. **Install dependencies:**
   ```bash
   npm install
   ```

3. **Set up Supabase database:**
   - Create a new Supabase project at [supabase.com](https://supabase.com)
   - Run the SQL commands in `supabase-setup.sql` in the Supabase SQL editor
   - This creates the required tables with pgvector extension for vector storage

4. **Configure environment variables:**
   ```bash
   cp simple.env .env
   ```

   Update the `.env` file with your configuration:
   ```env
   # Core Configuration
   NODE_ENV=production
   DUMP_FILE_PATH=./dump.cs
   EMBEDDING_MODEL=Xenova/all-MiniLM-L6-v2
   LOG_LEVEL=info

   # Supabase Configuration (Required)
   SUPABASE_URL=your_supabase_project_url
   SUPABASE_KEY=your_supabase_anon_key
   SUPABASE_TABLE_NAME=il2cpp_documents

   # MCP Server Configuration
   MCP_SERVER_PORT=3000
   MCP_SERVER_HOST=0.0.0.0
   ```

5. **Build the project:**
   ```bash
   npm run build
   ```

## Usage
### Environment Variables

All available environment variables including agentic configuration:

```env
# Core Configuration
NODE_ENV=production|development|test
DUMP_FILE_PATH=./dump.cs
EMBEDDING_MODEL=Xenova/all-MiniLM-L6-v2
LOG_LEVEL=error|warn|info|debug

# Supabase Configuration
SUPABASE_URL=your_supabase_project_url
SUPABASE_KEY=your_supabase_anon_or_service_key
SUPABASE_TABLE_NAME=il2cpp_documents

# MCP Server Configuration
MCP_SERVER_PORT=3000
MCP_SERVER_HOST=0.0.0.0

# Agentic Configuration
AGENTIC_MODE=true                    # Enable intelligent tool orchestration
CONTEXT_CACHE_SIZE=1000             # Maximum cached contexts
TOOL_CHAIN_MAX_DEPTH=5              # Maximum tool chaining depth
INTELLIGENT_CACHING=true            # Enable smart result caching
CONTEXT_PERSISTENCE=true            # Enable context persistence across calls
PERFORMANCE_OPTIMIZATION=true      # Enable performance learning and optimization
ADAPTIVE_BATCHING=true              # Enable adaptive request batching
```

### Quick Start

1. **Place your IL2CPP dump.cs file** in the root directory (or specify path in `.env`)

2. **Start the MCP server:**
   ```bash
   npm start
   ```

3. **The server will automatically:**
   - Parse the IL2CPP dump.cs file
   - Extract classes, methods, enums, and interfaces
   - Generate semantic embeddings using Xenova Transformers.js
   - Store vectors in Supabase with hash-based change detection
   - Start the MCP server with stdio transport

4. **Connect with MCP clients:**
   - **Claude Desktop**: Add to MCP configuration
   - **Other MCP clients**: Use stdio transport connection

### MCP Client Configuration

#### Claude Desktop Configuration

Add to your Claude Desktop MCP configuration file:

```json
{
  "mcpServers": {
    "il2cpp-analyzer": {
      "command": "node",
      "args": ["./bin/il2cpp-mcp-stdio.js"],
      "cwd": "/path/to/il2cpp-dump-analyzer-mcp"
    }
  }
}
```

#### Alternative: Direct Node.js Execution

```bash
# Run the MCP server directly
node ./bin/il2cpp-mcp-stdio.js

# Or use npm script
npm run mcp:stdio
```

## 🛠️ MCP Tools and Resources

The server provides **21 comprehensive MCP tools** organized into three categories for IL2CPP analysis and code generation:

### 🔍 Search Tools (3 tools)

#### 1. `search_code` - Semantic Code Search
Advanced semantic search through IL2CPP code with intelligent filtering.

**Parameters:**
- `query` (string, required): The search query
- `filter_type` (string, optional): Filter by entity type (`class`, `method`, `enum`, `interface`)
- `filter_namespace` (string, optional): Filter by namespace
- `filter_monobehaviour` (boolean, optional): Filter to only MonoBehaviour classes
- `top_k` (number, optional, default: 5): Number of results to return

**Example:**
```typescript
// Find all Player-related classes with semantic search
search_code({ query: "Player movement controller", filter_type: "class", top_k: 10 })
```

#### 2. `search_metadata` - Metadata Search
Search through extracted metadata with flexible filtering and advanced options.

**Parameters:**
- `query` (string, required): Search query
- `search_type` (string, optional): Type of search (`assembly`, `type`, `method`, `field`)
- `assembly_name` (string, optional): Filter by assembly name
- `unity_version` (string, optional): Filter by Unity version
- `use_regex` (boolean, optional): Enable regex pattern matching
- `max_results` (number, optional): Maximum results to return

#### 3. `query_metadata` - Advanced Metadata Querying
Complex metadata queries with aggregations and cross-references.

**Parameters:**
- `filters` (object, optional): Complex filtering criteria
- `aggregations` (array, optional): Aggregation operations (`count`, `group_by`, `statistics`)
- `cross_reference` (object, optional): Cross-reference analysis configuration

### 🔬 Analysis Tools (15 tools)

#### 4. `find_monobehaviours` - Unity Component Discovery
Find and analyze MonoBehaviour classes for Unity component analysis.

**Parameters:**
- `query` (string, optional): Optional search query to filter MonoBehaviours
- `top_k` (number, optional, default: 10): Number of results to return

#### 5. `find_class_hierarchy` - Class Inheritance Analysis
Analyze class inheritance relationships and structure with detailed metadata.

**Parameters:**
- `class_name` (string, required): The name of the class to analyze
- `include_methods` (boolean, optional, default: true): Include methods in the output

#### 6. `find_enum_values` - Enum Definition Extraction
Extract enum definitions and their values with type information.

**Parameters:**
- `enum_name` (string, required): The name of the enum to find values for

#### 7. `analyze_dependencies` - Dependency Mapping
Comprehensive dependency analysis with circular dependency detection.

**Parameters:**
- `class_name` (string, required): Target class to analyze dependencies for
- `analysis_type` (enum, optional): Type of analysis (`incoming`, `outgoing`, `bidirectional`, `circular`)
- `depth` (number, optional, default: 3): How deep to traverse dependency chains (1-5)
- `include_system_types` (boolean, optional): Include Unity/System dependencies

#### 8. `find_cross_references` - Cross-Reference Analysis
Find all references to specific code entities across the codebase.

**Parameters:**
- `target_name` (string, required): Name of the target entity
- `target_type` (enum, required): Type of entity (`class`, `method`, `field`, `property`, `event`)
- `reference_type` (enum, optional): Type of references (`usage`, `inheritance`, `implementation`)
- `max_results` (number, optional): Maximum number of references to return

#### 9. `find_design_patterns` - Design Pattern Detection
Detect common design patterns with confidence scoring and examples.

**Parameters:**
- `pattern_types` (array, required): Array of patterns to detect (`singleton`, `observer`, `factory`, `strategy`, etc.)
- `confidence_threshold` (number, optional): Minimum confidence level (0.1-1.0)
- `include_partial_matches` (boolean, optional): Include partial pattern implementations

#### 10. `extract_metadata` - Assembly Metadata Extraction
Extract comprehensive assembly metadata, version information, and compilation flags.

**Parameters:**
- `content` (string, optional): IL2CPP dump content
- `file_path` (string, optional): Path to IL2CPP dump file
- `include_generic_instantiations` (boolean, optional): Include generic type instantiations
- `validate_structure` (boolean, optional): Validate extracted metadata structure

#### 11. `analyze_type_hierarchies` - Type System Analysis
Analyze complex type hierarchies including generics and constraints.

**Parameters:**
- `type_name` (string, required): Target type to analyze
- `include_constraints` (boolean, optional): Include generic constraints
- `max_depth` (number, optional): Maximum hierarchy depth to analyze

#### 12. `analyze_generic_types` - Generic Type Analysis
Specialized analysis of generic types and their instantiations.

**Parameters:**
- `type_name` (string, required): Generic type to analyze
- `include_instantiations` (boolean, optional): Include all instantiations
- `constraint_analysis` (boolean, optional): Analyze type constraints

#### 13. `analyze_type_dependencies` - Type Dependency Analysis
Analyze dependencies between types with detailed relationship mapping.

**Parameters:**
- `type_name` (string, required): Target type for dependency analysis
- `dependency_type` (enum, optional): Type of dependencies to analyze
- `include_indirect` (boolean, optional): Include indirect dependencies

#### 14. `analyze_type_compatibility` - Type Compatibility Analysis
Analyze type compatibility and conversion possibilities.

**Parameters:**
- `source_type` (string, required): Source type name
- `target_type` (string, required): Target type name
- `include_implicit_conversions` (boolean, optional): Include implicit conversions

#### 15. `track_assembly_metadata` - Assembly Version Tracking
Track assembly metadata changes and version comparisons.

**Parameters:**
- `tracking_id` (string, required): Unique tracking identifier
- `comparison_mode` (enum, optional): Comparison mode (`full`, `incremental`, `diff`)
- `include_dependencies` (boolean, optional): Include dependency tracking

#### 16. `analyze_asset_references` - Asset Reference Analysis
Analyze asset references and dependencies within IL2CPP code.

**Parameters:**
- `asset_type` (string, optional): Type of assets to analyze
- `include_missing_references` (boolean, optional): Include missing asset references
- `reference_depth` (number, optional): Depth of reference analysis

#### 17. `find_unused_assets` - Unused Asset Detection
Find potentially unused assets based on IL2CPP code analysis.

**Parameters:**
- `asset_types` (array, optional): Types of assets to check for usage
- `exclude_patterns` (array, optional): Patterns to exclude from analysis
- `confidence_threshold` (number, optional): Confidence threshold for unused detection

#### 18. `analyze_asset_dependencies` - Asset Dependency Analysis
Comprehensive analysis of asset dependencies and circular references.

**Parameters:**
- `include_circular_dependencies` (boolean, optional): Include circular dependency detection
- `asset_type_filter` (array, optional): Filter by specific asset types
- `dependency_depth` (number, optional): Maximum dependency depth to analyze

### ⚙️ Generation Tools (3 tools)

#### 19. `generate_class_wrapper` - C# Class Wrapper Generation
Generate C# wrapper classes from IL2CPP class definitions with full type fidelity.

**Parameters:**
- `class_name` (string, required): Name of the IL2CPP class to generate wrapper for
- `include_methods` (boolean, optional): Include method implementations
- `include_properties` (boolean, optional): Include property implementations
- `generate_interfaces` (boolean, optional): Generate interface definitions
- `custom_namespace` (string, optional): Custom namespace for generated code
- `unity_version` (string, optional): Target Unity version

**Example:**
```typescript
// Generate comprehensive wrapper for Player class
generate_class_wrapper({
  class_name: "Player",
  include_methods: true,
  generate_interfaces: true,
  custom_namespace: "Game.Wrappers"
})
```

#### 20. `generate_method_stubs` - Method Stub Generation
Generate method stubs and interfaces from IL2CPP class definitions.

**Parameters:**
- `class_name` (string, required): Name of the IL2CPP class to generate method stubs for
- `method_filter` (string, optional): Regex pattern to match specific methods
- `include_documentation` (boolean, optional): Include XML documentation comments
- `include_error_handling` (boolean, optional): Include error handling and validation
- `generate_async` (boolean, optional): Generate async/await patterns where applicable

#### 21. `generate_monobehaviour_template` - Unity MonoBehaviour Template Generation
Generate Unity-ready MonoBehaviour scripts with common patterns and lifecycle methods.

**Parameters:**
- `class_name` (string, required): Name of the IL2CPP MonoBehaviour class
- `template_type` (string, optional): Template type (`basic`, `ui`, `gameplay`, `system`)
- `include_lifecycle_methods` (boolean, optional): Include Unity lifecycle methods
- `include_unity_events` (boolean, optional): Include UnityEvent implementations
- `include_serialized_fields` (boolean, optional): Include SerializeField attributes

## 🤖 Agentic Workflows and Usage Examples

### Intelligent Tool Orchestration

The agentic layer automatically chains tools for complex analysis tasks:

```typescript
// Example: Comprehensive Player class analysis
// The system automatically orchestrates multiple tools:

1. search_code({ query: "Player", filter_type: "class" })
2. find_class_hierarchy({ class_name: "Player" })
3. analyze_dependencies({ class_name: "Player", analysis_type: "bidirectional" })
4. find_design_patterns({ pattern_types: ["singleton", "observer"] })
5. generate_class_wrapper({ class_name: "Player", include_methods: true })

// All executed intelligently with context preservation
```

### Context-Awar

…

## Source & license

This open-source MCP server is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [djfaizp](https://github.com/djfaizp)
- **Source:** [djfaizp/il2cpp-dump-analyzer](https://github.com/djfaizp/il2cpp-dump-analyzer)
- **License:** MIT

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** yes
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/mcp-djfaizp-il2cpp-dump-analyzer
- Seller: https://agentstack.voostack.com/s/djfaizp
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
