-
-
Notifications
You must be signed in to change notification settings - Fork 68
Troubleshooting
This guide helps you diagnose and resolve common issues with Unity-MCP. Issues are organized by category with step-by-step solutions.
- Check Unity Console for error messages
-
Verify Server is Running: Visit
http://localhost:8080/health - Restart Everything: Unity Editor โ MCP Server โ AI Client
- Check Port 8080 isn't blocked by firewall
# Test server connectivity
curl -f http://localhost:8080/health
# Check what's using port 8080
netstat -tulpn | grep 8080
# Restart server with different port
unity-mcp-server --port 8081Symptoms: No "Unity MCP" menu in Window menu
Solution:
-
Check Console for Errors:
- Look for compilation errors
- Check for missing dependencies
-
Verify Installation:
# Check if files exist ls -la Assets/Unity-MCP/ # Or in Package Manager location ls -la Packages/com.ivanmurzak.unity.mcp/
-
Reimport Package:
- Right-click plugin folder โ Reimport
- Or Assets โ Reimport All
-
Check Unity Version:
- Unity 2022.3+ required
- Update Unity if necessary
Symptoms: "Package not found" or Git URL errors
Solutions:
# Try different Git URL formats
https://github.com/IvanMurzak/Unity-MCP.git?path=/Unity-MCP-Plugin/Assets/root
# Or specific branch/commit
https://github.com/IvanMurzak/Unity-MCP.git?path=/Unity-MCP-Plugin/Assets/root#main
# For SSH access issues, use HTTPS insteadSymptoms: Download fails or import errors
Solutions:
-
Clear Asset Store Cache:
- Windows:
%APPDATA%\Unity\Asset Store-5.x\ - macOS:
~/Library/Unity/Asset Store-5.x/ - Delete cache folders and try again
- Windows:
-
Retry Download:
- Go to Window โ Package Manager
- Select "My Assets"
- Re-download Unity MCP
Symptoms: "Package not found" errors
Solutions:
# Update .NET to latest version
dotnet --version # Should be 9.0+
# Clear NuGet cache
dotnet nuget locals all --clear
# Try alternative installation
dotnet tool install -g Unity.MCP.Server --version 1.0.0
# Install from local package
dotnet tool install -g --add-source ./nupkg Unity.MCP.ServerSymptoms: Image pull failures or container won't start
Solutions:
# Check Docker is running
docker version
# Pull image manually with verbose output
docker pull ivanmurzakdev/unity-mcp-server:latest --progress=plain
# Try alternative registries
docker pull ghcr.io/ivanmurzak/unity-mcp-server:latest
# Check disk space
docker system df
# Clean up if needed
docker system prune -fSymptoms: "Connection refused" or timeout errors in Unity Console
Diagnosis:
# Check if server is running
curl -f http://localhost:8080/health
# Check server logs
docker logs unity-mcp-server
# Verify port is open
telnet localhost 8080Solutions:
-
Start MCP Server:
# Docker docker run -p 8080:8080 ivanmurzakdev/unity-mcp-server:latest # .NET Tool unity-mcp-server
-
Check Port Configuration:
- Unity Plugin: Window โ Unity MCP โ Settings โ Port: 8080
- Server: Ensure same port in configuration
-
Firewall Issues:
# Windows netsh advfirewall firewall add rule name="Unity-MCP" dir=in action=allow protocol=TCP localport=8080 # macOS sudo pfctl -d # Disable firewall temporarily for testing # Linux sudo ufw allow 8080/tcp
Symptoms: Connection attempts on wrong port
Solution:
-
Unity Plugin Configuration:
- Window โ Unity MCP โ Settings
- Set Port to match server (default: 8080)
-
Server Configuration:
# Start server on specific port unity-mcp-server --port 8080 # Or with environment variable UNITY_MCP_PORT=8080 unity-mcp-server
Symptoms: Connection works locally but not remotely
Solutions:
# Test remote connectivity
curl -f http://your-server-ip:8080/health
# Configure proxy if needed
export HTTP_PROXY=http://proxy.company.com:8080
export HTTPS_PROXY=https://proxy.company.com:8080
# Bind server to all interfaces
unity-mcp-server --host 0.0.0.0 --port 8080Symptoms: Claude doesn't show Unity-MCP tools
Solutions:
-
Check Configuration File:
- Windows:
%APPDATA%\Claude\claude_desktop_config.json - macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Linux:
~/.config/Claude/claude_desktop_config.json
- Windows:
-
Validate JSON Format:
# Validate JSON syntax python -m json.tool claude_desktop_config.json -
Correct Configuration:
{ "mcpServers": { "unity-mcp": { "command": "unity-mcp-server", "args": ["--client-transport", "stdio"], "env": { "UNITY_MCP_PORT": "8080" } } } } -
Restart Claude Desktop after configuration changes
Symptoms: Extension doesn't recognize Unity-MCP server
Solutions:
- Install MCP Extension: Search for "MCP" in VS Code extensions
-
Configure Settings:
{ "mcp.servers": { "unity-mcp": { "command": "unity-mcp-server", "transport": "stdio" } } } - Reload Window: Cmd/Ctrl + Shift + P โ "Developer: Reload Window"
Symptoms: Unity becomes unresponsive when using AI tools
Solutions:
-
Enable Threading in Unity-MCP settings:
- Window โ Unity MCP โ Settings
- Enable "Use Background Threading"
-
Reduce Batch Size:
- Lower batch size in settings (default: 100 โ 25)
-
Check System Resources:
# Monitor memory usage top -p $(pgrep Unity) # Windows Task Manager tasklist | findstr Unity
Symptoms: AI tools take too long to execute
Solutions:
-
Optimize Server Settings:
# Increase timeout unity-mcp-server --plugin-timeout 30000 -
Check Network Latency:
# Test local latency ping localhost # Test server response time time curl -f http://localhost:8080/health
-
Unity Editor Optimization:
- Close unnecessary windows
- Reduce scene complexity for testing
- Clear console logs
Symptoms: AI reports success but no objects appear
Solutions:
-
Check Active Scene:
- Verify you're looking at the correct scene
- Switch to Scene view if in Game view
-
Check Object Position:
- Objects might be created outside visible area
- Search for objects by name in Hierarchy
-
Verify Parent Hierarchy:
- Objects might be created under inactive parents
- Check if parent GameObjects are active
Symptoms: "Component not found" or "Cannot add component" errors
Solutions:
-
Check Component Name:
// Correct component names "Rigidbody" (not "RigidBody") "MeshRenderer" (not "Mesh Renderer") "BoxCollider" (not "Box Collider")
-
Assembly Issues:
- Some components require specific assemblies
- Check if component is available in current context
-
Component Conflicts:
- Some components can't coexist (e.g., multiple colliders)
- Remove conflicting components first
Symptoms: Material changes don't appear on objects
Solutions:
-
Check Renderer Component:
- Ensure GameObject has MeshRenderer or SkinnedMeshRenderer
- Verify renderer is enabled
-
Material Assignment:
// Check material is properly assigned var renderer = gameObject.GetComponent<MeshRenderer>(); if (renderer != null && renderer.material != null) { Debug.Log("Material assigned: " + renderer.material.name); }
Symptoms: "Asset not found" errors
Solutions:
-
Refresh Asset Database:
- Assets โ Refresh (Ctrl/Cmd + R)
-
Check Asset Paths:
// Use relative paths from Assets folder "Assets/Materials/MyMaterial.mat" // โ Correct "/Users/name/Project/Assets/..." // โ Incorrect
-
Asset Import Issues:
- Check Console for import errors
- Reimport problematic assets
Symptoms: Server exits immediately or shows error messages
Solutions:
-
Check Port Availability:
# Find what's using port 8080 lsof -i :8080 # macOS/Linux netstat -ano | findstr :8080 # Windows # Use different port unity-mcp-server --port 8081
-
Check Logs:
# Docker logs docker logs unity-mcp-server # .NET tool logs unity-mcp-server --log-level debug
-
Permission Issues:
# Ensure user can bind to port # Ports < 1024 require root on Linux/macOS unity-mcp-server --port 8080 # Regular user sudo unity-mcp-server --port 80 # Root required
Symptoms: Container starts but immediately exits
Solutions:
# Check container status
docker ps -a
# View container logs
docker logs unity-mcp-server
# Run container interactively for debugging
docker run -it --rm -p 8080:8080 ivanmurzakdev/unity-mcp-server:latest /bin/bash
# Check resource limits
docker stats unity-mcp-serverSymptoms: Server consuming excessive resources
Solutions:
-
Monitor Resource Usage:
# System monitoring htop # Linux/macOS # Docker monitoring docker stats unity-mcp-server
-
Optimize Configuration:
# Reduce concurrent connections unity-mcp-server --max-connections 5 # Increase timeouts to reduce retries unity-mcp-server --plugin-timeout 15000
-
Memory Leaks:
- Restart server periodically
- Monitor for increasing memory usage over time
- Check for long-running operations
Symptoms: Server stops responding to requests
Solutions:
-
Health Check:
# Test server health curl -f http://localhost:8080/health # Force restart if unresponsive docker restart unity-mcp-server
-
Check Logs for Errors:
# Look for error patterns docker logs unity-mcp-server | grep -i error # Check for deadlocks or timeouts docker logs unity-mcp-server | grep -i timeout
Symptoms: AI responds "I don't have access to Unity tools"
Solutions:
-
Verify MCP Connection:
- Check AI client shows MCP server as connected
- Look for Unity-MCP in available tools list
-
Check Server Status:
# Verify server is responding curl -f http://localhost:8080/mcp/tools -
Restart AI Client:
- Completely close and restart Claude Desktop/VS Code
- Wait for MCP connection to establish
Symptoms: AI tries to use tools that don't exist
Solutions:
-
Refresh Tool List:
- Restart AI client
- Ask AI: "What Unity tools do you currently have access to?"
-
Check Server Version:
# Update to latest server version docker pull ivanmurzakdev/unity-mcp-server:latest dotnet tool update -g Unity.MCP.Server
Symptoms: AI tools consistently fail with error messages
Solutions:
-
Check Unity Console for detailed error messages
-
Verify Unity State:
- Ensure Unity Editor is in correct mode (Edit vs Play)
- Check if scene is properly loaded
- Verify required objects exist
-
Test Tool Manually:
// Test in Unity Console window var tool = new Unity.MCP.Tools.GameObjectTool(); var result = tool.CreateGameObject("Test", Vector3.zero); Debug.Log(result);
Symptoms: Some parts of commands work, others fail
Solutions:
-
Break Down Complex Commands:
- Ask AI to perform one operation at a time
- Example: Create objects first, then modify them
-
Check Operation Order:
- Some operations depend on others completing first
- Ask AI to wait between operations
// Enable verbose logging in Unity
Unity.MCP.Plugin.McpPluginSettings.Instance.VerboseLogging = true;
// Or via settings UI
// Window โ Unity MCP โ Settings โ Enable Debug Logging# Enable debug logging
unity-mcp-server --log-level debug
# Docker with debug logging
docker run -p 8080:8080 -e UNITY_MCP_LOG_LEVEL=debug ivanmurzakdev/unity-mcp-server:latest# Monitor HTTP traffic
tcpdump -i lo port 8080
# Or use Wireshark for detailed analysis
# Filter: tcp.port == 8080# Test server health endpoint
curl -v http://localhost:8080/health
# Test MCP tools endpoint
curl -v http://localhost:8080/mcp/tools
# Test specific tool (requires proper MCP format)
curl -X POST http://localhost:8080/mcp/call \
-H "Content-Type: application/json" \
-d '{"method": "tools/call", "params": {...}}'[UnityTest]
public IEnumerator TestMcpConnection()
{
// Test basic connection
var isConnected = Unity.MCP.Plugin.McpClient.Instance.IsConnected;
Assert.IsTrue(isConnected, "MCP Client should be connected");
yield return null;
}
[UnityTest]
public IEnumerator TestToolExecution()
{
// Test tool execution
var tool = new Unity.MCP.Tools.GameObjectTool();
var result = tool.CreateGameObject("TestObject", Vector3.zero);
Assert.IsTrue(result.Contains("Success"), $"Tool execution failed: {result}");
var testObject = GameObject.Find("TestObject");
Assert.IsNotNull(testObject, "Created object should exist");
yield return null;
}Cause: Server not running or wrong port configuration Solution: Start server and verify port matches Unity plugin settings
Cause: Operation takes longer than configured timeout Solution: Increase timeout in Unity MCP settings or server configuration
Cause: Referenced GameObject doesn't exist or was destroyed Solution: Verify object exists and use correct name/ID
Cause: Another process is using port 8080 Solution:
# Find and kill process using port
lsof -ti:8080 | xargs kill -9
# Or use different port
unity-mcp-server --port 8081Cause: Unity Editor not responding or not running Solution: Ensure Unity Editor is running and plugin is properly installed
Cause: Server crashed or network connectivity issues Solution: Check server status and restart if necessary
Cause: Tool doesn't exist or server not properly connected Solution: Verify server connection and tool availability
- Check This Guide for your specific issue
- Search Existing Issues on GitHub
-
Collect Debug Information:
- Unity version
- Unity-MCP plugin version
- Server version and deployment method
- Operating system
- Complete error messages
- Steps to reproduce
- GitHub Issues: Report bugs and request features
- Discussions: Community Q&A
- Documentation: Complete documentation
**Unity-MCP Version**: [e.g., 1.0.0]
**Unity Version**: [e.g., 2023.2.5f1]
**Operating System**: [e.g., Windows 11, macOS 13.0, Ubuntu 22.04]
**Deployment**: [e.g., Docker, .NET Tool, Local Build]
**Expected Behavior**:
[What you expected to happen]
**Actual Behavior**:
[What actually happened]
**Steps to Reproduce**:
1. [First step]
2. [Second step]
3. [And so on...]
**Error Messages**:[Paste complete error messages here]
**Additional Context**:
[Any other relevant information]
If nothing else works, try a complete reset:
-
Stop All Services:
# Stop server docker stop unity-mcp-server # Or kill .NET process pkill -f unity-mcp-server
-
Clean Unity:
- Close Unity Editor
- Delete
Library/folder in project - Restart Unity Editor
-
Clean Server:
# Remove Docker containers docker rm -f unity-mcp-server # Pull fresh image docker pull ivanmurzakdev/unity-mcp-server:latest # Or reinstall .NET tool dotnet tool uninstall -g Unity.MCP.Server dotnet tool install -g Unity.MCP.Server
-
Restart Everything:
- Start server
- Open Unity project
- Connect AI client
- Test basic functionality
Still having issues? Create a detailed bug report on our GitHub Issues page with the information template above. The community and maintainers are here to help!