Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: CoplayDev/unity-mcp
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v8.5.0
Choose a base ref
...
head repository: CoplayDev/unity-mcp
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v8.6.0
Choose a head ref
  • 5 commits
  • 40 files changed
  • 3 contributors

Commits on Dec 30, 2025

  1. 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
    msanatan authored Dec 30, 2025
    Configuration menu
    Copy the full SHA
    b866a4c View commit details
    Browse the repository at this point in the history

Commits on Jan 2, 2026

  1. 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
    dsarno authored Jan 2, 2026
    Configuration menu
    Copy the full SHA
    c2a6b0a View commit details
    Browse the repository at this point in the history
  2. 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
    dsarno authored Jan 2, 2026
    Configuration menu
    Copy the full SHA
    35a5c75 View commit details
    Browse the repository at this point in the history
  3. 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
    dsarno authored Jan 2, 2026
    Configuration menu
    Copy the full SHA
    9b153b6 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    f205f15 View commit details
    Browse the repository at this point in the history
Loading