unity-mcp/Server/src
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
..
core Support GitHub Copilot in VSCode Insiders + robustness improvements and bug fixes (#425) 2025-12-04 11:41:01 -08:00
models HTTP Server, uvx, C# only custom tools (#375) 2025-11-24 23:21:06 -04:00
routes HTTP Server, uvx, C# only custom tools (#375) 2025-11-24 23:21:06 -04:00
services Fix/script path assets prefix and ctx warn bug (#453) 2025-12-10 20:09:16 -08:00
transport Unity MCP CI Test Improvements (#452) 2025-12-10 14:54:55 -08:00
utils HTTP Server, uvx, C# only custom tools (#375) 2025-11-24 23:21:06 -04:00
__init__.py HTTP Server, uvx, C# only custom tools (#375) 2025-11-24 23:21:06 -04:00
main.py Fix: HTTP/Stdio transport routing and middleware session persistence (#422) 2025-12-03 17:15:42 -08:00