Commit Graph

643 Commits (74fab4b3b0f0e5ac5b790414c83d1a362cc0519d)

Author SHA1 Message Date
Berkant 46b844a56f
Add Cherry Studio MCP client support (#505)
* Add Cherry Studio MCP client support

* Fix misleading message in HTTP mode for Cherry Studio

* Address code review feedback
2026-01-03 23:00:13 -05:00
GitHub Actions 5afa2960f8 chore: bump version to 8.7.0 2026-01-03 20:46:18 +00:00
dsarno 711768d064
Async Test Infrastructure & Editor Readiness Status + new refresh_unity tool (#507)
* Add editor readiness v2, refresh tool, and preflight guards

* Detect external package changes and harden refresh retry

* feat: add TestRunnerNoThrottle and async test running with background stall prevention

- Add TestRunnerNoThrottle.cs: Sets editor to 'No Throttling' mode during test runs
  with SessionState persistence across domain reload
- Add run_tests_async and get_test_job tools for non-blocking test execution
- Add TestJobManager for async test job tracking with progress monitoring
- Add ForceSynchronousImport to all AssetDatabase.Refresh() calls to prevent stalls
- Mark DomainReloadResilienceTests as [Explicit] with documentation explaining
  the test infrastructure limitation (internal coroutine waits vs MCP socket polling)
- MCP workflow is unaffected - socket messages provide external stimulus that
  keeps Unity responsive even when backgrounded

* refactor: simplify and clean up code

- Remove unused Newtonsoft.Json.Linq import from TestJobManager
- Add throttling to SessionState persistence (once per second) to reduce overhead
- Critical job state changes (start/finish) still persist immediately
- Fix duplicate XML summary tag in DomainReloadResilienceTests

* docs: add async test tools to README, document domain reload limitation

- Add run_tests_async and get_test_job to main README tools list
- Document background stall limitation for domain reload tests in DEV readme

* ci: add separate job for domain reload tests

Run [Explicit] domain_reload tests in their own job using -testCategory

* ci: run domain reload tests in same job as regular tests

Combines into single job with two test steps to reuse cached Library

* fix: address coderabbit review issues

- Fix TOCTOU race in TestJobManager.StartJob (single lock scope for check-and-set)
- Store TestRunnerApi reference with HideAndDontSave to prevent GC/serialization issues

* docs: update tool descriptions to prefer run_tests_async

- run_tests_async is now marked as preferred for long-running suites
- run_tests description notes it blocks and suggests async alternative

* docs: update README screenshot to v8.6 UI

* docs: add v8.6 UI screenshot

* Update README for MCP version and instructions for v8.7

* fix: handle preflight busy signals and derive job status from test results

- manage_asset, manage_gameobject, manage_scene now check preflight return
  value and propagate busy/retry signals to clients (fixes Sourcery #1)
- TestJobManager.FinalizeCurrentJobFromRunFinished now sets job status to
  Failed when resultPayload.Failed > 0, not always Succeeded (fixes Sourcery #2)

* fix: increase HTTP server startup timeout for dev mode

When 'Force fresh server install' is enabled, uvx uses --no-cache --refresh
which rebuilds the package and takes significantly longer to start.

- Increase timeout from 10s to 45s when dev mode is enabled
- Add informative log message explaining the longer startup time
- Show actual timeout value in warning message

* fix: derive job status from test results in FinalizeFromTask fallback

Apply same logic as FinalizeCurrentJobFromRunFinished: check result.Failed > 0
to correctly mark jobs as Failed when tests fail, even in the fallback path
when RunFinished callback is not delivered.
2026-01-03 12:42:32 -08:00
Shutong Wu 191b730a47
Update GUID in Models.meta file 2026-01-02 11:10:03 -05:00
GitHub Actions f205f157e6 chore: bump version to 8.6.0 2026-01-02 05:53:04 +00:00
dsarno 9b153b6561
ManageGameObject/Material + auto-select sole Unity instance (#502)
- ManageGameObject: support componentsToAdd string array + apply top-level componentProperties

- ManageMaterial: safer create + optional color input with configurable property

- Server: auto-select sole Unity instance middleware + integration tests
2026-01-01 21:04:10 -08:00
dsarno 35a5c75596
Feature/run tests summary clean (#501)
* Optimize run_tests to return summary by default, reducing token usage by 98%

- Add includeFailedTests parameter: returns only failed/skipped test details
- Add includeDetails parameter: returns all test details (original behavior)
- Default behavior now returns summary only (~150 tokens vs ~13k tokens)
- Make results field optional in Python schema for backward compatibility

Token savings:
- Default: ~13k tokens saved (98.9% reduction)
- With failures: minimal tokens (only non-passing tests)
- Full details: same as before when explicitly requested

This prevents context bloat for typical test runs where you only need
pass/fail counts, while still allowing detailed debugging when needed.

* Add warning when run_tests filters match no tests; fix test organization

TDD Feature:
- Add warning message when filter criteria match zero tests
- New RunTestsTests.cs validates message formatting logic
- Modified RunTests.cs to append "(No tests matched the specified filters)" when total=0

Test Organization Fixes:
- Move MCPToolParameterTests.cs from EditMode/ to EditMode/Tools/ (matches folder hierarchy)
- Fix inconsistent namespaces to MCPForUnityTests.Editor.{Subfolder}:
  - MCPToolParameterTests: Tests.EditMode → MCPForUnityTests.Editor.Tools
  - DomainReloadResilienceTests: Tests.EditMode.Tools → MCPForUnityTests.Editor.Tools
  - Matrix4x4ConverterTests: MCPForUnityTests.EditMode.Helpers → MCPForUnityTests.Editor.Helpers

* Refactor test result message formatting

* Simplify RunTests warning assertions

* Tests: de-flake cold-start EditMode runs

- Make ManageScriptableObjectTests setup yield-based with longer Unity-ready timeout

- Mark DomainReloadResilienceTests explicit to avoid triggering domain reload during Run All
2026-01-01 20:36:45 -08:00
dsarno c2a6b0ac7a
HTTP setup overhaul: transport selection (HTTP local/remote vs stdio), safer lifecycle, cleaner UI, better Claude Code integration (#499)
* Avoid blocking Claude CLI status checks on focus

* Fix Claude Code registration to remove existing server before re-registering

When registering with Claude Code, if a UnityMCP server already exists,
remove it first before adding the new registration. This ensures the
transport mode (HTTP vs stdio) is always updated to match the current
UseHttpTransport EditorPref setting.

Previously, if a stdio registration existed and the user tried to register
with HTTP, the command would fail with 'already exists' and the old stdio
configuration would remain unchanged.

* Fix Claude Code transport validation to parse CLI output format correctly

The validation code was incorrectly parsing the output of 'claude mcp get UnityMCP' by looking for JSON format ("transport": "http"), but the CLI actually returns human-readable text format ("Type: http"). This caused the transport mismatch detection to never trigger, allowing stdio to be selected in the UI while HTTP was registered with Claude Code.

Changes:
- Fix parsing logic to check for "Type: http" or "Type: stdio" in CLI output
- Add OnTransportChanged event to refresh client status when transport changes
- Wire up event handler to trigger client status refresh on transport dropdown change

This ensures that when the transport mode in Unity doesn't match what's registered with Claude Code, the UI will correctly show an error status with instructions to re-register.

* Fix Claude Code registration UI blocking and thread safety issues

This commit resolves three issues with Claude Code registration:

1. UI blocking: Removed synchronous CheckStatus() call after registration
   that was blocking the editor. Status is now set immediately with async
   verification happening in the background.

2. Thread safety: Fixed "can only be called from the main thread" errors
   by capturing Application.dataPath and EditorPrefs.GetBool() on the main
   thread before spawning async status check tasks.

3. Transport mismatch detection: Transport mode changes now trigger immediate
   status checks to detect HTTP/stdio mismatches, instead of waiting for the
   45-second refresh interval.

The registration button now turns green immediately after successful
registration without blocking, and properly detects transport mismatches
when switching between HTTP and stdio modes.

* Enforce thread safety for Claude Code status checks at compile time

Address code review feedback by making CheckStatusWithProjectDir thread-safe
by design rather than by convention:

1. Made projectDir and useHttpTransport parameters non-nullable to prevent
   accidental background thread calls without captured values

2. Removed nullable fallback to EditorPrefs.GetBool() which would cause
   thread safety violations if called from background threads

3. Added ArgumentNullException for null projectDir instead of falling back
   to Application.dataPath (which is main-thread only)

4. Added XML documentation clearly stating threading contracts:
   - CheckStatus() must be called from main thread
   - CheckStatusWithProjectDir() is safe for background threads

5. Removed unreachable else branch in async status check code

These changes make it impossible to misuse the API from background threads,
with compile-time enforcement instead of runtime errors.

* Consolidate local HTTP Start/Stop and auto-start session

* HTTP improvements: Unity-owned server lifecycle + UI polish

* Deterministic HTTP stop via pidfile+token; spawn server in terminal

* Fix review feedback: token validation, host normalization, safer casts

* Fix stop heuristics edge cases; remove dead pid capture

* Fix unity substring guard in stop heuristics

* Fix local server cleanup and connection checks

* Fix read_console default limits; cleanup Unity-managed server vestiges

* Fix unfocused reconnect stalls; fast-fail retryable Unity commands

* Simplify PluginHub reload handling; honor run_tests timeout

* Fix Windows Claude CLI status check threading
2026-01-01 17:08:51 -08:00
Marcus Sanatan b866a4cc42
Simplify default HTTP (#495)
* The default URL is already set when we call the function

* Remove placeholer for HTTP URL in the UI

When we load the UI, we use `HttpEndpointUtility.GetBaseUrl()`, so we don't need this
2025-12-30 00:44:57 -04:00
GitHub Actions ed802c11c0 chore: bump version to 8.5.0 2025-12-29 23:50:59 +00:00
Marcus Sanatan 1a7f4bb4a5
Optimise so startup is fast again (#494)
* Optimize tool loading so startup is fast again

We lazy load tools, remove the expensive AssetPath property, and reflect for only `McpForUnityToolAttribute`, so it's much faster.

A 6 second startup is now back to 400ms. Can still be optimised but this is good

* Remove .meta file from tests

The tests automatically cleans this up, so it likely got pushed by accident
2025-12-29 18:39:03 -04:00
Marcus Sanatan 6f080f5390
Edit editor configs (#493)
* 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.

* Make the menu item more clear

* Remove rounded borders and spacing from EditorPrefs list items

Minor visual tweak [skip ci]

---------

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
2025-12-29 13:40:50 -04:00
Marcus Sanatan c770a8c713
Add EditorPrefs management window for MCP configuration debugging (#491)
* 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>
2025-12-29 13:30:45 -04:00
GitHub Actions eea02d1a0d chore: bump version to 8.4.0 2025-12-29 04:58:32 +00:00
dsarno 35165e11b3
Payload-safe paging for hierarchy/components + safer asset search + docs (#490)
* 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
2025-12-28 20:57:57 -08:00
dsarno 28f60b42b0
feature/Add new manage_scriptable_object tool (#489)
* 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
2025-12-28 20:15:50 -08:00
dsarno 523e81bf15
Fix test teardown to avoid dropping MCP bridge (#487)
* 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.
2025-12-26 11:50:42 -08:00
dsarno 8e3bd1d70c
Fix/ci cleanup (#484)
* CI: tighten NL/T reporting and fail job on missing/failed tests

* CI: include test titles in summary checklist
2025-12-24 13:12:26 -08:00
dsarno 91b6f4d8d6
Test/478 matrix4x4 serialization crash (#481)
* 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>
2025-12-23 15:53:14 -08:00
Shutong Wu 90758f19f4
Fix on Issue #465 (#477)
* Update ScreenshotUtility.cs

Fix issue in issue#465

* Update ScreenshotUtility.cs
2025-12-22 13:36:55 -05:00
GitHub Actions df906cb747 chore: bump version to 8.3.0 2025-12-20 00:08:32 +00:00
Marcus Sanatan 7a99ae1472
Remove distribution settings scriptable object (#473)
* 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
2025-12-19 19:11:54 -04:00
Marcus Sanatan e35ef22aba
Add .meta files (#472)
* Add missing meta files

* Re-generate .meta files

It was for safety as some were AI generated before. Only minor changes were made
2025-12-19 18:59:19 -04:00
Marcus Sanatan 412cc00f41
Improve legacy configuration migration error handling and cleanup (#470)
- 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
2025-12-19 18:30:42 -04:00
Marcus Sanatan a947c9f9bf
Bump dep versions (#469)
* Update server instructions with new options

* Upgrade to a later version of Pydantic

This should have improved Python 3.14 support

* Swap order of instructions so Docker comes before local building

* Add fixed versions back to the README

* Update README to clarify the GitHub uvx command
2025-12-19 18:11:19 -04:00
Marcus Sanatan edd40ec86e
Publish to Docker Hub (#468)
* Add GitHub Actions workflow for Docker Hub publishing

* Remove TestPyPI publishing from PyPI workflow

Removes the publish-to-testpypi job from the GitHub Actions workflow to streamline the publishing process and only publish to production PyPI.

* Update Server/DOCKER_OVERVIEW.md

Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com>

* Update .github/workflows/publish-docker.yml

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* Align docker and pypi publishing so they update on new tags in the same way

* Add caching to speed up pushes

* Remove unnecessary permissions

* Let's be super specific about the platform

it should be Ubuntu's default but just in case

---------

Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
2025-12-19 17:24:04 -04:00
Marcus Sanatan 12e1b62b2e
Publish to pypi (#466)
* Lowercase project name for server

* Update metadata for project

* Add GitHub Actions workflow for PyPI package publishing
2025-12-19 16:43:44 -04:00
Berkant df3a49334e
feat: add Kilo Code configurator for AutoConfig support (#438)
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>
2025-12-18 15:48:01 -04:00
Voon Foo 60a9f66949
Add test filtering to run_tests tool (#462) 2025-12-17 16:59:21 -04:00
Marcus Sanatan f671bbcd06
Add debug logging for legacy configuration migration details (#463) 2025-12-17 16:58:32 -04:00
DeTandtThibaut 493d9ba420
feat: Add Intelij Rider for Autoconfig support (#448) 2025-12-17 16:57:49 -04:00
Shutong Wu 8fe73be7ae
Minor Fix on Advanced Setting UI (#459)
* [FIX] Input refinment on Advanced Settings

Add a browse for server and make the source input more than readonly
2025-12-13 18:33:20 -05:00
GitHub Actions 6e0ef2347a chore: bump version to 8.2.3 2025-12-11 04:10:23 +00:00
dsarno 2b23af45a2
Fix/script path assets prefix and ctx warn bug (#453)
* 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>
2025-12-10 20:09:16 -08:00
GitHub Actions 237b26ecb4 chore: bump version to 8.2.2 2025-12-10 23:11:15 +00:00
dsarno d06eaefa8a
Unity MCP CI Test Improvements (#452)
* 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.
2025-12-10 14:54:55 -08:00
Shutong Wu a9878622ea
Implement screenshot capture for Unity 2022.1+
Add conditional screenshot capture for Unity 2022.1 and newer.
2025-12-10 12:15:29 -05:00
Evan 2f2b56a20d
修复ArrayPool可能会产生报错的问题 (#451)
* Fixed ArrayPool conflict with CString.dll ArrayPool in Tolua

Fixed ArrayPool conflict with CString.dll ArrayPool in Tolua

* ScreenCapture在Unity2022中才支持

ScreenCapture在Unity2022中才支持,增加Unity版本判断
2025-12-10 12:14:30 -05:00
Shutong Wu 79b3255d0a
[FEATURE] Deployment of local source code to Unity (#450)
* [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
2025-12-09 20:17:18 -05:00
Shutong Wu 97b85749b5
[FEATURE] Camera Capture (#449)
* 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
2025-12-09 19:00:30 -05:00
dsarno 8a17cde29e
reorder tool list on readme 2025-12-08 09:46:14 -08:00
dsarno 600ea8c6be
Clarify installation instructions and update version
Updated README for client config instructions and stable version.
2025-12-08 09:39:55 -08:00
GitHub Actions 2ad0be74ac chore: bump version to 8.2.1 2025-12-08 16:19:37 +00:00
dsarno 0c8d2aac42
Fix/websocket queue to main thread (#443)
* feat: Implement async method to retrieve enabled tools on the main thread

* fix: cancelable main-thread tool discovery

* chore: dispose cancellation registration and dedupe usings

---------

Co-authored-by: Jordon Harrison <Jordon.Harrison@outlook.com>
2025-12-08 08:16:09 -08:00
GitHub Actions fd44ab3b5d chore: bump version to 8.2.0 2025-12-08 03:40:52 +00:00
dsarno fe4cae7241
feat: Add `manage_material` tool for dedicated material manipulation (#440)
* 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
2025-12-07 19:39:52 -08:00
Shutong Wu 7f8ca2a3bd
[FEATURE] Custom Tool Fix and Add inspection window for all the tools (#414)
* 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.
2025-12-07 19:38:32 -05:00
Shutong Wu b34e4c8cf7
[FEATURE] Batch Commands (#418)
* 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.
2025-12-07 19:36:44 -05:00
MyNameisPI b09e48a395
Fix: Add middleware support for resource context injection(#431) (#432)
- Extract common logic from on_call_tool to _inject_unity_instance method.
- Add on_read_resource to inject unity_instance into resource contexts.
- Fix resources unable to get unity_instance from context after set_active_instance.

Co-authored-by: MyNameisPI <eqjbc@qq.com>
2025-12-05 10:33:40 -08:00
GitHub Actions 2c65c76ea3 chore: bump version to 8.1.6 2025-12-04 21:20:37 +00:00