You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Py files not found and tracked by external tools added. #308
The current implementation requires MCP4Unity to be placed in the package folder and cannot be added directly, like a git url. As that prevents edits needed to add py to the tools folder. It doesn't also track and automatically find py files, so this makes it hard for other tools to extend their own functionality with MCP.
I would like to see MCPForUnity automatically find all folders in the project having some standard name and then identify the py file and a version.txt so it's easy to track the version of the MCP integration and update it when the user updates it...automatically on domain reload. C-sharp files can be done as before, because that's a good solution.
I have this implementation in my fork so happy to do a PR.
The current implementation requires MCP4Unity to be placed in the package folder and cannot be added directly, like a git url.
Hmm... I wonder if we should release a .unitypackage that makes installing in the Assets folder easier?
Are you sure? It's primarily installed as a package, but it works from the Asset folder as well. At least it did, it has to work from that folder for the Asset store submission to work.
As that prevents edits needed to add py to the tools folder. It doesn't also track and automatically find py files, so this makes it hard for other tools to extend their own functionality with MCP.
This I totally get, it's not convenient at all. And I think I see the PR and example helps me understand! You have a folder with both the C# and Python code for the tools!
version.txt so it's easy to track the version of the MCP integration and update it when the user updates it
I see.. this part feels a bit like extra management though. When you update the package, the Python server is overwritten, so the custom tools are gone. "Rebuild MCP Server" should keep your custom tools, and ideally that function is what's called after an update
The version.txt might seam overhead but is needed for the senario when a new version of an other asset is released. And need to force an update of just that tool. That will happen automatically after domain reload which happens just after every package update.
The current implementation requires MCP4Unity to be placed in the package folder and cannot be added directly, like a git url.
... I mean that when you install it using the git url it ends up as an immutable package in the package cache. You can move it to Packsges folder to add tools manually but that is a lot of hassle and break some other update functions.
If I did miss understod or missed any question just ping @msanatan
Thank you so much on all great work on this mcp and Copley! :)
Thank you for taking the time to review @msanatan!
So a more concrete feature list:
MCPForUnity now allows external tools to installed automatic as long they are placed under Assets, Packages and Library\PackageCache. All they need is to add a folder MCPForUnityTools with four files.
*One Asmdef which has conditional compilation if MCPForUnity is installed.
*One Python file with the server code.
*One C# file with the Unity side code of the tool acting as a bridge to the asset.
*One version.txt with the version like 1.0.1 to allow automatic update on Asset update. Checked on domain reload.
On domain reload and normal installation of the server (including rebuild) ALL tools are checked:
If MCPForUnity is updated then on domain reload the tools are installed again automatically.
If tool is removed it's uninstalled from server on domain reload. This is since all MCPForUnityTools are checked and compared on domain reload.
If a tool is updated the version mismatch will trigger re installing that specific tool.
This allow for zero end user engagement to enable a tool. If MCPForUnity is installed and an MCPForUnity ready asset is installed in the project it's registered and found by the MCPForUnity.
Hope this is more concrete. Geting my point across is not my strong suit. ;) So if any thing is unclear just ask or suggest improvement.
The current implementation requires MCP4Unity to be placed in the package folder and cannot be added directly, like a git url.
... I mean that when you install it using the git url it ends up as an immutable package in the package cache. You can move it to Packsges folder to add tools manually but that is a lot of hassle and break some other update functions.
If I did miss understod or missed any question just ping @msanatan
Thank you so much on all great work on this mcp and Copley! :)
Thank you for taking the time to review @msanatan!
So a more concrete feature list: MCPForUnity now allows external tools to installed automatic as long they are placed under Assets, Packages and Library\PackageCache. All they need is to add a folder MCPForUnityTools with four files. *One Asmdef which has conditional compilation if MCPForUnity is installed. *One Python file with the server code. *One C# file with the Unity side code of the tool acting as a bridge to the asset. *One version.txt with the version like 1.0.1 to allow automatic update on Asset update. Checked on domain reload.
On domain reload and normal installation of the server (including rebuild) ALL tools are checked: If MCPForUnity is updated then on domain reload the tools are installed again automatically. If tool is removed it's uninstalled from server on domain reload. This is since all MCPForUnityTools are checked and compared on domain reload. If a tool is updated the version mismatch will trigger re installing that specific tool.
This allow for zero end user engagement to enable a tool. If MCPForUnity is installed and an MCPForUnity ready asset is installed in the project it's registered and found by the MCPForUnity.
Hope this is more concrete. Geting my point across is not my strong suit. ;) So if any thing is unclear just ask or suggest improvement.
Thank you, this helps a lot! I really appreciate the effort you took to explain it. I like the fact that domain reloads gets the tools re-registered. Having all your tools in a fixed folder is a limitation, but I think this is good for now and we can iterate later with the C# only method.
Can you update the CUSTOM_TOOLS readme with these instructions?
@msanatan I believe what the rabbit comes with now is not relevant. Please review and see if all is adaptable. Have been using the branch as for one week and nothing seams out of place but not too heavy testing. What is your testing work flow? Any thing I should do?
@msanatan I believe what the rabbit comes with now is not relevant. Please review and see if all is adaptable. Have been using the branch as for one week and nothing seams out of place but not too heavy testing. What is your testing work flow? Any thing I should do?
Generally we test locally (and tbh we just trust you haha). Sorry for the silence! I had some more thoughts as I was checking it out, and left fairly detailed feedback on the PR (which I should have done instead of communicating here). I'd like some changes to match the current code pattens we've introduced, remove the caveats mentioned before.
Let's move technical feedback to #309, as the critical feedback is there
Activity
JohanHoltby commentedon Oct 9, 2025
The user would need to create a folder somewhere in their Assets that looks like this:
JohanHoltby commentedon Oct 9, 2025
So I believe the PR is ready for human review. :)
msanatan commentedon Oct 9, 2025
Thanks for contributing @JohanHoltby!
Hmm... I wonder if we should release a .unitypackage that makes installing in the Assets folder easier?
Are you sure? It's primarily installed as a package, but it works from the Asset folder as well. At least it did, it has to work from that folder for the Asset store submission to work.
This I totally get, it's not convenient at all. And I think I see the PR and example helps me understand! You have a folder with both the C# and Python code for the tools!
I see.. this part feels a bit like extra management though. When you update the package, the Python server is overwritten, so the custom tools are gone. "Rebuild MCP Server" should keep your custom tools, and ideally that function is what's called after an update
msanatan commentedon Oct 9, 2025
One thing we may do in a couple of weeks is #293. How I think it can work is:
However, that's a bit further away, so something like this would be really useful.
Is it possible to have the Rebuild button capture these folder tools as well?
JohanHoltby commentedon Oct 9, 2025
So yes that is handled like this. So sl is automatic. Just did a rebuild and it re adds the tool.
<color=#2EA3FF>MCP-FOR-UNITY: Deleted existing server at C:\Users\JohanHoltby\AppData\Local\UnityMCP\UnityMcpServer
UnityEngine.Debug:Log (object)
MCPForUnity.Editor.Helpers.ServerInstaller:RebuildMcpServer () (at ./Packages/unity-mcp-MooseRunner/MCPForUnity/Editor/Helpers/ServerInstaller.cs:657)
MCPForUnity.Editor.Windows.MCPForUnityEditorWindow:DrawServerStatusSection () (at ./Packages/unity-mcp-MooseRunner/MCPForUnity/Editor/Windows/MCPForUnityEditorWindow.cs:380)
MCPForUnity.Editor.Windows.MCPForUnityEditorWindow:OnGUI () (at ./Packages/unity-mcp-MooseRunner/MCPForUnity/Editor/Windows/MCPForUnityEditorWindow.cs:189)
UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)
<color=#2EA3FF>MCP-FOR-UNITY: Copied Unity project tool: run_play_mode_tests.py from MooseRunnerGit_MCPForUnityTools (v1.0.6)
UnityEngine.Debug:Log (object)
MCPForUnity.Editor.Helpers.McpLog:Info (string,bool) (at ./Packages/unity-mcp-MooseRunner/MCPForUnity/Editor/Helpers/McpLog.cs:18)
MCPForUnity.Editor.Helpers.ServerInstaller:CopyUnityProjectTools (string) (at ./Packages/unity-mcp-MooseRunner/MCPForUnity/Editor/Helpers/ServerInstaller.cs:493)
MCPForUnity.Editor.Helpers.ServerInstaller:RebuildMcpServer () (at ./Packages/unity-mcp-MooseRunner/MCPForUnity/Editor/Helpers/ServerInstaller.cs:673)
MCPForUnity.Editor.Windows.MCPForUnityEditorWindow:DrawServerStatusSection () (at ./Packages/unity-mcp-MooseRunner/MCPForUnity/Editor/Windows/MCPForUnityEditorWindow.cs:380)
MCPForUnity.Editor.Windows.MCPForUnityEditorWindow:OnGUI () (at ./Packages/unity-mcp-MooseRunner/MCPForUnity/Editor/Windows/MCPForUnityEditorWindow.cs:189)
UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)
<color=#2EA3FF>MCP-FOR-UNITY: Copied 1 Unity project tool(s) to server
UnityEngine.Debug:Log (object)
MCPForUnity.Editor.Helpers.McpLog:Info (string,bool) (at ./Packages/unity-mcp-MooseRunner/MCPForUnity/Editor/Helpers/McpLog.cs:18)
MCPForUnity.Editor.Helpers.ServerInstaller:CopyUnityProjectTools (string) (at ./Packages/unity-mcp-MooseRunner/MCPForUnity/Editor/Helpers/ServerInstaller.cs:522)
MCPForUnity.Editor.Helpers.ServerInstaller:RebuildMcpServer () (at ./Packages/unity-mcp-MooseRunner/MCPForUnity/Editor/Helpers/ServerInstaller.cs:673)
MCPForUnity.Editor.Windows.MCPForUnityEditorWindow:DrawServerStatusSection () (at ./Packages/unity-mcp-MooseRunner/MCPForUnity/Editor/Windows/MCPForUnityEditorWindow.cs:380)
MCPForUnity.Editor.Windows.MCPForUnityEditorWindow:OnGUI () (at ./Packages/unity-mcp-MooseRunner/MCPForUnity/Editor/Windows/MCPForUnityEditorWindow.cs:189)
UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)
<color=#2EA3FF>MCP-FOR-UNITY: Server rebuilt successfully at C:\Users\JohanHoltby\AppData\Local\UnityMCP\UnityMcpServer (version 5.0.0)
UnityEngine.Debug:Log (object)
MCPForUnity.Editor.Helpers.ServerInstaller:RebuildMcpServer () (at ./Packages/unity-mcp-MooseRunner/MCPForUnity/Editor/Helpers/ServerInstaller.cs:686)
MCPForUnity.Editor.Windows.MCPForUnityEditorWindow:DrawServerStatusSection () (at ./Packages/unity-mcp-MooseRunner/MCPForUnity/Editor/Windows/MCPForUnityEditorWindow.cs:380)
MCPForUnity.Editor.Windows.MCPForUnityEditorWindow:OnGUI () (at ./Packages/unity-mcp-MooseRunner/MCPForUnity/Editor/Windows/MCPForUnityEditorWindow.cs:189)
UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)
The version.txt might seam overhead but is needed for the senario when a new version of an other asset is released. And need to force an update of just that tool. That will happen automatically after domain reload which happens just after every package update.
JohanHoltby commentedon Oct 9, 2025
The current implementation requires MCP4Unity to be placed in the package folder and cannot be added directly, like a git url.
... I mean that when you install it using the git url it ends up as an immutable package in the package cache. You can move it to Packsges folder to add tools manually but that is a lot of hassle and break some other update functions.
If I did miss understod or missed any question just ping @msanatan
Thank you so much on all great work on this mcp and Copley! :)
JohanHoltby commentedon Oct 10, 2025
Thank you for taking the time to review @msanatan!
So a more concrete feature list:
MCPForUnity now allows external tools to installed automatic as long they are placed under Assets, Packages and Library\PackageCache. All they need is to add a folder MCPForUnityTools with four files.
*One Asmdef which has conditional compilation if MCPForUnity is installed.
*One Python file with the server code.
*One C# file with the Unity side code of the tool acting as a bridge to the asset.
*One version.txt with the version like 1.0.1 to allow automatic update on Asset update. Checked on domain reload.
On domain reload and normal installation of the server (including rebuild) ALL tools are checked:
If MCPForUnity is updated then on domain reload the tools are installed again automatically.
If tool is removed it's uninstalled from server on domain reload. This is since all MCPForUnityTools are checked and compared on domain reload.
If a tool is updated the version mismatch will trigger re installing that specific tool.
This allow for zero end user engagement to enable a tool. If MCPForUnity is installed and an MCPForUnity ready asset is installed in the project it's registered and found by the MCPForUnity.
Hope this is more concrete. Geting my point across is not my strong suit. ;) So if any thing is unclear just ask or suggest improvement.
JohanHoltby commentedon Oct 10, 2025
I did just found a bug. some pycache foder gets removed in the tools folder. I need to exclude that folder from cleaning. Don't push PR forward yet.
JohanHoltby commentedon Oct 10, 2025
So now pycache fix is done. Used the _skipDirs as that sounds about right ;) @msanatan
msanatan commentedon Oct 10, 2025
My bad, you're correct an that's very clear!
msanatan commentedon Oct 10, 2025
Thank you, this helps a lot! I really appreciate the effort you took to explain it. I like the fact that domain reloads gets the tools re-registered. Having all your tools in a fixed folder is a limitation, but I think this is good for now and we can iterate later with the C# only method.
Can you update the CUSTOM_TOOLS readme with these instructions?
JohanHoltby commentedon Oct 10, 2025
Thank you :). Happy to contribute! Sure will do and ping once done :)
msanatan commentedon Oct 10, 2025
Thank you! This is awesome
JohanHoltby commentedon Oct 13, 2025
@msanatan I believe what the rabbit comes with now is not relevant. Please review and see if all is adaptable. Have been using the branch as for one week and nothing seams out of place but not too heavy testing. What is your testing work flow? Any thing I should do?
JohanHoltby commentedon Oct 13, 2025
@msanatan did just found a bug.
msanatan commentedon Oct 14, 2025
Generally we test locally (and tbh we just trust you haha). Sorry for the silence! I had some more thoughts as I was checking it out, and left fairly detailed feedback on the PR (which I should have done instead of communicating here). I'd like some changes to match the current code pattens we've introduced, remove the caveats mentioned before.
Let's move technical feedback to #309, as the critical feedback is there
Allow users to easily add tools in the Asset folder (#324)
msanatan commentedon Oct 18, 2025
@JohanHoltby thanks for your help. I built upon your work and added the SciptableObject solution from the review: #324
JohanHoltby commentedon Oct 18, 2025
@msanatan Thank you so much! Happy you fixed it! I will adapt my to to it immediately and start using it.
Allow users to easily add tools in the Asset folder (CoplayDev#324)