Cursor "failed to create client" when Unity MCP project path contains spaces?
With unity-mcp (CoplayDev/unity-mcp) and Cursor on Linux, Cursor shows "failed to create client" when the Unity project folder name contains spaces, e.g. "My project (1)". The Unity MCP bridge side appears to work fine. How do I fix the MCP config or project setup so spaces in the path stop breaking the client?
Originally asked on GitHub: https://github.com/CoplayDev/unity-mcp/issues/21
4 answers
The cause is that spaces in a path are parsed as separate command arguments, so the auto-generated config breaks when the project lives in a folder like "My project (1)". The thread confirms a working fix: remove spaces from the project folder name. A contributor also said an installer update (PR #82) should fix the auto-config, but that fix is not yet confirmed by a user in this thread.
Confirmed workaround: rename the Unity project so its path has no spaces, update the path in Cursor, stop/restart the bridge, click auto-generate config, then restart Cursor and verify the generated paths look correct.
Immediate workaround suggested by a contributor (not confirmed in the thread): open Window > Unity MCP > Manual Setup > Open File and wrap the Python directory path in escaped double quotes inside the args array:
json{ "mcpServers": { "unityMCP": { "command": "uv", "args": [ "--directory", "\"/home/.../.../Python\"", "run", "server.py" ] } } }The contributor also advises avoiding spaces in folder names in general.
Did this work for you?What a GitHub user tried on GitHub (Didn't work)
Used the auto-generated unity-mcp config with a Unity project path containing spaces ("My project (1)"); Cursor reported "failed to create client" while the Unity side looked fine.
Source: https://github.com/CoplayDev/unity-mcp/issues/21 (opens external site)
Did this work for you?What @justinpbarnett tried on GitHub (Outcome unclear)
A contributor suggested escaping the directory path inside the args array by wrapping it in escaped double quotes ("/home/.../.../Python") in the MCP config JSON as an immediate fix.
Source: https://github.com/CoplayDev/unity-mcp/issues/21#issuecomment-2743086524 (opens external site)
Did this work for you?What @ChuloIva tried on GitHub (Worked)
A user renamed the project to remove spaces, updated the path in Cursor, stopped and restarted the bridge, regenerated the config, and restarted Cursor; this resolved the issue.
Source: https://github.com/CoplayDev/unity-mcp/issues/21#issuecomment-2743176485 (opens external site)
Did this work for you?
Related questions
- Does unity-mcp support auto-approving MCP tool calls, or must I approve every call?
- unity-mcp doesn't work on Unity 2021.3.32 but works on 2022 - what's needed?
- unity-mcp: Cursor/Claude MCP tools fail with timeout or parse errors after updating?
- Unity MCP fails with "Invalid JSON format" when creating large C# scripts
- unity-mcp: "No Unity Editor instances found" with Tuanjie Engine 1.6.7