Unity Scanner

Unified Unity Editor and MCP tool for project health — one window for dependency scans, material and shader audits, Addressables layout checks, and automated CI gates.

Run from Tools > Unity Scanner, batch mode, or AI assistants via the MCP server.

GitHub

Batch API

Programmatic entry points for CI and batch mode. All runners return BatchResult and accept an optional BatchOptions.

UnityScannerBatch.RunAll

BatchResult RunAll(BatchOptions options = null)

Runs all enabled analysis categories sequentially and aggregates results.

options
BatchOptions
Optional batch configuration (categories, platform profile, fail severity, output path).
using UnityScanner.Batch;

var result = UnityScannerBatch.RunAll(new BatchOptions {
    Categories = new[] { "dependencies", "missing_references", "materials" },
    PlatformProfile = "mobile",
    FailOnSeverity = "warn"
});

UnityScannerBatch.RunDependencies

BatchResult RunDependencies(BatchOptions options = null)

Scans the dependencies category — finds unreferenced and unused assets via reverse-dependency map.

options
BatchOptions
Optional batch configuration.
UnityScannerBatch.RunDependencies();

UnityScannerBatch.RunMissingReferences

BatchResult RunMissingReferences(BatchOptions options = null)

Scans scenes, prefabs, and ScriptableObjects for broken GUID/FileID references and missing scripts.

options
BatchOptions
Optional batch configuration.
UnityScannerBatch.RunMissingReferences();

UnityScannerBatch.RunMaterials

BatchResult RunMaterials(BatchOptions options = null)

Scans the materials category — null/builtin materials, missing shaders, duplicates, and SRP batcher compatibility.

options
BatchOptions
Optional batch configuration.

UnityScannerBatch.RunTextures

BatchResult RunTextures(BatchOptions options = null)

Scans SpriteAtlases and Texture2D assets for atlas duplicates, compression issues, and oversized textures.

options
BatchOptions
Optional batch configuration.

UnityScannerBatch.RunAddressables

BatchResult RunAddressables(BatchOptions options = null)

Parses Addressables Build Layout for circular dependencies, remote dependency issues, and duplicate assets.

options
BatchOptions
Set BuildLayoutPath for the layout file to analyze.
var result = UnityScannerBatch.RunAddressables(new BatchOptions {
    BuildLayoutPath = "BuildReports/BuildLayout.txt",
    FailOnSeverity = "warn"
});

UnityScannerBatch.RunShaderAnalysis

BatchResult RunShaderAnalysis(BatchOptions options = null)

Finds error shaders, variant explosion, expensive keywords, and render pipeline mismatches.

options
BatchOptions
Optional batch configuration; PlatformProfile adjusts variant thresholds.
UnityScannerBatch.RunShaderAnalysis(new BatchOptions { PlatformProfile = "mobile" });

UnityScannerBatch.RunTerrainAnalysis

BatchResult RunTerrainAnalysis(BatchOptions options = null)

Checks terrain colliders, layers, control map memory, and density overages.

options
BatchOptions
Optional batch configuration.

UnityScannerBatch.RunFontTextAnalysis

BatchResult RunFontTextAnalysis(BatchOptions options = null)

Detects TMP atlas growth risks, oversized atlases, and deep fallback chains.

options
BatchOptions
Optional batch configuration.

UnityScannerBatch.RunAudioAnalysis

BatchResult RunAudioAnalysis(BatchOptions options = null)

Finds load-type mismatches, oversized clips, and duplicate audio files.

options
BatchOptions
Optional batch configuration.

UnityScannerBatch.RunAnimationAnalysis

BatchResult RunAnimationAnalysis(BatchOptions options = null)

Detects unreachable states, missing clips, state machine complexity, and duplicate clips.

options
BatchOptions
Optional batch configuration.

UnityScannerBatch.RunScenePrefabHealth

BatchResult RunScenePrefabHealth(BatchOptions options = null)

Checks deep nesting, override explosion, broken references, and inactive object anti-patterns.

options
BatchOptions
Optional batch configuration.

UnityScannerBatch.RunBuildPlatformReadiness

BatchResult RunBuildPlatformReadiness(BatchOptions options = null)

Validates import policies, platform compatibility, stripping risks, and startup budgets.

options
BatchOptions
PlatformProfile and FailOnSeverity are commonly set for CI gates.
var result = UnityScannerBatch.RunBuildPlatformReadiness(new BatchOptions {
    PlatformProfile = "mobile",
    FailOnSeverity = "error"
});

UnityScannerBatch.RunParticleAnalysis

BatchResult RunParticleAnalysis(BatchOptions options = null)

Audits particle systems for emission limits, module count, trails, collision, and overdraw risks.

