# Unity MCP Bridge
MCP Bridge server that connects Claude Code to Unity Editor.
## Requirements
- Node.js 18+ (for native fetch API support)
- Unity MCP Server package installed in your Unity project
## Quick Setup
### Option 1: Automatic Setup (Recommended)
1. Open Unity Editor with the MCP Server package installed
2. Go to **Window > Unity MCP > Setup Claude Code**
3. Click **Generate Configuration**
4. Restart Claude Code
### Option 2: Manual Setup
1. Install dependencies:
```bash
cd Server~/mcp-bridge
npm install
```
2. Add to your Claude Code configuration (`~/.claude/settings.json` or `.mcp.json`):
```json
{
"mcpServers": {
"unity": {
"command": "node",
"args": ["/path/to/Server~/mcp-bridge/index.js"],
"cwd": "/path/to/your/unity/project"
}
}
}
```
3. Start Unity Editor and Claude Code
## Configuration Files
The bridge reads configuration from:
1. `.unity-mcp-runtime.json` - Auto-generated by Unity, contains HTTP port
2. Environment variables:
- `UNITY_HTTP_URL` - Unity HTTP server URL (default: `http://localhost:5051`)
- `MCP_VERBOSE` - Set to `true` for verbose logging
## Troubleshooting
### Connection Issues
1. Ensure Unity Editor is running
2. Check Unity Console for MCP Server status
3. Verify `.unity-mcp-runtime.json` exists in your project root
4. Set `MCP_VERBOSE=true` for detailed logs
### Node.js Version
This bridge requires Node.js 18+ for native fetch API support.
Check your version with: `node --version`