Wrap the Step() loop in try/finally so the pause-state restore runs on
every exit path, including if Step() throws — matching the camera-state
restore pattern already used in CaptureFromCameraToProjectFolder.
The play-mode composited path drives the player loop with EditorApplication.Step()
to reach WaitForEndOfFrame. Step() pauses play mode as a side effect, and the loop
never restored it — so any play-mode screenshot left the game paused indefinitely
(regression from #1132, which introduced the Step() loop).
Record isPaused before the loop and clear it afterward, unless the game was already
paused (preserve a caller's intentional pause).
README-zh.md edits + .meta/uv.lock churn on brand-distribution-analytics, committed
(not stashed) so the feature branch can be checked out in the main worktree for editor
testing. Untracked .agents/ and AGENTS.md intentionally left out.
Claude-Session: https://claude.ai/code/session_01Tjpb5gYgUe2AUJuRdXr7Lv
Since #1122 declared the Physics 2D, Screen Capture, Image Conversion, etc.
built-in modules as required deps in package.json, Unity Package Manager now
keeps them enabled while MCP for Unity is installed. Two defensive layers
that protected against the now-impossible "module disabled" case become dead
code, plus one sub-floor preprocessor gate that was always-true on our
declared `unity: 2021.3` floor.
Tier 1A — UnityPhysicsCompat.cs
- Revert `Type.GetType("UnityEngine.Physics2D, UnityEngine.Physics2DModule")`
to `typeof(Physics2D)`. The property-level reflection (for `autoSyncTransforms`
deprecation in Unity 6.x) stays — that's a different concern.
Tier 1B — TrailControl.cs
- Strip `#if UNITY_2021_1_OR_NEWER` gate. Package floor is 2021.3 per
package.json, so the `#else` branch ("AddPosition requires Unity 2021.1+")
is unreachable.
Tier 2 — ScreenshotUtility.cs + callers
- Remove `IsScreenCaptureModuleAvailable` property, `ScreenCaptureModuleNotAvailableError`
constant, `InvokeCaptureScreenshotAsTexture` helper, and the
`s_captureScreenshotMethod` / `s_captureScreenshotAsTextureMethod` /
`s_screenCaptureModuleAvailable` reflection caches.
- Replace reflective `MethodInfo.Invoke` calls with direct `ScreenCapture.X`
calls in `CaptureToProjectFolder`, `CaptureComposited`, and the
`ScreenshotCapturer` MonoBehaviour.
- Camera-based fallback path (`FindAvailableCamera` + `CaptureFromCameraToProjectFolder`)
is preserved — it still handles transient null returns from `ScreenCapture`
inside `CaptureComposited`.
- Drop pre-flight `if (!IsScreenCaptureModuleAvailable)` gates in
`ManageUI.cs` (UI render) and `ManageScene.cs` (screenshot path).
- `ProjectInfo` resource: `screenCapture` field is now an invariant `true`
(preserves API shape for `mcpforunity://project/info` consumers).
Net: 144 lines removed, 15 added. No new tests — the changes are pure
removal of code paths that cannot fire with the current deps declared.
Related: #1160, #1122.
v9.7.0 introduced two Runtime regressions that block compilation when users
disable the matching built-in modules in Package Manager:
- UnityPhysicsCompat.cs used `typeof(Physics2D)` directly, contradicting the
file's own contract of reflection-based access ("survive eventual removal
without recompile"). Switched to `Type.GetType("UnityEngine.Physics2D,
UnityEngine.Physics2DModule")` so the shim degrades gracefully when the
Physics 2D module is off.
- ScreenshotUtility.CaptureComposited bypassed the existing reflective
ScreenCapture path (s_captureScreenshotMethod) with a direct call to
ScreenCapture.CaptureScreenshotAsTexture. Cached a second MethodInfo
(s_captureScreenshotAsTextureMethod) and routed the call through it, so
the file compiles with the Screen Capture module disabled and falls back
to camera capture at runtime — matching the behavior the file already
advertises via IsScreenCaptureModuleAvailable.
The 4-line inline comment in CaptureComposited duplicated CaptureCompositedAfterFrame's
own header and exceeded the 1-2 line guidance. Trim to 2 lines and collapse the
play-mode / edit-mode branch to a ternary (matches the file's existing style).
If the editor spin loop times out before ScreenshotCapturer's coroutine fires
the callback, the callback would still later assign the captured Texture2D to
the (now-dead) local result variable. The texture itself would never reach the
consumer's finally-block DestroyTexture, leaking a Unity object until the next
domain reload.
Track caller-returned state; if the callback runs after timeout, destroy the
incoming texture immediately instead of assigning it.
Flagged by CodeRabbit on the prior commit.
Drop the "Shared by ManageUI.render_ui ... and ScreenshotUtility's editor
synchronous-spin path" line. The first sentence already describes the class on
its own; naming specific callers in the doc is brittle (goes stale if a call
site is added or renamed) and pushed the summary to 4 content lines, over the
1-2 line guidance.
Per review feedback: ManageUI.MCP_ScreenCapturer and the new
CompositedFrameCapturer added in this PR were near-duplicates. Extract a single
public ScreenshotCapturer MonoBehaviour to Runtime/Helpers that takes a callback,
and have both call sites use it:
- ManageUI.render_ui (two-call pending/ready protocol): callback writes the
texture and flips its own static done/started flags.
- ScreenshotUtility.CaptureCompositedAfterFrame (single-call sync spin):
callback writes a local; spin loop pumps EditorApplication.Step until set.
Trimmed verbose comments in the same pass.
No behaviour change. Both paths re-verified end-to-end with a magenta UITK
panel-clear repro.
The converter was declared public with a default constructor, so generic
Newtonsoft scanners (e.g. jillejr's newtonsoft-json-for-unity converters)
could pick it up and bind it into JsonConvert.DefaultSettings. Once
attached globally, any unrelated project code serializing a struct or
class containing a UnityEngine.Object reference would silently get an
asset path string back instead of the expected object JSON — purely from
having MCP for Unity installed.
Make the converter internal and expose Runtime internals to the Editor
and test assemblies via a Runtime AssemblyInfo so existing internal
consumers (UnityJsonSerializer, GameObjectSerializer) keep compiling.
Removing the if (s_pendingCompositedStarted) guard in the previous commit
left the field with only assignments and no reads, which Unity surfaces as
CS0414 ("assigned but its value is never used"). Drop the field and its
three write sites.
No behavior change.
Two robustness tweaks to CompositedFrameCapturer / CaptureCompositedAfterFrame
flagged by CodeRabbit on the parent commit:
1. On exception inside the WaitForEndOfFrame coroutine, mark
s_pendingCompositedDone = true so CaptureCompositedAfterFrame's spin loop
exits immediately. The null texture already signals failure to the caller,
which falls through to the camera-based fallback. Previously the loop would
spin for the full timeout despite the coroutine being effectively done.
2. Reset s_pendingCompositedTex / s_pendingCompositedDone unconditionally on
entry. A coroutine from a previous call that timed out can complete
asynchronously and leave a stale texture / done flag behind; clearing on
entry prevents the next call from picking up that stale capture.
ScreenshotUtility.CaptureComposited called ScreenCapture.CaptureScreenshotAsTexture
inline, before the next frame had been rendered and presented. UI Toolkit overlays
are composited at end-of-frame, so the captured texture contained an unwritten
backbuffer and the saved PNG was blank.
Route the play-mode editor path through a transient MonoBehaviour that yields
WaitForEndOfFrame before calling ScreenCapture, then advance the player loop with
EditorApplication.Step() until the coroutine completes. The single-call API is
preserved; total cost is bounded (5 steps, ~80ms at 60fps).
Complements #1040, which switched to the correct API but kept the synchronous
invocation that caused the empty capture.
The (Type, bool includeInactive) overload guarded its modern-API
branch with #elif UNITY_2023_1_OR_NEWER while the legacy reflection
helper LegacyFindObjectsOfType is gated by #if !UNITY_2022_3_OR_NEWER.
That left the entire Unity 2022.3.x band falling through to a
legacy helper that the preprocessor had already excluded, producing
CS0103: 'LegacyFindObjectsOfType' does not exist in the current
context (e.g. on 2022.3.62f2, see #1105).
The 3-arg FindObjectsByType(Type, FindObjectsInactive, FindObjectsSortMode)
overload has been available since Unity 2022.2, so 2022.3 can use the
modern API directly. Aligning the threshold with the rest of the file
(2022_3_OR_NEWER) closes the gap with no API loss.
Closes#1105
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* fix: align CaptureComposited with renamed Project*-folder API
PR #1040 added CaptureComposited referencing the old Assets-folder names
(CaptureFromCameraToAssetsFolder, AssetsRelativePath) and called
PrepareCaptureResult without the now-required folderOverride argument.
Renames into the Project* equivalents; same fix at the call sites in
ManageScene.cs.
Closes#1100
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* ci: gate releases on test success and trigger tests on PRs
Beta-release was publishing to PyPI in parallel with Unity Tests, so
broken commits could ship if Unity tests failed (as happened with #1100
on 9.6.9-beta.5). Make publish/version-bump jobs depend on the test
jobs in both beta-release.yml and release.yml. The whole release halts
before any irreversible commit/tag/push if either test job fails.
Also extends the test workflows to fire on PRs so failures are caught
before merge:
- python-tests: pull_request trigger; runs on every PR (no secrets).
- unity-tests: pull_request_target [labeled] trigger gated on the
safe-to-test label and on the PR being from a fork. Maintainers
apply the label after reviewing the diff; the workflow then runs
with UNITY_LICENSE in scope against the PR head SHA. Re-pushed
commits do NOT auto-trigger; maintainer must remove and re-apply
the label to re-run after additional review.
In-repo PRs continue to be tested via the existing push trigger, so
no labeling friction for collaborator branches.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* fix(screenshot): propagate folderOverride to composited and specific-camera paths
Two pre-existing inconsistencies surfaced by CodeRabbit on #1103:
1. CaptureComposited dropped the caller's output_folder by hardcoding
folderOverride: null in PrepareCaptureResult and the camera fallbacks.
Adds the parameter to CaptureComposited's signature and plumbs it
through both fallback paths.
2. The targetCamera and includeImage-in-play paths in ManageScene's
game_view screenshot did not resolve cmd.outputFolder, so a request
that selected a specific camera would always write to the default
folder. Resolve via ScreenshotPreferences.Resolve as the other paths
already do, and gate AssetDatabase.ImportAsset on IsUnderAssets so
non-Assets folders don't trigger a futile import.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* ci(unity-tests): harden pull_request_target and gate artifact upload
Address CodeRabbit security review on #1103:
- persist-credentials: false on the checkout step, so GITHUB_TOKEN is
not written to disk and cannot be read by subsequent steps running
PR-controlled code.
- Explicit permissions: contents: read on the testAllModes job, scoping
the workflow's token down from the default read/write set.
- Skip upload-artifact when the main test step was skipped (e.g.,
because the preceding domain-reload step failed without
continue-on-error). Avoids the noisy "No files were found" error
on top of an already-failed run.
The label-gated trigger plus these mitigations narrow the blast radius
of the pull_request_target + checkout-PR-head pattern. The remaining
trust boundary is the maintainer review before applying safe-to-test;
documenting the review checklist (especially TestProjects/UnityMCPTests
diffs) is a follow-up.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1.Add Compat based scripts revolving around UnityCompatShims.cs, that will document our current API Compatibility changes in several files.
2.Add custom screenshot folder selection
Use ScreenCapture.CaptureScreenshotAsTexture() for game_view screenshots
when include_image=true and in Play mode. This captures the final composited
frame including UI Toolkit overlays, which camera.Render() misses since
UI Toolkit renders at the compositor level after camera rendering.
The camera-based path is still used when a specific camera is requested
or when not in Play mode.
Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
Addresses review feedback on the Unity 6.5 GetInstanceID migration:
- UnityObjectIdCompatExtensions: drop the reflective method lookup in
favor of a simple #if UNITY_6000_5_OR_NEWER / #else split calling
GetEntityId() or GetInstanceID() directly. Also wrap the class in
the MCPForUnity.Runtime.Helpers namespace.
- UnityTypeConverters: remove the reflective EntityIdToObject probe and
call EditorUtility.EntityIdToObject(EntityId) directly under the same
version gate. Serialize entityID as EntityId.ToULong() rather than
ToString(), since Unity's docs explicitly warn that the textual form
is not a stable serialization contract.
- Drop #pragma warning disable 0619 from 22 files that no longer make
any direct calls to obsolete APIs. The remaining 7 files still need
it (FindObjectsOfType, InstanceIDToObject fallback) and are left as-is
— those deprecations are out of scope for this PR.
- Add the MCPForUnity.Runtime.Helpers using to every file that calls
GetInstanceIDCompat() now that the extension method lives in a
namespace.
Keep instanceID in outgoing payloads for wire compatibility, add entityID on newer Unity, continue fallback resolution when entityID lookup fails, and make reflective entity resolution exception-safe.
Place the compatibility extension in MCPForUnity.Runtime so Runtime/Serialization can resolve GetInstanceIDCompat, fixing Unity 2022 compile errors from assembly visibility.
Replace direct GetInstanceID calls with a compatibility helper and update serialization to handle EntityId-era identifiers, so the package compiles on Unity 6.5 while preserving behavior on older versions.
Suppress the transitional CS0619 cast warning when serializing GetEntityId so projects with warnings-as-errors can compile while keeping backward-compatible instanceID payloads.
* Initial update
* Update with docs and fix
* Update on Skybox
* Bug fix and compatability issue
* Update
* Resolve EntityIdToInstance and InstanceIdToObject conflict
* update to revert the changes
Seems EntityId is implicitly casted to Int so no need to prevent it.
* Animation First PR
* Update ClipPresets to take account of local offset
* Update MCPForUnity/Editor/Tools/Animation/ClipCreate.cs
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Update for AI fix
* Temp Update
* update
* update
* update
* Initial update
* Delete 2026-02-09-implement-the-following-plan.txt
* update
* Remove scene generator, 3D gen, and unrelated files from PR
Remove files that don't belong in this camera/screenshot PR:
- Scene generator pipeline (Server/src/scene_generator/*)
- Manage3DGen tool (C# + Python)
- Generated test scripts (TestProjects/*/Scripts/*)
- Root-level docs and scripts (ProposedTable.md, system-prompt.md, start-scene-builder.*)
- Revert MCPForUnity.Editor.asmdef and CLAUDE.md to beta
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* Remove ObjectTransformHistory from PR
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* Update pyproject.toml
* Update MCPForUnity/Editor/Tools/GameObjects/GameObjectLookAt.cs
Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com>
* Update Server/src/services/tools/manage_scene.py
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* update based on ai feedback
---------
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com>
- UnityTypeConverters.cs referenced McpLog (Editor-only) from Runtime asmdef
- This caused CS0103 build errors in player builds
- Replaced with UnityEngine.Debug.LogWarning for runtime compatibility
Also cleaned up test file:
- Removed stale NL test artifacts (Build marker, Tail test comments)
- Removed unused local functions causing CS8321 warnings
* Remove stray .meta file
* Add a new project that will do asset uploads
* Add asset store uploader
* refactor: Replace Debug.Log calls with McpLog helper across codebase
Standardize logging by replacing direct Debug.Log/LogWarning/LogError calls
with McpLog.Info/Warn/Error throughout helper classes and client registry.
Affected files:
- McpClientRegistry.cs
- GameObjectLookup.cs
- GameObjectSerializer.cs
- MaterialOps.cs
- McpConfigurationHelper.cs
- ObjectResolver.cs
- PropertyConversion.cs
- UnityJsonSerializer.cs
- UnityTypeResolver.cs
* feat: Add Asset Store release preparation script
Add prepare_unity_asset_store_release.py tool to automate Asset Store packaging:
- Stages temporary copy of MCPForUnity with Asset Store-specific edits
- Removes auto-popup setup window ([InitializeOnLoad] attribute)
- Renames menu entry to "Local Setup Window" for clarity
- Sets default HTTP base URL to hosted endpoint
- Defaults transport to HTTPRemote instead of HTTPLocal
- Supports dry-run mode and optional backup of existing Assets/MCPForUnity
* Show gif of MCP for Unity in Action
* Add shield with asset store link
* Update README to have asset store page unders installation section
* feat: Redesign GameObject API for better LLM ergonomics
- find_gameobjects: Search GameObjects, returns paginated instance IDs only
- manage_components: Component lifecycle (add, remove, set_property)
- unity://scene/gameobject/{id}: Single GameObject data (no component serialization)
- unity://scene/gameobject/{id}/components: All components (paginated)
- unity://scene/gameobject/{id}/component/{name}: Single component by type
- manage_scene get_hierarchy: Now includes componentTypes array
- manage_gameobject: Slimmed to lifecycle only (create, modify, delete)
- Legacy actions (find, get_components, etc.) log deprecation warnings
- ParamCoercion: Centralized int/bool/float/string coercion
- VectorParsing: Vector3/Vector2/Quaternion/Color parsing
- GameObjectLookup: Centralized GameObject search logic
- 76 new Unity EditMode tests for ManageGameObject actions
- 21 new pytest tests for Python tools/resources
- New NL/T CI suite for GameObject API (GO-0 to GO-5)
Addresses LLM confusion with parameter overload by splitting into
focused tools and read-only resources.
* feat: Add GameObject API stress tests and NL/T suite updates
Stress Tests (12 new tests):
- BulkCreate small/medium batches
- FindGameObjects pagination with by_component search
- AddComponents to single object
- GetComponents with full serialization
- SetComponentProperties (complex Rigidbody)
- Deep hierarchy creation and path lookup
- GetHierarchy with large scenes
- Resource read performance tests
- RapidFire create-modify-delete cycles
NL/T Suite Updates:
- Added GO-0..GO-10 tests in nl-gameobject-suite.md
- Fixed tool naming: mcp__unity__ → mcp__UnityMCP__
Other:
- Fixed LongUnityScriptClaudeTest.cs compilation errors
- Added reports/, .claude/local/, scripts/local-test/ to .gitignore
All 254 EditMode tests pass (250 run, 4 explicit skips)
* fix: Address code review feedback
- ParamCoercion: Use CultureInfo.InvariantCulture for float parsing
- ManageComponents: Move Transform removal check before GetComponent
- ManageGameObjectFindTests: Use try-finally for LogAssert.ignoreFailingMessages
- VectorParsing: Document that quaternions are not auto-normalized
- gameobject.py: Prefix unused ctx parameter with underscore
* fix: Address more code review feedback
NL/T Prompt Fixes:
- nl-gameobject-suite.md: Remove non-existent list_resources/read_resource from AllowedTools
- nl-gameobject-suite.md: Fix parameter names (component_type, properties)
- nl-unity-suite-nl.md: Remove unused manage_editor from AllowedTools
Test Fixes:
- GameObjectAPIStressTests: Add null check to ToJObject helper
- GameObjectAPIStressTests: Clarify AudioSource usage comment
- ManageGameObjectFindTests: Use built-in 'UI' layer instead of 'Water'
- LongUnityScriptClaudeTest: Clean up NL/T test artifacts (Counte42 typo, HasTarget)
* docs: update README tools and resources lists
- Add missing tools: manage_components, batch_execute, find_gameobjects, refresh_unity
- Add missing resources: gameobject_api, editor_state_v2
- Make descriptions more concise across all tools and resources
- Ensure documentation matches current MCP server functionality
* chore: Remove accidentally committed test artifacts
- Remove Materials folder (40 .mat files from interactive testing)
- Remove Shaders folder (5 noise shaders from testing)
- Remove test scripts (Bounce*, CylinderBounce* from testing)
- Remove Temp.meta and commit.sh
* refactor: remove deprecated manage_gameobject actions
- Remove deprecated switch cases: find, get_components, get_component, add_component, remove_component, set_component_property
- Remove deprecated wrapper methods (423 lines deleted from ManageGameObject.cs)
- Delete ManageGameObjectFindTests.cs (tests deprecated 'find' action)
- Remove deprecated test methods from ManageGameObjectTests.cs
- Add GameObject resource URIs to README documentation
- Add batch_execute performance tips to README, tool description, and gameobject_api resource
- Enhance batch_execute description to emphasize 10-100x performance gains
Total: ~1200 lines removed. New API (find_gameobjects, manage_components, resources) is the recommended path forward.
* refactor: consolidate shared services across MCP tools
Major architectural improvements:
- Create UnityJsonSerializer for shared JSON/Unity type conversion
- Create ObjectResolver for unified object resolution (GameObjects, Components, Assets)
- Create UnityTypeResolver for consolidated type resolution with caching
- Create PropertyConversion for unified JSON→Unity property conversion
- Create ComponentOps for low-level component operations
- Create Pagination helpers for standardized pagination across tools
Tool simplifications:
- ManageGameObject: Remove 68-line prefab redirect anti-pattern, delegate to helpers
- ManageAsset: Remove ~80 lines duplicate ConvertJTokenToType
- ManageScriptableObject: Remove ~40 lines duplicate ResolveType
- ManageComponents: Use ComponentOps, UnityTypeResolver (~90 lines saved)
- ManageMaterial: Standardize to SuccessResponse/ErrorResponse patterns
- FindGameObjects: Use PaginationRequest/PaginationResponse
- GameObjectLookup: FindComponentType delegates to UnityTypeResolver
Tests: 242/246 passed, 4 skipped (expected)
* Apply code review feedback: consolidate utilities and improve compatibility
Python Server:
- Extract normalize_properties() to shared utils.py (removes duplication)
- Move search_term validation before preflight() for fail-fast
- Fix manage_script.py documentation (remove incorrect 'update' reference)
- Remove stale comments in execute_menu_item.py, manage_editor.py
- Remove misleading destructiveHint from manage_shader.py
C# Unity:
- Add Vector4Converter (commonly used, was missing)
- Fix Unity 2021 compatibility: replace FindObjectsByType with FindObjectsOfType
- Add path normalization in ObjectResolver before StartsWith check
- Improve ComponentOps.SetProperty conversion error detection
- Add Undo.RecordObject in ManageComponents before property modifications
- Improve error message clarity in ManageMaterial.cs
- Add defensive error handling to stress test ToJObject helper
- Increase CI timeout thresholds for test stability
GitHub Workflows:
- Fix GO test sorting in markdown output (GO-10 now sorts after GO-9)
- Add warning logging for fragment parsing errors
* Fix animator hash names in test fixture to match parameter names
BlendXHash/BlendYHash now use 'reachX'/'reachY' to match the
actual animator parameter names.
* fix(windows): improve HTTP server detection and auto-start reliability
- Fix netstat detection on Windows by running netstat.exe directly instead
of piping through findstr (findstr returns exit code 1 when no matches,
causing false detection failures)
- Increase auto-start retry attempts (20→30) and delays (2s→3s) to handle
slow server starts during first install, version upgrades, and dev mode
- Only attempt blind connection after 20 failed detection attempts to reduce
connection error spam during server startup
- Remove verbose debug logs that were spamming the console every frame
* fix: auto-create tags and remove deprecated manage_gameobject actions
- ManageGameObject.cs: Check tag existence before setting; auto-create
undefined tags using InternalEditorUtility.AddTag() instead of relying
on exception handling (Unity logs warning, doesn't throw)
- manage_gameobject.py: Remove deprecated actions (find, get_components,
add_component, remove_component, set_component_property, get_component)
from Literal type - these are now handled by find_gameobjects and
manage_components tools
- Update test suite and unit tests to reflect new auto-create behavior
* fix: address code review feedback
Bug fixes:
- Fix searchInactive flag ignored in FindObjectsOfType (use includeInactive overload)
- Fix property lookup to try both original and normalized names for backwards compat
- Remove dead code for deprecated 'find' action validation
- Update error message to list only valid actions
Improvements:
- Add destructiveHint=True to manage_shader tool
- Limit fallback connection attempts (every 3rd attempt) to avoid spamming errors
- Consolidate PropertyConversion exception handlers to single catch block
- Add tag existence assertion and cleanup in tag auto-creation tests
Test fixes:
- Update SetComponentProperties_ContinuesAfterException log regex for new error format
- Update test_manage_gameobject_param_coercion to test valid actions only
* 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>
* 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
* Copy UnityMcpBridge into a new MCPForUnity folder
This is to close#284
* refactor: rename UnityMcpBridge directory to MCPForUnity in docs
* chore: rename UnityMcpBridge directory to MCPForUnity across workflow files
* chore: rename UnityMcpBridge directory to MCPForUnity across all files
* refactor: update import paths from UnityMcpBridge to MCPForUnity across test files
* fix: update module import paths to use MCPForUnity instead of UnityMcpBridge
* chore: update unity-mcp package path to MCPForUnity directory
* feat: add OneTimeSetUp to initialize CommandRegistry before tests run
Hopefully fix the CI failures
* Apply recent fix to new folder
* Temporarily trigger tests to see if CI works
* Revert "Temporarily trigger tests to see if CI works"
It works!
This reverts commit 8c6eaaad07545cef047769f2c52fe506545a8161.