Skip to content

Feature: Add Prefab Editor Inspection & Modification Support #97

@KamilDev

Description

@KamilDev

I'm trying to work with a modal window prefab, but it seems the MCP doesn't have sufficient tools for working with opened prefabs (not in scene view).

Specifically, I double-click a prefab asset in the project file browser, which opens the prefab in a special isolated view -- that's what I want to work with using the MCP.

My ideal workflow would be:

  • Inside the prefab, I create the UI I want myself.
  • The AI can access the properties of objects (such as text content) to intelligently rename objects that have a generic default name.
  • The AI can hook up these objects into the root parent object modal script serialized fields accordingly.

I tried a basic test of trying to get the AI to access the actively open prefab, rename a generically named text object with the text value "10" to a more descriptive "countdown text" name.

It couldn't access the opened prefab, so I gave the path manually, but it still seems to not be able to access the hierarchy or enough information to do anything useful.

I had the AI generate an issue request, if you find it useful:

Issue Description

The current Unity MCP tools lack functionality to work with prefabs that are actively being edited in the prefab editor. This limitation prevents basic prefab inspection and modification operations that would be valuable for AI-assisted workflows.

Requested Features

  1. Access to actively selected/open prefab

    • Add ability to detect and reference the prefab currently being edited in the prefab editor
    • Return prefab path, type, and basic metadata
  2. Prefab hierarchy inspection

    • List complete hierarchy of GameObjects within the prefab
    • Include component types, names, and relevant properties for each GameObject
    • Support filtering by component type or property value
  3. Text content searching

    • Add capability to find UI elements with specific text content
    • Support exact matches and pattern-based searches
    • Return hierarchy path to matching elements
  4. GameObject renaming in prefab context

    • Allow renaming of GameObjects within a prefab hierarchy
    • Support renaming by direct GameObject reference

Use Case Example

When editing a UI prefab, an assistant should be able to:

  1. Detect the prefab is open for editing
  2. List its full hierarchy
  3. Find a TextMeshProUGUI component displaying "10"
  4. Rename its GameObject to a more descriptive name like "CountdownText"

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions