-
Notifications
You must be signed in to change notification settings - Fork 657
Fixes Windows installation failures caused by long path issues when cloning the full repository via git URL (MAX_PATH 260 char limit exceeded by files in TestProjects/). #534
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Fixes Windows installation failures caused by long path issues when cloning the full repository (MAX_PATH 260 char limit exceeded). - Change default from git+https://github.com/CoplayDev/unity-mcp to mcpforunityserver=={version} PyPI package - Rename GetMcpServerGitUrl() to GetMcpServerPackageSource() - Keep deprecated wrapper for backwards compatibility - Update UI help text to show local dev override example only - Update tests to expect PyPI package reference
Fixes UI rendering issue where backslashes in Windows paths were interpreted as escape sequences (e.g. \U, \u showing as boxes). Convert backslashes to forward slashes for display in: - Target path label - Backup path label
📝 WalkthroughWalkthroughThis PR replaces Git URL-based references to the MCP server with PyPI package source references. A new Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
📜 Recent review detailsConfiguration used: defaults Review profile: CHILL Plan: Pro 📒 Files selected for processing (6)
🧰 Additional context used🧠 Learnings (6)📓 Common learnings📚 Learning: 2025-09-05T16:22:04.960ZApplied to files:
📚 Learning: 2025-09-05T16:22:04.960ZApplied to files:
📚 Learning: 2025-12-29T15:23:11.613ZApplied to files:
📚 Learning: 2025-10-13T13:41:00.086ZApplied to files:
📚 Learning: 2025-10-13T13:27:23.040ZApplied to files:
🧬 Code graph analysis (2)MCPForUnity/Editor/Helpers/AssetPathUtility.cs (2)
MCPForUnity/Editor/Clients/McpClientConfiguratorBase.cs (1)
🔇 Additional comments (15)
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 |
Reviewer's GuideDefaults MCP server installation to a PyPI package source instead of a git repository URL, updates all usages and tests to the new package source helper, and fixes Windows UI path display by normalizing paths to forward slashes. Sequence diagram for uvx configuration and manual snippet generation with new package sourcesequenceDiagram
participant User
participant UnityEditor
participant McpClientConfiguratorBase as Configurator
participant AssetPathUtility as Paths
participant MCPServiceLocatorPaths as Locator
participant McpConfigurationHelper as ConfigHelper
User->>UnityEditor: Open MCP settings window
UnityEditor->>Configurator: CheckStatus(attemptAutoRewrite)
Configurator->>Paths: GetMcpServerPackageSource()
Paths->>EditorPrefs: GetString(GitUrlOverride, "")
alt override present
EditorPrefs-->>Paths: sourceOverride
Paths-->>Configurator: sourceOverride
else no override
Paths->>Paths: GetPackageVersion()
alt version unknown
Paths-->>Configurator: mcpforunityserver
else version known
Paths-->>Configurator: mcpforunityserver==version
end
end
Configurator->>McpServiceLocator.Paths: GetUvxPath()
Configurator->>ConfigHelper: ExtractUvxUrl(args)
Configurator->>ConfigHelper: PathsEqual(configuredUvxUrl, expectedUvxUrl)
ConfigHelper-->>Configurator: matches or not
Configurator-->>UnityEditor: McpStatus
User->>UnityEditor: View manual setup snippet
UnityEditor->>Configurator: GetManualSnippet()
Configurator->>Locator: GetUvxPath()
Configurator->>Paths: ShouldForceUvxRefresh()
Configurator->>Paths: GetMcpServerPackageSource()
Configurator-->>UnityEditor: Shell snippet with uvx --from packageSource
Class diagram for updated MCP server package source helperclassDiagram
class AssetPathUtility {
+JObject GetPackageJson()
+string GetMcpServerPackageSource()
<<obsolete>> +string GetMcpServerGitUrl()
+ (string uvxPath, string fromUrl, string packageName) GetUvxCommandParts()
+bool ShouldForceUvxRefresh()
+bool IsLocalServerPath()
+string GetLocalServerPath()
}
class McpClientConfiguratorBase {
+McpStatus CheckStatus(bool attemptAutoRewrite)
+string GetManualSnippet()
}
class PackageDeploymentService {
+string GetTargetPath()
+string GetTargetDisplayPath()
+string GetLastBackupPath()
+bool HasBackup()
}
class McpSettingsSection {
-Label deployBackupLabel
+void UpdateDeploymentSection()
}
class MCPServiceLocatorPaths {
+string GetUvxPath()
}
class McpConfigurationHelper {
+string ExtractUvxUrl(string[] args)
+bool PathsEqual(string pathA, string pathB)
}
AssetPathUtility --> MCPServiceLocatorPaths : uses
McpClientConfiguratorBase --> AssetPathUtility : uses package source
McpClientConfiguratorBase --> McpConfigurationHelper : uses for comparison
PackageDeploymentService --> AssetPathUtility : uses paths (indirectly in system)
McpSettingsSection --> PackageDeploymentService : uses backup path
File-Level Changes
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
上游變更 (v7.0.0 → v9.0.3): - GameObject 工具集重構 (CoplayDev#518) - VFX 管理功能 (CoplayDev#520) - 批次執行錯誤處理改進 (CoplayDev#531) - Windows 長路徑問題修復 (CoplayDev#534) - HTTP/Stdio 傳輸 UX 改進 (CoplayDev#530) - LLM 工具註解功能 (CoplayDev#480) 衝突解決: - modify/delete:接受刪除(架構已重構) - content:接受 v9.0.3 版本(2020 相容性修正將另行處理)
Changes
git+https://github.com/CoplayDev/unity-mcp@v{version}#subdirectory=Servertomcpforunityserver=={version}GetMcpServerGitUrl()→GetMcpServerPackageSource()(deprecated wrapper kept for compatibility)Testing
uvx --from mcpforunityserver==9.0.1 mcp-for-unity --helpSummary by Sourcery
Switch MCP server installation to use a PyPI package source by default and improve path handling in deployment UI.
Bug Fixes:
Enhancements:
Tests: