Commit a034ab0
HTTP Server, uvx, C# only custom tools (#375)
* Remove temp folder from repo
* Ignore boot.config
* Remove buttons to download or rebuild the server
* Remove embedded MCP server in plugin
We'll reference the remote server in GitHub and configure clients to use `uvx`
* As much as possible, rip out logic that installs a server
* feat: migrate to uvx-based server configuration
- Replaced local server execution with uvx package-based configuration for improved reliability
- Added GetUvxCommand helper to generate correct package version command string
- Updated config generation to use `uvx mcp-for-unity` instead of local Python server
- Modified Codex and client configuration validation to support uvx-based setup
- Removed unused server source directory handling and related preferences
- Updated tests to verify uvx command generation
* Cleanup the temp folders created by tests
We don't commit temp folders, tests are expected to clean up after themselves
* The test kept failing but the results looked correct, floating point comparisons are not precise
* feat: migrate from local server to uvx-based configuration
- Replaced local server path detection with uvx-based package installation from git repository
- Updated all configuration generators to use structured uvx command parts (command, --from URL, package)
- Renamed UV path references to UVX for clarity and consistency
- Added GetUvxCommandParts() helper to centralize uvx command generation
- Added GetMcpServerGitUrl() to handle git repository URL construction
- Updated client configuration validation
* refactor: use dynamic package version instead of hardcoded value
* Update CI so it only updates the Server folder
* feat: implement uvx package source path resolution
- Added GetUvxPackageSourcePath method to locate unity-mcp package in uv cache by traversing git checkouts
- Replaced hardcoded "Dummy" path in PythonToolSyncProcessor with dynamic path resolution
- Added validation for Server directory structure and pyproject.toml to ensure correct package location
* refactor: replace Python tool syncing with custom tool registration system
- Removed PythonToolsAsset and file-based sync processor in favor of attribute-based tool discovery
- Implemented CustomToolRegistrationProcessor with automatic registration on startup and script reload
- Added registration enable/disable preference and force re-registration capability
* feat: add HTTP transport support and cache management
- Implemented HTTP transport option with configurable URL/port alongside existing stdio mode
- Added cache management service with menu item to clear uvx package cache
- Updated config builder to generate transport-specific arguments and VSCode type field based on selected mode
* refactor: simplify HTTP configuration to use URL-based approach
- Replaced separate host/port arguments with single --http-url parameter for cleaner configuration
- Updated server to parse URL and allow individual host/port overrides when needed
- Consolidated HTTP client implementation with connection testing and tool execution support
* refactor: standardize transport configuration with explicit --transport flag
- Replaced --enable-http-server flag with --transport choice parameter (stdio/http) for clearer intent
- Removed redundant HTTP port field from UI since HTTP mode uses the same URL/port as MCP client
- Simplified server startup logic by consolidating transport mode determination
* refactor: move MCP menu items under Window menu
* feat: restructure config generation for HTTP transport mode
- Changed HTTP mode to use URL-based configuration instead of command-line arguments
- Added proper cleanup of incompatible fields when switching between stdio and HTTP transports
- Moved uvx command parsing inside stdio-specific block to avoid unnecessary processing in HTTP mode
* feat: add local HTTP server management with Git URL override
- Implemented server management service with menu item to start local HTTP server in new terminal window
- Added Git URL override setting in advanced configuration to allow custom server source for uvx --from
- Integrated server management into service locator with validation for local-only server startup
* fix: remove automatic HTTP protocol prefix from URL field
- Removed auto-prefixing logic that added "http://" to URLs without protocol
- Added placeholder text to guide users on expected URL format
- Created dedicated url-field style class for better URL input styling
* feat: implement proper MCP session lifecycle with HTTP transport
- Added initialize, ping, and disconnect methods to HttpMcpClient for proper MCP protocol session management
- Implemented session ID tracking and header management for stateful HTTP connections
- Added cross-platform terminal launcher support for Windows and Linux (previously macOS-only)
* feat: implement JSON-RPC protocol for MCP tool execution
- Added proper JSON-RPC 2.0 request/response handling with request ID tracking
- Included MCP protocol headers (version, session ID) for standard compliance
- Added error handling for JSON-RPC error responses
* feat: improve text wrapping in editor window UI
- Added white-space: normal and flex-shrink properties to section headers and override labels to prevent text overflow
- Created new help-text style class for consistent formatting of help text elements
* refactor: refresh git URL override from EditorPrefs on validation
* fix: improve responsive layout for editor window settings
- Added flex-wrap to setting rows to prevent overflow on narrow windows
- Set flex-shrink: 0 on labels to maintain consistent width
- Replaced max-width and margin-left with flex-basis for better flex behavior
* refactor: improve thread safety in tool registration
- Capture Unity API calls on main thread before async operations to prevent threading issues
- Update RegisterAllTools to use Task.Run pattern instead of GetAwaiter().GetResult() to avoid potential deadlocks
- Add optional projectId parameter to RegisterAllToolsAsync for pre-captured values
* refactor: replace MCP tool calls with direct HTTP endpoints for tool registration
- Removed synchronous registration method and unused MCP bridge logic from CustomToolRegistrationService
- Changed tool registration to use direct HTTP POST to /register-tools endpoint instead of MCP protocol
- Added FastAPI HTTP routes alongside existing MCP tools for more flexible tool management access
* refactor: centralize HTTP endpoint URL management
- Created HttpEndpointUtility to normalize and manage base URLs consistently
- Replaced scattered EditorPrefs calls with utility methods that handle URL normalization
- Ensured base URL storage excludes trailing paths like "/mcp" for cleaner configuration
* refactor: simplify custom tools management with in-memory registry
- Removed CustomToolsManager and fastmcp_tool_registry modules in favor of inline implementation
- Replaced class-based tool management with direct HTTP route handlers using FastMCP's custom_route decorator
- Consolidated tool registration logic into simple dictionary-based storage with helper functions
* feat: add dynamic custom tool registration system
- Implemented CustomToolService to manage project-scoped tool registration with validation and conflict detection
- Added HTTP endpoints for registering, listing, and unregistering custom tools with proper error handling
- Converted health and registry endpoints from HTTP routes to MCP tools for better integration
* feat: add AutoRegister flag to control tool registration
- Added AutoRegister property to McpForUnityToolAttribute (defaults to true)
- Modified registration service to filter and only register tools with AutoRegister enabled
- Disabled auto-registration for all built-in tools that already exist server-side
* feat: add function signature generation for dynamic tools
- Implemented _build_signature method to create proper inspect.Signature objects for dynamically created tools
- Signature includes Context parameter and all tool parameters with correct required/optional defaults
- Attached generated signature to dynamic_tool functions to improve introspection and type checking
* refactor: remove unused custom tool registry endpoints
* test: add transport configuration validation for MCP client tests
- Added HTTP transport preference setup in test fixtures to ensure consistent behavior
- Implemented AssertTransportConfiguration helper to validate both HTTP and stdio transport modes
- Added tests to verify stdio transport fallback when HTTP preference is disabled
* refactor: simplify uvx path resolution to use PATH by default
- Removed complex platform-specific path detection logic and verification
- Changed to rely on system PATH environment variable instead of searching common installation locations
- Streamlined override handling to only use EditorPrefs when explicitly set by user
* feat: use serverUrl property for Windsurf HTTP transport
- Changed Windsurf configs to use "serverUrl" instead of "url" for HTTP transport to match Windsurf's expected format
- Added cleanup logic to remove stale transport properties when switching between HTTP and stdio modes
- Updated Windsurf to exclude "env" block (only required for Kiro), while preserving it for clients that need it
* feat: ensure client configurations stay current on each setup
- Removed skip logic for already-configured clients to force re-validation of core fields
- Added forced re-registration for ClaudeCode clients to keep transport settings up-to-date
* feat: add automatic migration for legacy embedded server configuration
- Created LegacyServerSrcMigration to detect and migrate old EditorPrefs keys on startup
- Automatically reconfigures all detected clients to use new uvx/stdio path
- Removes legacy keys only after successful migration to prevent data loss
* feat: add automatic stdio config migration on package updates
- Implemented StdIoVersionMigration to detect package version changes and refresh stdio MCP client configurations
- Added support for detecting stdio usage across different client types (Codex, VSCode, and generic JSON configs)
- Integrated version tracking via EditorPrefs to prevent redundant migrations
* Centralize where editor prefs are defined
It's really hard to get a view of all the editor prfes in use.
This should help humans and AI know what's going on at a glance
* Update custom tools docs
* refactor: consolidate server management UI into main editor window
- Removed server and maintenance menu items from top-level menu
- Moved "Start Local HTTP Server" and "Clear UVX Cache" buttons into editor window settings
- Added dynamic button state management based on transport protocol and server availability
* Don't show error logs when custom tools are already registerd with the server
* Only autoconnect to port 6400 if the user is using stdio for connections
* Don't double register tools on startup
* feat: switch to HTTP transport as default connection method
- Changed default transport from stdio to HTTP with server running on localhost:8080
- Added UI controls to start/stop local HTTP server directly from Unity window
- Updated all documentation and configuration examples to reflect HTTP-first approach with stdio as fallback option
* Automatically bump the versions in the READMEs.
The `main` branch gets updated before we do a release. Using versions helps users get a stable, tested installation
* docs: add HTTP transport configuration examples
- Added HTTP transport setup instructions alongside existing stdio examples
- Included port mapping and URL configuration for Docker deployments
- Reorganized client configuration sections to clearly distinguish between HTTP and stdio transports
* feat: add WebSocket-based plugin hub for Unity connections
- Implemented persistent WebSocket connections with session management, heartbeat monitoring, and command routing
- Created PluginRegistry for tracking active Unity instances with hash-based lookup and automatic reconnect handling
- Added HTTP endpoints for session listing and health checks, plus middleware integration for instance-based routing
* refactor: consolidate Unity instance discovery with shared registry
- Introduced StdioPortRegistry for centralized caching of Unity instance discovery results
- Refactored UnityConnection to use stdio_port_registry instead of direct PortDiscovery calls
- Improved error handling with specific exception types and enhanced logging clarity
* Use websockets so that local and remote MCP servers can communicate with Unity
The MCP server supports HTTP and stdio protocols, and the MCP clients use them to communicate.
However, communication from the MCP server to Unity is done on the local port 6400, that's somewhat hardcoded.
So we add websockets so oure remotely hosted MCP server has a valid connection to the Unity plugin, and can communicate with
- Created ProjectIdentityUtility for centralized project hash, name, and session ID management
- Moved command processing logic from MCPForUnityBridge to new TransportCommandDispatcher service
- Added WebSocket session ID and URL override constants to EditorPrefKeys
- Simplified command queue processing with async/await pattern and timeout handling
- Removed duplicate command execution code in favor of shared dispatcher implementation
* refactor: simplify port management and improve port field validation
- Removed automatic port discovery and fallback logic from GetPortWithFallback()
- Changed GetPortWithFallback() to return stored port or default without availability checks
- Added SetPreferredPort() method for explicit port persistence with validation
- Replaced Debug.Log calls with McpLog.Info/Warn for consistent logging
- Added port field validation on blur and Enter key press with error handling
- Removed automatic port waiting
* Launch the actual local webserver via the button
* Autoformat
* Minor fixes so the server can start
* Make clear uvx button work
* Don't show a dialog after clearing cache/starting server successfully
It's annoying, we can just log when successful, and popup if something failed
* We no longer need a Python importer
* This folder has nothing in it
* Cleanup whitespace
Most AI generated code contains extra space, unless they're hooked up to a linter. So I'm just cleaning up what's there
* We no longer need this folder
* refactor: move MCPForUnityBridge to StdioBridgeHost and reorganize transport layer
- Renamed MCPForUnityBridge class to StdioBridgeHost and moved to Services.Transport.Transports namespace
- Updated all references to StdioBridgeHost throughout codebase (BridgeControlService, TelemetryHelper, GitHub workflow)
- Changed telemetry bridge_version to use AssetPathUtility.GetPackageVersion() instead of hardcoded version
- Removed extensive inline comments and documentation throughout StdioBridgeHost
* Skip tools registration if the user is not connected to an HTTP server
* Fix VS Code configured status in UI
Serializing the config as dynamic and then reading null properties (in this case, args) caused the error. So we just walk through the properities and use JObject, handling null value explicitily
* Stop blocking the main thread when connecting via HTTP
Now that the bridge service is asynchronous, messages back and forth the server work well (including the websocket connection)
* Separate socket keep-alive interval from application keep-alive interval
Split the keep-alive configuration into two distinct intervals: _keepAliveInterval for application-level keep-alive and _socketKeepAliveInterval for WebSocket-level keep-alive. This allows independent control of socket timeout behavior based on server configuration while maintaining the application's keep-alive settings.
* Add a debug log line
* Fix McpLog.Debug method, so it actually reads the checkbox value from the user
* Add HTTP bridge auto-resume after domain reload
Implement HttpBridgeReloadHandler to automatically resume HTTP/HttpPush transports after Unity domain reloads, matching the behavior of the legacy stdio bridge. Add ResumeHttpAfterReload EditorPref key to persist state across reloads and expose ActiveMode property in IBridgeControlService to check current transport mode.
* Add health verification after HTTP bridge auto-resume
Trigger health check in all open MCPForUnityEditorWindow instances after successful HTTP bridge resume following domain reload. Track open windows using static HashSet and schedule async health verification via EditorApplication.delayCall to ensure UI updates reflect the restored connection state.
* Add name and path fields to code coverage settings
Initialize m_Name and m_Path fields in code coverage Settings.json to match Unity's expected settings file structure.
* Only register custom tools AFTER we established a healthy HTTP connection
* Convert custom tool handlers to async functions
Update dynamic_tool wrapper to use async/await pattern and replace synchronous send_with_unity_instance/send_command_with_retry calls with their async counterparts (async_send_with_unity_instance/async_send_command_with_retry).
* Correctly parse responses from Unity in the server so tools and resources can process them
We also move the logic to better places than the __init__.py file for tools, since they're shared across many files, including resources
* Make some clarifications for custom tools in docs
* Use `async_send_with_unity_instance` instead of `send_with_unity_instance`
The HTTP protocol doesn't working with blocking commands, so now we have our tools set up to work with HTTP and stdio fullly. It's coming together :-)
* Fix calls to async_send_with_unity_instance in manage_script
* Rename async_send_with_unity_instance to send_with_unity_instance
* Fix clear uv cache command
Helps a lot with local development
* Refactor HTTP server command generation into reusable method and display in UI
Extract HTTP server command building logic from StartLocalHttpServer into new TryGetLocalHttpServerCommand method. Add collapsible foldout in editor window to display the generated command with copy button, allowing users to manually start the server if preferred. Update UI state management to refresh command display when transport or URL settings change.
* Ctrl/Cmd + Shift + M now toggles the window
Might as well be able to close the window as well
* Fallback to a git URL that points to the main branch for the MCP git URL used by uvx
* Add test setup/teardown to preserve and reset Git URL override EditorPref
Implement OneTimeSetUp/OneTimeTearDown to save and restore the GitUrlOverride EditorPref state, and add SetUp to delete the key before each test. This ensures tests run with deterministic Git URLs while preserving developer overrides between test runs.
* Update docs, scripts and GH workflows to use the new MCP server code location
* Update plugin README
* Convert integration tests to async/await pattern
Update all integration tests to use pytest.mark.asyncio decorator and async/await syntax. Change test functions to async, update fake_send/fake_read mocks to async functions with **kwargs parameter, and patch async_send_command_with_retry instead of send_command_with_retry. Add await to all tool function calls that now return coroutines.
* Update image with new UI
* Remove unused HttpTransportClient client
Before I had the realization that I needed webscokets, this was my first attempt
* Remove copyright notice
* Add a guide to all the changes made for this version
A lot of code was written by AI, so I think it's important that humans can step through how all these new systems work, and know where to find things.
All of these docs were written by hand, as a way to vet that I understand what the code I wrote and generated are doing, but also to make ti easy to read for you.
* Organize imports and remove redundant import statements
Clean up import organization by moving imports to the top of the file, removing duplicate imports scattered throughout the code, and sorting imports alphabetically within their groups (standard library, third-party, local). Remove unnecessary import aliases and consolidate duplicate urlparse and time imports.
* Minor edits
* Fix stdio serializer to use the new type parameter like HTTP
* Fix: Automatic bridge reconnection after domain reload without requiring Unity focus
- Add immediate restart attempt in OnAfterAssemblyReload() when Unity is not compiling
- Enhanced compile detection to check both EditorApplication.isCompiling and CompilationPipeline.isCompiling
- Add brief port release wait in StdioBridgeHost before switching ports to reduce port thrash
- Fallback to delayCall/update loop only when Unity is actively compiling
This fixes the issue where domain reloads (e.g., script edits) would cause connection loss until Unity window was refocused, as EditorApplication.update only fires when Unity has focus.
* Make the server work in Docker
We use HTTP mode by default in docker, this is what will be hosted remotely if one chooses to.
We needed to update the uvicorn package to a version with websockets, at least so the right version is explicitly retrieved
* Cache project identity on initialization to avoid repeated computation
Add static constructor with [InitializeOnLoad] attribute to cache project hash and name at startup. Introduce volatile _identityCached flag and cached values (_cachedProjectName, _cachedProjectHash) to store computed identity. Schedule cache refresh on initialization and when project changes via EditorApplication.projectChanged event. Extract ComputeProjectHash and ComputeProjectName as private methods that perform the actual computation. Update public
* Fix typos
* Add unity_instance_middleware to py-modules list in pyproject.toml
* Remove Foldout UI elements and simplify HTTP server command section
Replace Foldout with VisualElement for http-server-command-section to display HTTP server command directly without collapsible wrapper. Remove unused manualConfigFoldout field and associated CSS styles. Remove unused _identityCached volatile flag from ProjectIdentityUtility as caching logic no longer requires it.
* Reduce height of HTTP command box
* Refresh HTTP server command display when Git URL override changes
* Make the box a bit smaller
* Split up main window into various components
Trying to avoid to monolithic files, this is easier to work, for humans and LLMs
* Update the setup wizard to be a simple setup popup built with UI toolkit
We also fix the Python/uv detectors. Instead of searching for binaries, we just test that they're available in the PATH
* Ensure that MCP configs are updated when users switch between HTTP and stdio
These only work for JSON configs, we'll have to handle Codex and Claude Code separately
* Detect Codex configuration when using HTTP or stdio configs
* Use Claude Code's list command to detect whether this MCP is configured
It's better than checking the JSON and it can verify both HTTP and stdio setups
* Fix and add tests for building configs
* Handle Unity reload gaps by retrying plugin session resolution
* Add polling support for long-running tools with state persistence
Introduce polling middleware to handle long-running operations that may span domain reloads. Add McpJobStateStore utility to persist tool state in Library folder across reloads. Extend McpForUnityToolAttribute with RequiresPolling and PollAction properties. Update Response helper with Pending method for standardized polling responses. Implement Python-side polling logic in custom_tool_service.py with configurable intervals and 10-minute timeout.
* Polish domain reload resilience tests and docs
* Refactor Response helper to use strongly-typed classes instead of anonymous objects
Replace static Response.Success/Error/Pending methods with SuccessResponse, ErrorResponse, and PendingResponse classes. Add IMcpResponse interface for type safety. Include JsonProperty attributes for serialization and JsonIgnore properties for backward compatibility with reflection-based tests. Update all tool and resource classes to use new response types.
* Rename Setup Wizard to Setup Window and improve UV detection on macOS/Linux
Rename SetupWizard class to SetupWindowService and update all references throughout the codebase. Implement platform-specific UV detection for macOS and Linux with augmented PATH support, including TryValidateUv methods and BuildAugmentedPath helpers. Split single "Open Installation Links" button into separate Python and UV install buttons. Update UI styling to improve installation section layout with proper containers and button
* Update guide on what's changed in v8
Lots of feedback, lots of changes
* Update custom tool docs to use new response objects
* Update image used in README
Slightly more up to date but not final
* Restructure backend
Just make it more organized, like typical Python projects
* Remove server_version.txt
* Feature/http instance routing (#5)
* Fix HTTP instance routing and per-project session IDs
* Drop confusing log message
* Ensure lock file references later version of uvicorn with key fixes
* Fix test imports
* Update refs in docs
---------
Co-authored-by: David Sarno <david@lighthaus.us>
* Generate the session ID from the server
We also make the identifying hashes longer
* Force LLMs to choose a Unity instance when multiple are connected
OK, this is outright the best OSS Unity MCP available
* Fix tests caused by changes in session management
* Whitespace update
* Exclude stale builds so users always get the latest version
* Set Pythonpath env var so Python looks at the src folder for modules
Not required for the fix, but it's a good guarantee regardless of the working directory
* Replace Optional type hints with modern union syntax (Type | None)
Update all Optional[Type] annotations to use the PEP 604 union syntax Type | None throughout the transport layer and mcp_source.py script
* Replace Dict type hints with modern dict syntax throughout codebase
Update all Dict[K, V] annotations to use the built-in dict[K, V] syntax across services, transport layer, and models for consistency with PEP 585
* Remove unused type imports across codebase
Clean up unused imports of Dict, List, and Path types that are no longer needed after migration to modern type hint syntax
* Remove the old telemetry test
It's working, we have a better integration test in any case
* Clean up stupid imports
No AI slop here lol
* Replace dict-based session data with Pydantic models for type safety
Introduce Pydantic models for all WebSocket messages and session data structures. Replace dict.get() calls with direct attribute access throughout the codebase. Add validation and error handling for incoming messages in PluginHub.
* Correctly call `ctx.info` with `await`
No AI slop here!
* Replace printf-style logging with f-string formatting across transport and telemetry modules
Convert all logger calls using %-style string formatting to use f-strings for consistency with modern Python practices. Update telemetry configuration logging, port discovery debug messages, and Unity connection logging throughout the codebase.
* Register custom tools via websockets
Since we'll end up using websockets for HTTP and stdio, this will ensure custom tools are available to both.
We want to compartmentalize the custom tools to the session. Custom tools in 1 unity project don't apply to another one.
To work with our multi-instance logic, we hide the custom tools behind a custom tool function tool. This is the execute_custom_tool function.
The downside is that the LLM has to query before using it.
The upside is that the execute_custom_tool function goes through the standard routing in plugin_hub, so custom tools are always isolated by project.
* Add logging decorator to track tool and resource execution with arguments and return values
Create a new logging_decorator module that wraps both sync and async functions to log their inputs, outputs, and exceptions. Apply this decorator to all tools and resources before the telemetry decorator to provide detailed execution traces for debugging.
* Fix JSONResponse serialization by converting Pydantic model to dict in plugin sessions endpoint
* Whitespace
* Move import of get_unity_instance_from_context to module level in unity_transport
Relocate the import from inside the with_unity_instance decorator function to the top of the file with other imports for better code organization and to avoid repeated imports on each decorator call.
* Remove the tool that reads resources
They don't perform well at all, and confuses the models most times.
However, if they're required, we'll revert
* We have buttons for starting and stopping local servers
Instead of a button to clear uv cache, we have start and stop buttons.
The start button pulls the latest version of the server as well.
The stop button finds the local process of the server and kills.
Need to test on Windows but it works well
* Consolidate cache management into ServerManagementService and remove standalone CacheManagementService
Move the ClearUvxCache method from CacheManagementService into ServerManagementService since cache clearing is primarily used during server operations. Remove the separate ICacheManagementService interface and CacheManagementService class along with their service locator registration. Update StartLocalServer to call the local ClearUvxCache method instead of going through the service locator.
* Update MCPForUnity/Editor/Helpers/ProjectIdentityUtility.cs
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
* Update .github/workflows/claude-nl-suite.yml
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
* Cancel existing background loops before starting a new connection
Nice bug found from CodeRabbit
* Try to kill all processes using the port of the local webserver
* Some better error handling when stopping a server
* Cache fallback session ID to maintain consistency when EditorPrefs are unavailable
Store the fallback session ID in a static field instead of generating a new GUID on each call when EditorPrefs are unavailable during batch tests. Clear the cached fallback ID when resetting the session to ensure a fresh ID is generated on the next session.
* Clean up empty parent temp folder after domain reload tests complete
Check if Assets/Temp folder is empty after deleting test-specific temp directories and remove it if no other files or directories remain. Also remove trailing blank lines from the file.
* Minor fixes
* Change "UV" to "uv" in strings. Capitlization looks weird
* Rename functions that capitalized "UV"
* Ensure WebSocket transport is properly stopped before disposing shared resources
Add disposal guard and call StopAsync() in Dispose() to prevent race conditions when disposing the WebSocket transport while background loops are still running. Log warnings if cleanup fails but continue with resource disposal.
* Replace volatile bool with Interlocked operations for reconnection flag to prevent race conditions
* Replace byte array allocation with ArrayPool to reduce GC pressure in WebSocket message receiving
Rent buffer from ArrayPool<byte>.Shared instead of allocating new byte arrays for each receive operation. Pre-size MemoryStream to 8192 bytes and ensure rented buffer is returned in finally block to prevent memory leaks.
* Consolidate some of the update/refresh logic
* UI tweak disable start/stop buttons while they code is being fired
* Add error dialog when Unity socket port persistence fails
* Rename WebSocketSessionId to SessionId in EditorPrefKeys
By the next version stdio will use Websockets as well, so why be redundant
* No need to send session ID in pong payload
* Add a debug message when we don't have an override for the uvx path
* Remove unused function
* Remove the unused verifyPath argument
* Simplify server management logic
* Remove unused `GetUvxCommand()` function
We construct it in parts now
* Remove `IsUvxDetected()`
The flow changed so it checks editor prefs and then defaults to the command line default. So it's always true.
* Add input validation and improve shell escaping in CreateTerminalProcessStartInfo
- Validate command is not empty before processing
- Strip carriage returns and newlines from command
- macOS: Use osascript directly instead of bash to avoid shell injection, escape backslashes and quotes for AppleScript
- Windows: Add window title and escape quotes in command
- Linux: Properly escape single quotes for bash -c and double quotes for process arguments
* Update technical changes guide
* Add custom_tools resource and execute_custom_tool to README documentation
* Update v8 docs
* Update docs UI image
* Handle when properties are sent as a JSON string in manage_asset
* Fix backend tests
---------
Co-authored-by: David Sarno <david@lighthaus.us>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>1 parent edd7817 commit a034ab0
File tree
346 files changed
+12527
-19560
lines changed- .github/workflows
- MCPForUnity
- Editor
- Constants
- Data
- Dependencies
- PlatformDetectors
- Helpers
- Importers
- MenuItems
- Migrations
- Resources
- Editor
- MenuItems
- Project
- Tests
- Services
- Transport
- Transports
- Setup
- Tools
- Prefabs
- Windows
- Components
- ClientConfig
- Connection
- Settings
- UnityMcpServer~/src
- resources
- tests
- integration
- tools
- Server
- registry
- resources
- src
- core
- models
- routes
- services
- registry
- resources
- tools
- transport
- legacy
- utils
- tests/integration
- tools
- TestProjects/UnityMCPTests
- Assets
- Temp
- Tests/EditMode
- Data
- Helpers
- Services
- Tools
- ProjectSettings/Packages/com.unity.testtools.codecoverage
- docs
- images
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
346 files changed
+12527
-19560
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
67 | 67 | | |
68 | 68 | | |
69 | 69 | | |
70 | | - | |
71 | | - | |
| 70 | + | |
| 71 | + | |
72 | 72 | | |
73 | | - | |
74 | | - | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
75 | 83 | | |
76 | 84 | | |
77 | 85 | | |
| |||
81 | 89 | | |
82 | 90 | | |
83 | 91 | | |
84 | | - | |
| 92 | + | |
85 | 93 | | |
86 | 94 | | |
87 | 95 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
66 | 65 | | |
67 | 66 | | |
68 | 67 | | |
| |||
217 | 216 | | |
218 | 217 | | |
219 | 218 | | |
220 | | - | |
| 219 | + | |
221 | 220 | | |
222 | 221 | | |
223 | 222 | | |
| |||
285 | 284 | | |
286 | 285 | | |
287 | 286 | | |
288 | | - | |
| 287 | + | |
289 | 288 | | |
290 | 289 | | |
291 | 290 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
29 | | - | |
| 29 | + | |
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
35 | | - | |
| 35 | + | |
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
44 | | - | |
45 | | - | |
| 44 | + | |
| 45 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
20 | | - | |
21 | 19 | | |
22 | 20 | | |
23 | 21 | | |
| |||
Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
This file was deleted.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
59 | | - | |
60 | | - | |
| 59 | + | |
| 60 | + | |
61 | 61 | | |
62 | 62 | | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | 63 | | |
68 | 64 | | |
69 | 65 | | |
| |||
104 | 100 | | |
105 | 101 | | |
106 | 102 | | |
107 | | - | |
| 103 | + | |
108 | 104 | | |
109 | 105 | | |
110 | 106 | | |
| |||
128 | 124 | | |
129 | 125 | | |
130 | 126 | | |
131 | | - | |
| 127 | + | |
132 | 128 | | |
133 | | - | |
| 129 | + | |
134 | 130 | | |
135 | 131 | | |
136 | 132 | | |
| |||
140 | 136 | | |
141 | 137 | | |
142 | 138 | | |
143 | | - | |
| 139 | + | |
144 | 140 | | |
145 | 141 | | |
146 | 142 | | |
| |||
0 commit comments