#1403·unity-mcp

manage_components (add/set_property) and component resource throw NotImplementedException on components with NetworkVariable<T> fields

Author: Juris-SCreated Sep 15, 2026Updated Sep 15, 2026

Summary

Any component with a NetworkVariable field (Unity Netcode for GameObjects) fails when touched through MCP-for-Unity's component tools/resources, both in and out of Play mode.

Repro

  1. Create a NetworkBehaviour with a public NetworkVariable (or any NetworkVariable) field.
  2. Add it to a GameObject that has a NetworkObject.
  3. Call manage_components with action add, or set_property on any field, targeting that component. Also fails reading via the mcpforunity://scene/gameobject/{id}/component/{name} resource.

Observed

All three throw the same underlying exception, visible in the Unity console:

System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.NotImplementedException: The method or operation is not implemented.

Reproduced with Unity.Netcode.NetworkObject itself (add failed the same way) and with a custom NetworkBehaviour exposing NetworkVariable and NetworkVariable fields.

Expected

Component add/read/write succeeds, or fails with a clear message instead of an unhandled NotImplementedException, likely something in NGO's custom property drawer/editor for NetworkVariable being invoked through generic reflection where it isn't supported outside its normal Inspector GUI path.

Workaround

Use execute_code with UnityEditor.SerializedObject / SerializedProperty directly instead of manage_components. This sidesteps whatever reflection path trips the exception.

Environment

  • Unity 6000.6.0f1
  • Unity Netcode for Game Objects (NGO)
  • MCP-for-Unity v10.2.0 (com.coplaydev.unity-mcp)

Repro project

Happy to share a minimal repro (single NetworkBehaviour + NetworkVariable) if useful.