unity-mcp/MCPForUnity/Editor/Tools
dsarno a0287afbbc
Harden MCP tool parameter handling + add material workflow tests (TDD) (#343)
* Add TDD tests for MCP material management issues

- MCPMaterialTests.cs: Tests for material creation, assignment, and data reading
- MCPParameterHandlingTests.cs: Tests for JSON parameter parsing issues
- SphereMaterialWorkflowTests.cs: Tests for complete sphere material workflow

These tests document the current issues with:
- JSON parameter parsing in manage_asset and manage_gameobject tools
- Material creation with properties
- Material assignment to GameObjects
- Material component data reading

All tests currently fail (Red phase of TDD) and serve as specifications
for what needs to be fixed in the MCP system.

* Refine TDD tests to focus on actual MCP tool parameter parsing issues

- Removed redundant tests that verify working functionality (GameObjectSerializer, Unity APIs)
- Kept focused tests that document the real issue: MCP tool parameter validation
- Tests now clearly identify the root cause: JSON string parsing in MCP tools
- Tests specify exactly what needs to be fixed: parameter type flexibility

The issue is NOT in Unity APIs or serialization (which work fine),
but in MCP tool parameter validation being too strict.

* Fix port discovery protocol mismatch

- Update _try_probe_unity_mcp to recognize Unity bridge welcome message
- Unity bridge sends 'WELCOME UNITY-MCP' instead of JSON pong response
- Maintains backward compatibility with JSON pong format
- Fixes MCP server connection to Unity Editor

* Resolve merge: unify manage_gameobject param coercion and schema widening

* Tests: add MaterialParameterToolTests; merge port probe fix; widen tool schemas for JSON-string params

* refactor: extract JSON coercion helper; docs + exception narrowing\nfix: fail fast on bad component_properties JSON\ntest: unify setup, avoid test-to-test calls\nchore: use relative MCP package path

* chore(tests): track MCPToolParameterTests.cs.meta to keep GUID stable

* test: decouple MaterialParameterToolTests with helpers (no inter-test calls)
2025-10-23 17:57:27 -07:00
..
Prefabs Rename plugin folder to MCPForUnity (#303) 2025-10-03 20:23:28 -04:00
CommandRegistry.cs Add testing and move menu items to resources (#316) 2025-10-13 11:16:43 -04:00
CommandRegistry.cs.meta Rename plugin folder to MCPForUnity (#303) 2025-10-03 20:23:28 -04:00
ExecuteMenuItem.cs Add testing and move menu items to resources (#316) 2025-10-13 11:16:43 -04:00
ExecuteMenuItem.cs.meta Add testing and move menu items to resources (#316) 2025-10-13 11:16:43 -04:00
JsonUtil.cs Harden MCP tool parameter handling + add material workflow tests (TDD) (#343) 2025-10-23 17:57:27 -07:00
ManageAsset.cs Harden MCP tool parameter handling + add material workflow tests (TDD) (#343) 2025-10-23 17:57:27 -07:00
ManageAsset.cs.meta Rename plugin folder to MCPForUnity (#303) 2025-10-03 20:23:28 -04:00
ManageEditor.cs Add testing and move menu items to resources (#316) 2025-10-13 11:16:43 -04:00
ManageEditor.cs.meta Rename plugin folder to MCPForUnity (#303) 2025-10-03 20:23:28 -04:00
ManageGameObject.cs Harden MCP tool parameter handling + add material workflow tests (TDD) (#343) 2025-10-23 17:57:27 -07:00
ManageGameObject.cs.meta Rename plugin folder to MCPForUnity (#303) 2025-10-03 20:23:28 -04:00
ManageScene.cs Rename plugin folder to MCPForUnity (#303) 2025-10-03 20:23:28 -04:00
ManageScene.cs.meta Rename plugin folder to MCPForUnity (#303) 2025-10-03 20:23:28 -04:00
ManageScript.cs New UI and work without MCP server embedded (#313) 2025-10-11 03:08:16 -04:00
ManageScript.cs.meta Rename plugin folder to MCPForUnity (#303) 2025-10-03 20:23:28 -04:00
ManageShader.cs Rename plugin folder to MCPForUnity (#303) 2025-10-03 20:23:28 -04:00
ManageShader.cs.meta Rename plugin folder to MCPForUnity (#303) 2025-10-03 20:23:28 -04:00
McpForUnityToolAttribute.cs Rename plugin folder to MCPForUnity (#303) 2025-10-03 20:23:28 -04:00
McpForUnityToolAttribute.cs.meta Rename plugin folder to MCPForUnity (#303) 2025-10-03 20:23:28 -04:00
Prefabs.meta Rename plugin folder to MCPForUnity (#303) 2025-10-03 20:23:28 -04:00
ReadConsole.cs Rename plugin folder to MCPForUnity (#303) 2025-10-03 20:23:28 -04:00
ReadConsole.cs.meta Rename plugin folder to MCPForUnity (#303) 2025-10-03 20:23:28 -04:00
RunTests.cs Add testing and move menu items to resources (#316) 2025-10-13 11:16:43 -04:00
RunTests.cs.meta Add testing and move menu items to resources (#316) 2025-10-13 11:16:43 -04:00