* Add EditorPrefs management window for MCP configuration debugging
Meant to help with dev and testing, not so much the average user
* Update MCPForUnity/Editor/Windows/EditorPrefs/EditorPrefsWindow.cs
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
* Revert "Update MCPForUnity/Editor/Windows/EditorPrefs/EditorPrefsWindow.cs"
This reverts commit 09bb4e1d2582678bc87d0ace45f9d8c3c88c3203.
* Reapply "Update MCPForUnity/Editor/Windows/EditorPrefs/EditorPrefsWindow.cs"
This reverts commit 6ccbc5e478f0bd2b61c992ae60db0ca367d651ae.
* Fix EditorPrefs type detection using sentinel values and null handling
* Simplify EditorPrefs type detection using known type mapping and basic parsing
Replace complex sentinel-based type detection with a dictionary of known pref types and simple TryParse fallback for unknown keys. Remove null handling and HasKey checks for known keys since they're defined in EditorPrefKeys.
---------
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
* Fix test teardown to avoid dropping MCP bridge
CodexConfigHelperTests was calling MCPServiceLocator.Reset() in TearDown, which disposes the active bridge/transport during MCP-driven test runs. Replace with restoring only the mutated service (IPlatformService).
* Avoid leaking PlatformService in CodexConfigHelperTests
Capture the original IPlatformService before this fixture runs and restore it in TearDown. This preserves the MCP connection safety fix (no MCPServiceLocator.Reset()) while avoiding global state leakage to subsequent tests.
* Fix SO MCP tooling: validate folder roots, normalize paths, expand tests; remove vestigial SO tools
* Remove UnityMCPTests stress artifacts and ignore Assets/Temp
* Ignore UnityMCPTests Assets/Temp only
* Clarify array_resize fallback logic comments
* Refactor: simplify action set and reuse slash sanitization
* Enhance: preserve GUID on overwrite & support Vector/Color types in ScriptableObject tools
* Fix: ensure asset name matches filename to suppress Unity warnings
* Fix: resolve Unity warnings by ensuring asset name match and removing redundant import
* Refactor: Validate assetName, strict object parsing for vectors, remove broken SO logic from ManageAsset
* Hardening: reject Windows drive paths; clarify supported asset types
* Delete FixscriptableobjecPlan.md
* Paginate get_hierarchy and get_components to prevent large payload crashes
* dev: add uvx dev-mode refresh + safer HTTP stop; fix server typing eval
* Payload-safe paging defaults + docs; harden asset search; stabilize Codex tests
* chore: align uvx args + coercion helpers; tighten safety guidance
* chore: minor cleanup + stabilize EditMode SO tests
* Fix test teardown to avoid dropping MCP bridge
CodexConfigHelperTests was calling MCPServiceLocator.Reset() in TearDown, which disposes the active bridge/transport during MCP-driven test runs. Replace with restoring only the mutated service (IPlatformService).
* Avoid leaking PlatformService in CodexConfigHelperTests
Capture the original IPlatformService before this fixture runs and restore it in TearDown. This preserves the MCP connection safety fix (no MCPServiceLocator.Reset()) while avoiding global state leakage to subsequent tests.
* Fix SO MCP tooling: validate folder roots, normalize paths, expand tests; remove vestigial SO tools
* Remove UnityMCPTests stress artifacts and ignore Assets/Temp
* Ignore UnityMCPTests Assets/Temp only
* Clarify array_resize fallback logic comments
* Refactor: simplify action set and reuse slash sanitization
* Enhance: preserve GUID on overwrite & support Vector/Color types in ScriptableObject tools
* Fix: ensure asset name matches filename to suppress Unity warnings
* Fix: resolve Unity warnings by ensuring asset name match and removing redundant import
* Refactor: Validate assetName, strict object parsing for vectors, remove broken SO logic from ManageAsset
* Hardening: reject Windows drive paths; clarify supported asset types
* Delete FixscriptableobjecPlan.md
* docs: Add manage_scriptable_object tool description to README
* Fix#478: Add Matrix4x4Converter to prevent Cinemachine serialization crash
The `get_components` action crashes Unity when serializing Cinemachine
camera components because Newtonsoft.Json accesses computed Matrix4x4
properties (lossyScale, rotation) that call ValidTRS() on non-TRS matrices.
This fix adds a safe Matrix4x4Converter that only accesses raw matrix
elements (m00-m33), avoiding the dangerous computed properties entirely.
Changes:
- Add Matrix4x4Converter to UnityTypeConverters.cs
- Register converter in GameObjectSerializer serializer settings
Tested with Cinemachine 3.1.5 on Unity 6 - get_components now returns
full component data without crashing.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* Add unit tests for Matrix4x4Converter
Tests cover:
- Identity matrix serialization/deserialization
- Translation matrix round-trip
- Degenerate matrix (determinant=0) - key regression test
- Non-TRS matrix (projection) - validates ValidTRS() is never called
- Null handling
- Ensures dangerous properties are not in output
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* Address code review feedback
- Fix null handling consistency: return zero matrix instead of identity
(consistent with missing field defaults of 0f)
- Improve degenerate matrix test to verify:
- JSON only contains raw mXY properties
- Values roundtrip correctly
- Rename test to reflect expanded coverage
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* Move tests to TestProject per review feedback
Moved Matrix4x4ConverterTests from MCPForUnity/Editor/Tests/ to
TestProjects/UnityMCPTests/Assets/Tests/EditMode/Helpers/ as requested.
Also added MCPForUnity.Runtime reference to the test asmdef since
the converter lives in the Runtime assembly.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* Fix Matrix4x4 deserialization guard + UI Toolkit USS warning
---------
Co-authored-by: Alexander Mangel <cygnusfear@gmail.com>
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
* Add missing meta files
* Re-generate .meta files
It was for safety as some were AI generated before. Only minor changes were made
* Remove distribution settings and hardcode default localhost URL
Removes the McpDistributionSettings system that allowed different defaults for Asset Store vs git distributions. Hardcodes the default HTTP base URL to "http://localhost:8080" directly in HttpEndpointUtility and WebSocketTransportClient. Removes the setup window skip logic for remote defaults.
It didn't work in practice, best thing to do is replace the placeholder in the UXML
- Change migration to always clean up legacy keys, even on partial failures
- Upgrade migration messages from Debug to Warn/Info for better visibility
- Add explicit warning when failures occur that manual configuration is needed
- Remove early return on failures to ensure legacy keys are always deleted
- Prevents migration retry loops when some clients fail to configure
Adds KiloCodeConfigurator to enable automatic MCP configuration for
Kilo Code VS Code extension users.
Closes#250
Co-authored-by: Berkant <Nonanti@users.noreply.github.com>
* Fix script path handling and FastMCP Context API usage
1. Fix script path doubling when Assets prefix is used
- ManageScript.TryResolveUnderAssets now properly handles both Assets and Assets/ prefixes
- Previously, paths like Assets/Script.cs would create files at Assets/Assets/Script.cs
- Now correctly strips the prefix and creates files at the intended location
2. Fix FastMCP Context API call in manage_asset
- Changed ctx.warn() to ctx.warning() to match FastMCP Context API
- Fixes AttributeError when manage_asset encounters property parse errors
- Affects ScriptableObject creation and other asset operations with invalid properties
* Fix manage_asset error handling to use ctx.error
Changed ctx.warning to ctx.error for property parse errors in manage_asset
tool to properly handle error cases. This ensures parse errors are reported
as errors rather than warnings, and fixes compatibility with FastMCP Context API.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
* Update github-repo-stats.yml
* Server: refine shutdown logic per bot feedback\n- Parameterize _force_exit(code) and use timers with args\n- Consistent behavior on BrokenPipeError (no immediate exit)\n- Exit code 1 on unexpected exceptions\n\nTests: restore telemetry module after disabling to avoid bleed-over
* Revert "Server: refine shutdown logic per bot feedback\n- Parameterize _force_exit(code) and use timers with args\n- Consistent behavior on BrokenPipeError (no immediate exit)\n- Exit code 1 on unexpected exceptions\n\nTests: restore telemetry module after disabling to avoid bleed-over"
This reverts commit 74d35d371a28b2d86cb7722e28017b29be053efd.
* Add fork-only Unity tests workflow and guard upstream run
* Move fork Unity tests workflow to root
* Fix MCP server install step in NL suite workflow
* Harden NL suite prompts for deterministic anchors
* update claude haiku version for NL/T tests
* Fix CI: share unity-mcp status dir
* update yaml
* Add Unity bridge debug step in CI
* Fail fast when Unity MCP status file missing
* Allow Unity local share writable for MCP status
* Mount Unity cache rw and dump Editor log for MCP debug
* Allow Unity config dir writable for MCP heartbeat/logs
* Write Unity logs to file and list config dir in debug
* Use available Anthropic models for T pass
* Use latest claude sonnet/haiku models in workflow
* Fix YAML indentation for MCP preflight step
* Point MCP server to src/server.py and fix preflight
* another try
* Add MCP preflight workflow and update NL suite
* Fixes to improve CI testing
* Cleanup
* fixes
* diag
* fix yaml
* fix status dir
* Fix YAML / printing to stdout --> stderr
* find in file fixes.
* fixes to find_in_file and CI report format error
* Only run the stats on the CoPlay main repo, not forks.
* Coderabbit fixes.
* Fixed ArrayPool conflict with CString.dll ArrayPool in Tolua
Fixed ArrayPool conflict with CString.dll ArrayPool in Tolua
* ScreenCapture在Unity2022中才支持
ScreenCapture在Unity2022中才支持,增加Unity版本判断
* [FEATURE] Local MCPForUnity Deployment
Similar to deploy.bat, but sideload it to MCP For Unity for easier deployment inside Unity menu.
* Update PackageDeploymentService.cs
* Update with meta file
* Updated Readme
* Updates on Camera Capture Feature
* Enable Camera Capture through both play and editor mode
Notes: Because the standard ScreenCapture.CaptureScreenshot does not work in editor mode, so we use ScreenCapture.CaptureScreenshotIntoRenderTexture to enable it during play mode.
* The user can access the camera access through the tool menu or through direct LLM calling. Both tested on Windows with Claude Desktop.
* Minor changes
nitpicking changes
* WIP: Material management tool implementation and tests
- Add ManageMaterial tool for creating and modifying materials
- Add MaterialOps helper for material property operations
- Add comprehensive test suite for material management
- Add string parameter parsing support for material properties
- Update related tools (ManageGameObject, manage_asset, etc.)
- Add test materials and scenes for material testing
* refactor: unify material property logic into MaterialOps
- Move and logic from to
- Update to delegate to
- Update to use enhanced for creation and property setting
- Add texture path loading support to
* Add parameter aliasing support: accept 'name' as alias for 'target' in manage_gameobject modify action
* Refactor ManageMaterial and fix code review issues
- Fix Python server tools (redundant imports, exception handling, string formatting)
- Clean up documentation and error reports
- Improve ManageMaterial.cs (overwrite checks, error handling)
- Enhance MaterialOps.cs (robustness, logging, dead code removal)
- Update tests (assertions, unused imports)
- Fix manifest.json relative path
- Remove temporary test artifacts and manual setup scripts
* Remove test scene
* remove extra mat
* Remove unnecessary SceneTemplateSettings.json
* Remove unnecessary SceneTemplateSettings.json
* Fix MaterialOps issues
* Fix: Case-insensitive material property lookup and missing HasProperty checks
* Rabbit fixes
* Improve material ops logging and test coverage
* Fix: NormalizePath now handles backslashes correctly using AssetPathUtility
* Fix: Address multiple nitpicks (test robustness, shader resolution, HasProperty checks)
* Add manage_material tool documentation and fix MaterialOps texture property checks
- Add comprehensive ManageMaterial tool documentation to MCPForUnity/README.md
- Add manage_material to tools list in README.md and README-zh.md
- Fix MaterialOps.cs to check HasProperty before SetTexture calls to prevent Unity warnings
- Ensures consistency with other property setters in MaterialOps
* Fix ManageMaterial shader reflection for Unity 6 and improve texture logging
* Update .Bat file and Bug fix on ManageScript
* Update the .Bat file to include runtime folder
* Fix the inconsistent EditorPrefs variable so the GUI change on Script Validation could cause real change.
* Further changes
String to Int for consistency
* [Custom Tool] Roslyn Runtime Compilation
Allows users to generate/compile codes during Playmode
* Fix based on CR
* Create claude_skill_unity.zip
Upload the unity_claude_skill that can be uploaded to Claude for a combo of unity-mcp-skill.
* Update for Custom_Tool Fix and Detection
1. Fix Original Roslyn Compilation Custom Tool to fit the V8 standard
2. Add a new panel in the GUI to see and toggle/untoggle the tools. The toggle feature will be implemented in the future, right now its implemented here to discuss with the team if this is a good feature to add;
3. Add few missing summary in certain tools
* Revert "Update for Custom_Tool Fix and Detection"
This reverts commit ae8cfe5e256c70ac4a16c79d50341a39cbac18ba.
* Update README.md
* Reapply "Update for Custom_Tool Fix and Detection"
This reverts commit f423c2f25e9ccff4f3b89d1d360ee9cf13143733.
* Update ManageScript.cs
Fix the layout problem of manage_script in the panel
* Update
To comply with the current server setting
* Update on Batch
Tested object generation/modification with batch and it works perfectly! We should push and let users test for a while and see
PS: I tried both VS Copilot and Claude Desktop. Claude Desktop works but VS Copilot does not due to the nested structure of batch. Will look into it more.
* Revert "Merge pull request #1 from Scriptwonder/batching"
This reverts commit 55ee76810be161d414e1f5f5abaa5ee30ddd0052, reversing
changes made to ae2eedd7fb2c6a66ff008bacac481aefb1b0d176.
* Update .Bat file and Bug fix on ManageScript
* Update the .Bat file to include runtime folder
* Fix the inconsistent EditorPrefs variable so the GUI change on Script Validation could cause real change.
* Further changes
String to Int for consistency
* [Custom Tool] Roslyn Runtime Compilation
Allows users to generate/compile codes during Playmode
* Fix based on CR
* Create claude_skill_unity.zip
Upload the unity_claude_skill that can be uploaded to Claude for a combo of unity-mcp-skill.
* Update for Custom_Tool Fix and Detection
1. Fix Original Roslyn Compilation Custom Tool to fit the V8 standard
2. Add a new panel in the GUI to see and toggle/untoggle the tools. The toggle feature will be implemented in the future, right now its implemented here to discuss with the team if this is a good feature to add;
3. Add few missing summary in certain tools
* Revert "Update for Custom_Tool Fix and Detection"
This reverts commit ae8cfe5e256c70ac4a16c79d50341a39cbac18ba.
* Update README.md
* Reapply "Update for Custom_Tool Fix and Detection"
This reverts commit f423c2f25e9ccff4f3b89d1d360ee9cf13143733.
* Update ManageScript.cs
Fix the layout problem of manage_script in the panel
* Update
To comply with the current server setting
* Update on Batch
Tested object generation/modification with batch and it works perfectly! We should push and let users test for a while and see
PS: I tried both VS Copilot and Claude Desktop. Claude Desktop works but VS Copilot does not due to the nested structure of batch. Will look into it more.
* Revert "Merge branch 'main' into batching"
This reverts commit 51fc4b4deb9e907cab3404d8c702131e3da85122, reversing
changes made to 318c824e1b78ca74701a1721a5a94f5dc567035f.
* Fix macOS port conflict: Disable SO_REUSEADDR and improve UI port display
- StdioBridgeHost.cs: Disable ReuseAddress on macOS to force AddressAlreadyInUse exception on conflict.
- PortManager.cs: Add connection check safety net for macOS.
- McpConnectionSection.cs: Ensure UI displays the actual live port instead of just the requested one.
* Fix macOS port conflict: Disable SO_REUSEADDR and improve UI port display
- StdioBridgeHost.cs: Disable ReuseAddress on macOS to force AddressAlreadyInUse exception on conflict.
- PortManager.cs: Add connection check safety net for macOS.
- McpConnectionSection.cs: Ensure UI displays the actual live port instead of just the requested one.
* Address CodeRabbit feedback: UX improvements and code quality fixes
- McpConnectionSection.cs: Disable port field when session is running to prevent editing conflicts
- StdioBridgeHost.cs: Refactor listener creation into helper method and update EditorPrefs on port fallback
- unity_instance_middleware.py: Narrow exception handling and preserve SystemExit/KeyboardInterrupt
- debug_request_context.py: Document that debug fields expose internal implementation details
* Fix: Harden Python detection on Windows to handle App Execution Aliases
* Refactor: Pre-resolve conflicts for McpConnectionSection and middleware
* Fix: Remove leftover merge conflict markers in StdioBridgeHost.cs
* fix: clarify create_script tool description regarding base64 encoding
* fix: improve python detection on macOS by checking specific Homebrew paths
* Fix duplicate SetEnabled call and improve macOS Python detection
* Fix port display not reverting to saved preference when session ends
Tackle the requests in Issue#267, tested and no bugs found.
(1)LLM can duplicate an gameobject based on request
(2)LLM can move a gameobject relative to another gameobject
* Fix: HTTP/Stdio transport routing and middleware session persistence
- Ensure session persistence for stdio transport by using stable client_id/global fallback.
- Fix Nagle algorithm latency issues by setting TCP_NODELAY.
- Cleanup duplicate logging and imports.
- Resolve C# NullReferenceException in EditorWindow health check.
* Fix: thread-safe middleware singleton and re-enable repo stats schedule
* Temp Update on Material Assignment
Previously it was shader assignment by request or iterative order from URP to Unlit, but LLM usually assign Standard in a URP setting.
This small fix introduce the helper to resolve some of the conflicts, while give warnings in the log to show if the user is creating a shader in a non-compatible setting.
* Update RenderPipelineUtility.cs
* fix: Changed flag management to EditorPrefs
* refactor: Improve code readability and error handling in MCP window toggle
* fix: Refactor MCP window toggle logic to use new helper methods for better readability and maintainability
* fix: Reorder using directives and improve error logging format in MCP window
* Address CodeRabbit feedback: use McpLog.Warn and guard against repeated CreateGUI calls
---------
Co-authored-by: David Sarno <david@lighthaus.us>
* Fix Claude Windows config and CLI status refresh
* Fix Claude uvx path resolution
* Address review feedback for Claude uvx
* Polish config cleanup and status errors
* Tidy Claude status refresh
* Standardize import ordering and whitespace in plugin
The whitespace gave a warning in the asset store submission
* Fix manage_prefab tool structure
* Fix manage_editor actions
* Add get_component singular to manage_gameobject
* Improve uv cache clear error handling with lock detection and combined output
Replace simple stderr-only error reporting with combined stdout/stderr output. Add detection for "currently in-use" lock errors with helpful hint about waiting or using --force flag. Provide fallback message when command fails with no output.
* Improve error message formatting in uv cache clear failure logging
* Add distribution settings for Asset Store vs git defaults
Introduce McpDistributionSettings ScriptableObject to configure different defaults for Asset Store and git distributions without code forking. Add skipSetupWindowWhenRemoteDefault flag to bypass setup wizard when shipping with hosted MCP URL. Replace hardcoded localhost:8080 defaults with configurable defaultHttpBaseUrl from distribution settings in HttpEndpointUtility and WebSocketTransportClient.
* Improve local address detection in McpDistributionSettings with comprehensive IP range checks
Replace simple string-based localhost/127.0.0.1 checks with robust IsLocalAddress method that validates loopback addresses, private IPv4 ranges (10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16, 169.254.0.0/16), IPv6 link-local and loopback addresses, and .local hostnames using proper URI parsing and IPAddress validation.
* Fix error
* First pass at MCP client refactor
* Restore original text instructions
Well most of them, I modified a few
* Move configurators to their own folder
It's less clusterd
* Remvoe override for Windsurf because we no longer need to use it
* Add Antigravity configs
Works like Windsurf, but it sucks ass
* Add some docs for properties
* Add comprehensive MCP client configurators documentation
* Add missing imports (#7)
* Handle Linux paths when unregistering CLI commands
* Construct a JSON error in a much more secure fashion
* Fix stdio auto-reconnect after domain reloads
We mirror what we've done with the HTTP/websocket connection
We also ensure the states from the stdio/HTTP connections are handled separately. Things now work as expected
* Fix ActiveMode to return resolved transport mode instead of preferred mode
The ActiveMode property now calls ResolvePreferredMode() to return the actual active transport mode rather than just the preferred mode setting.
* Minor improvements for stdio bridge
- Consolidated the !useHttp && isRunning checks into a single shouldResume flag.
- Wrapped the fire-and-forget StopAsync in a continuation that logs faults (matching the HTTP handler pattern).
- Wrapped StartAsync in a continuation that logs failures and only triggers the health check on success.
* Refactor TransportManager to use switch expressions and improve error handling
- Replace if-else chains with switch expressions for better readability and exhaustiveness checking
- Add GetClient() helper method to centralize client retrieval logic
- Wrap StopAsync in try-catch to log failures when stopping a failed transport
- Use client.TransportName instead of mode.ToString() for consistent naming in error messages
* First pass at MCP client refactor
* Restore original text instructions
Well most of them, I modified a few
* Move configurators to their own folder
It's less clusterd
* Remvoe override for Windsurf because we no longer need to use it
* Add Antigravity configs
Works like Windsurf, but it sucks ass
* Add some docs for properties
* Add comprehensive MCP client configurators documentation
* Add missing imports (#7)
* Handle Linux paths when unregistering CLI commands
* Construct a JSON error in a much more secure fashion