CoplayDev/unity-mcp

Clean up VSCode config

Closed this issue · 13 comments

Needs to configure mcp file in right location and show green light when configured. imageimage

I also ran into this dialog (first screenshot).

I'm having an issue where the MCP Client Configuration turns green after either auto-configure or manual configuration. But as soon as I close the MCP Server dialog in Unity and return to check, it shows the MCP Client Configuration as red. When I check the settings.json file, the correct code is indeed there.

Is this the same issue?

@tumml3r Might be. Does the MCP work despite whether it says it's configured right or not?

@dsarno No, Copilot doesn't seem to route the command to the Unity MCP Server.

As a next step, I just set up everything again. Confirmed the correct unityMCP settings are in settings.json and mcp.json. Now the Unity MCP dialog in Unity does seem to save and appears green.

However now Copilot just seems to hang when issued a command. I asked it to create an empty gameobject as a test and it's been spinning for over 5 minutes now. I'm guessing this new issue is unrelated?

@dsarno Should the dropdown under "MCP Client Configuration" be defaulting to my selected MCP client when I open the Unity MCP dialog? Even though the configuration appears to be saved/working for VS Code, the dropdown does default to Claude when I open it.

@tumml3r No, the dropdowns are in a fixed order. But I did push an update today, currently waiting to be merged, that you can test and see if it works better with VSCode. Someone on our Discord said it did. Let me know if you get better performance with the MCP. I'll have to fix the VSCode dropdown / UI stuff separately.

Unity MCP Bridge stability test – call for testers

I just finished an update that should fix many/most/hopefully all port error and connection issues on both Mac and PC. It would be fantastic if any unity-mcp users could test it out before we merge it into main.

Install (no git needed)

Edit your Unity project’s Packages/manifest.json and change one line:

"com.coplaydev.unity-mcp": "https://github.com/dsarno/unity-mcp.git?path=/UnityMcpBridge#feat/bridge-stability"

In Unity

  • Open Window → Unity MCP and confirm the bridge starts (e.g., “UnityMcpBridge started on port 6400”).
  • If needed, click “Repair Python Env” once to rebuild the server venv (uses uv).
  • Click “Auto‑Setup” (button shows “Connected ✓” when clients are configured).

From your IDE (Cursor/Claude/VSCode)

  • Run a simple MCP call (e.g., read_console).
  • Make a trivial code change to trigger a domain reload and confirm the connection remains stable on the same port.

Revert when done (back to default repo)

Edit Packages/manifest.json back to:

"com.coplaydev.unity-mcp": "https://github.com/CoplayDev/unity-mcp.git?path=/UnityMcpBridge"

@dsarno Here's what I experienced:

  1. Switched to the new branch. Had the same issue.
  2. After troubleshooting, discovered that config.py specified port 6400 but the Unity MCP Bridge was 6402.
  3. Updated config.py to 6402. Success running my test (create empty game object).
  4. Immediately after, the MCP Editor dialog showed that the MCP Client Configuration had gone red again. Auto-configured again.
  5. Ran a call to change the name of the empty game object. Success. MCP Client Configuration still green.

Now that I've got it working, I'm hesitant to switch back to the main branch until this change gets merged. Is there any risk in keeping as-is for now?

@tumml3r Thanks for testing and feedback! No, you're good to stay on this branch. I'm guessing it'll get merged in a day or two, and not likely you'll miss anything new in main between now and then.

@tumml3r But to clarify -- did the stability update fix this current issue with VSCode config by itself?

@dsarno Actually, no. Two notes:

  1. When I opened Unity and VS Code today, the Client Configuration for VS Code was red again. Auto-configure fixes it, but it still doesn't seem to save persistently between Unity sessions.
  2. The showstopping issue with the server/bridge not working was related to the port numbers not matching. 6400 vs 6402. I found and fixed that manually.

Okay so we need to look into why the configuration or bridge connections aren't persisting (or at least, restarting)between sessions.

Should work now. Please update the package and give it a try. image

@tumml3r Would you mind trying one more time? We've done a lot of work over the past week to improve UnityMCP installation and configuration, including with VSCode -- your feedback would be appreciated to close this issue!

Should work now. Closing