docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Namespace Unity.AI.MCP.Editor.Tools

    Classes

    ApplyTextEdits

    Handles applying small text edits to C# scripts identified by URI.

    CreateScript

    Handles creation of new C# scripts at specified project paths.

    DeleteScript

    Handles deletion of C# scripts by URI or Assets-relative path.

    GetSHA

    Handles getting SHA256 and basic metadata for Unity C# scripts without returning file contents.

    ImportExternalModel

    Handles importing assets from outside the Unity project. Creates GameObject in the scene and creates a prefab for reuse.

    ManageAsset

    Handles asset management operations within the Unity project.

    ManageEditor

    Handles operations related to controlling and querying the Unity Editor state, including managing Tags and Layers.

    ManageGameObject

    Handles GameObject manipulation within the current scene (CRUD, find, components).

    ManageMenuItem

    Supports execute, list, exists, and refresh operations with caching and search capabilities.

    ManageScene

    Handles scene management operations like loading, saving, creating, and querying hierarchy.

    ManageScript

    Handles CRUD operations for C# scripts within the Unity project.

    ROSLYN INSTALLATION GUIDE: To enable advanced syntax validation with Roslyn compiler services:

    1. Install Microsoft.CodeAnalysis.CSharp NuGet package:

      • Open Package Manager in Unity
      • Follow the instruction on https://github.com/GlitchEnzo/NuGetForUnity
    2. Open NuGet Package Manager and Install Microsoft.CodeAnalysis.CSharp:

    3. Alternative: Manual DLL installation:

      • Download Microsoft.CodeAnalysis.CSharp.dll and dependencies
      • Place in Assets/Plugins/ folder
      • Ensure .NET compatibility settings are correct
    4. Define USE_ROSLYN symbol:

      • Go to Player Settings > Scripting Define Symbols
      • Add "USE_ROSLYN" to enable Roslyn-based validation
    5. Restart Unity after installation

    Note: Without Roslyn, the system falls back to basic structural validation. Roslyn provides full C# compiler diagnostics with line numbers and detailed error messages.

    ManageScriptCapabilities

    Handles getting Unity.ManageScript capabilities including supported operations, limits, and guards.

    ManageShader

    Handles CRUD operations for shader files within the Unity project.

    ReadConsole

    Handles reading and clearing Unity Editor console log entries. Uses reflection to access internal LogEntry methods/properties.

    ResourceTools

    Resource wrapper tools so clients that do not expose MCP resources primitives can still list and read files via normal tools. These call into the same safe path logic to ensure security.

    RunCommand

    Handles compilation and execution of C# scripts in the Unity environment. Combines validation and execution into a single operation by delegating to RunCommandValidatorTool and RunCommandTool.

    ScriptApplyEdits

    Structured C# script editing with safer boundaries and comprehensive validation. This tool provides advanced script editing capabilities including method/class operations and anchor-based pattern matching with improved heuristics.

    ValidateScript

    Handles validation of C# scripts and returns diagnostics.

    In This Article
    Back to top
    Copyright © 2026 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)