options
BatchOptions
Optional batch configuration with particle-specific thresholds.

UnityScannerBatch.RunUICanvasAnalysis

BatchResult RunUICanvasAnalysis(BatchOptions options = null)

Checks UI canvases for raycast targets, TMP mixing, vertex count, and nesting depth.

options
BatchOptions
Optional batch configuration with UI-specific thresholds.

UnityScannerBatch.RunLightingAnalysis

BatchResult RunLightingAnalysis(BatchOptions options = null)

Audits lighting for emissive GI, mixed-mode consistency, realtime light counts, and probe usage.

options
BatchOptions
Optional batch configuration with lighting-specific thresholds.

UnityScannerBatch.RunLODAnalysis

BatchResult RunLODAnalysis(BatchOptions options = null)

Checks LOD groups for missing levels, material mismatches, and screen transition settings.

options
BatchOptions
Optional batch configuration with LOD-specific thresholds.

UnityScannerBatch.RunPhysicsAnalysis

BatchResult RunPhysicsAnalysis(BatchOptions options = null)

Audits rigidbody counts, mesh collider complexity, layer matrix, and physics materials.

options
BatchOptions
Optional batch configuration with physics-specific thresholds.

UnityScannerBatch.RunAsmDefAudit

BatchResult RunAsmDefAudit(BatchOptions options = null)

Audits assembly definitions for circular references, editor leakage, platform filters, and duplicates.

options
BatchOptions
Optional batch configuration with asmdef audit flags.

UnityScannerBatch.RunProjectHealth

BatchResult RunProjectHealth(BatchOptions options = null)

Detects empty folders, orphaned .meta files, broken assets, empty scenes, and oversized directories.

options
BatchOptions
Optional batch configuration.

UnityScannerBatch.RunSprite2DAnalysis

BatchResult RunSprite2DAnalysis(BatchOptions options = null)

Checks 2D sprites for atlas unused ratio, packing issues, duplicates, and polygon vertex counts.

options
BatchOptions
Optional batch configuration with sprite-specific thresholds.

UnityScannerBatch.RunRegressionTrend

BatchResult RunRegressionTrend(BatchOptions options = null)

Compares scan results against a saved baseline to detect regressions and improvements.

options
BatchOptions
Set BaselinePath and RegressionThreshold for CI regression gates.
var result = UnityScannerBatch.RunRegressionTrend(new BatchOptions {
    BaselinePath = "CI/baseline.json",
    RegressionThreshold = 0,
    FailOnSeverity = "warn"
});

UnityScannerBatch.RunSelectedCategories

BatchResult RunSelectedCategories(string[] categoryIds, BatchOptions options = null)

Runs a custom list of categories by ID in order.

categoryIds
string[]
Category IDs to scan (e.g. dependencies, materials, project_health).
options
BatchOptions
Optional batch configuration.
UnityScannerBatch.RunSelectedCategories(
    new[] { "dependencies", "shader_analysis" },
    new BatchOptions { PlatformProfile = "mobile" }
);

MCP Architecture

The MCP server uses a bridge architecture. Each tool call launches Unity in batch mode; results are written to a temp file and returned as text and JSON.

AI Client → stdio JSON-RPC → Node.js MCP Server → Unity batch mode → UnityScanner API → JSON result file

MCP Server

Tools exposed to AI coding assistants. Each call runs a fresh Unity batch instance (~10–30s startup).

unity_scanner_run_all

Run all enabled UnityScanner categories and return a full project health report. This is the most comprehensive scan.

"Run a full project scan and tell me what's wrong"

unity_scanner_run_category

Run a specific UnityScanner category by ID. Use unity_scanner_list_categories to discover available IDs.

category
string
Category ID to scan (e.g. dependencies, shader_analysis, project_health).
"Check my project for shader issues"

unity_scanner_run_selected

Run multiple selected UnityScanner categories by their IDs.

categories
string[]
Array of category IDs to scan (e.g. ["dependencies", "materials", "project_health"]).

unity_scanner_list_categories

List all available UnityScanner categories with their IDs and enabled status.

"List all available scanner categories"

unity_scanner_get_settings

Get current UnityScanner settings including active platform profile and category enable/disable states.

unity_scanner_set_profile

Set the platform profile for threshold comparisons. Profiles adjust severity thresholds for mobile, console, or desktop targets.

profile
string
Platform profile: mobile, console, or desktop.
"Set the platform profile to mobile, then run project_health and build_platform_readiness"

unity_scanner_regression_check

Compare current scan results against a previously saved baseline to detect regressions (new issues).

baseline_path
string
Path to the baseline JSON file to compare against.

unity_scanner_baseline_create

Run a full scan and save results as a baseline snapshot for future regression comparisons.

"Create a baseline snapshot of current project health"