fix: correct Trae MCP config path - #1346
Conversation
Trae is a VS Code fork: its global MCP config is .../Trae/User/mcp.json, not the user data root. Since we have written one level up, it fails silently, because IsInstalled only stats the parent directory so the UI still reports "Configured". Verified on macOS against Trae 1.10; Windows and Linux paths are inferred from the same VS Code profile layout.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review. 📝 WalkthroughWalkthroughThe Trae configurator now uses platform-specific MCP configuration paths that include the ChangesTrae configuration paths
Estimated code review effort: 1 (Trivial) | ~5 minutes Merge Risk: 🟡 Moderate · up to The PR changes the MCP configuration location on all supported platforms, but that path is disputed in review; merging without resolving which location Trae actually reads could leave Unity MCP unconfigured. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Description checkExplanation The description is complete and directly related to the change. It identifies the root cause, lists all platform-specific path updates, records compatibility and testing details, explains documentation status, and notes the unverified Windows and Linux paths. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Description
TraeConfiguratorwrites the Unity MCP entry to.../Trae/mcp.json, but Trae reads its global MCP config from.../Trae/User/mcp.json, one level down, in the profile folder.This has been wrong since #337. The failure mode is silent and reports success because
IsInstalledonly stats the parent directory, which exists, so Trae is detected, the write succeeds, and the MCP for Unity window shows Configured while Trae loads nothing.Trae derives the MCP config location from the profile folder, not the user data root. In
Trae.app/Contents/Resources/app/out/main.js:Trae appends mcp.json to the profile location, which for the default profile is appSettingsHome, resolving to
<userData>/User/mcp.json. Nothing in the app's bundles joins userDataPath with mcp.json directly, so the old path is unreachable by Trae, not merely deprioritized.Type of Change
Changes Made
MCPForUnity/Editor/Clients/Configurators/TraeConfigurator.csonly,windowsConfigPath:%AppData%\Trae\mcp.json→%AppData%\Trae\User\mcp.jsonmacConfigPath:~/Library/Application Support/Trae/mcp.json→~/Library/Application Support/Trae/User/mcp.jsonlinuxConfigPath:~/.config/Trae/mcp.json→~/.config/Trae/User/mcp.jsonGetInstallationSteps()Compatibility / Package Source
Testing/Screenshots/Recordings
cd Server && uv run pytest tests/ -v)Verified against a running Trae 3.5.87 (macOS arm64) by planting a uniquely named MCP server at the old path:
User/mcp.json(Puppeteer, for testing) + old path (probe)The probe never appears anywhere in Trae's logs or state. The file is not read and rejected, it is never opened.
End-to-end in Unity 6000.5.4f1 (macOS). Loaded this branch as a local package, opened Window → MCP for Unity → Configure with Trae selected. The
unityMCPentry was written to~/Library/Application Support/Trae/User/mcp.json, merged alongside existing MCP servers, and the old.../Trae/mcp.jsonpath was never created. Trae then showed unityMCP in Settings → MCP.Documentation Updates
tools/UPDATE_DOCS_PROMPT.md(recommended)Related Issues
No issue was filed for this. Found while configuring Trae locally and noticing the UI reported Configured while Trae showed no Unity server.
Additional Notes
Why no test. A
Path.Combineassertion against a path literal restates the constant rather than verifying it, and would still pass if Trae relocated the file — so it would not catch the next occurrence of this bug either.Only macOS is verified against a running Trae. The Windows and Linux paths are inferred from the same VS Code profile layout (
%AppData%\Code\User,~/.config/Code/User) and would benefit from a check by someone on those platforms.Summary by CodeRabbit
Usersubdirectory.