website/docs/guides/roslyn.md
By default, MCP for Unity uses a fast structural validator for scripts the LLM generates. For strict validation that catches undefined namespaces, types, and methods at write time — without a full Unity compile — install the optional Roslyn DLLs.
Most users don't need this. Enable it when:
The installer downloads the required NuGet packages, places the DLLs in Assets/Plugins/Roslyn/, and adds USE_ROSLYN to Scripting Define Symbols.
You can also trigger it from the menu: Window → MCP For Unity → Install Roslyn DLLs.
Microsoft.CodeAnalysis v5.0SQLitePCLRaw.core v3.0.2SQLitePCLRaw.bundle_e_sqlite3 v3.0.2USE_ROSLYN to Player Settings → Scripting Define Symbols.Microsoft.CodeAnalysis.CSharp.dll and its dependencies from NuGet.org.Assets/Plugins/Roslyn/.USE_ROSLYN to Scripting Define Symbols.After restart, the MCP for Unity status panel shows Roslyn: enabled under the Scripts section. The validate_script tool now performs full semantic analysis rather than the structural pass.
Remove USE_ROSLYN from Scripting Define Symbols. The plugin falls back to structural validation; the DLLs can stay in Assets/Plugins/Roslyn/ or be removed.