Unity MCP Bridge
Connects AI assistants to the Unity Editor to read console logs and compilation errors, control Play Mode, capture Game/Scene screenshots, navigate assets, inspect hierarchies, and execute runtime debug terminal commands.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
Unity MCP Bridge enables AI assistants like Claude in Cursor to interact directly with Unity Editor. Read console logs, check compilation errors, control Play Mode, capture screenshots, navigate assets, and more — all without leaving your code editor.
Features
Console Logs — Real-time access to Unity console with filtering by type (log/warning/error)
Compilation Errors — Instant notification of C# compilation errors and warnings with file paths and line numbers
Play Mode Control — Start, stop, and pause Play Mode remotely
Screenshots — Capture Game View and Scene View with configurable quality (low/medium/high)
Asset Navigation — Open prefabs, scenes, and scripts; select and frame objects in the hierarchy
Hierarchy Inspection — View the full GameObject hierarchy of scenes and prefabs
Asset Refresh — Trigger asset database refresh after code changes
Debug Terminal — In-game IMGUI debug console with 20+ built-in commands, custom command support, argument autocomplete, watch expressions, and clipboard support
Background Operation — Works even when Unity is not in focus (for most operations)
Easy Setup — Simple installation via Unity Package Manager
Related MCP server: Agent Bridge for Unity
Requirements
Unity 6000.0 (Unity 6) or later
Node.js 18+ (for MCP server)
Cursor IDE with MCP support (or any MCP-compatible client)
Installation
Step 1: Install Unity Package
Option A: Install via Package Manager (Recommended)
In Unity, go to Window > Package Manager
Click + in the top-left corner
Select Add package from git URL...
Enter:
https://github.com/Nexonium/unity-mcp-bridge.gitClick Add
To install a specific version, append the tag:
https://github.com/Nexonium/unity-mcp-bridge.git#v1.2.0-pre.1Option B: Add to manifest.json
Add to your Packages/manifest.json:
{
"dependencies": {
"com.nexonium.unity-mcp-bridge": "https://github.com/Nexonium/unity-mcp-bridge.git#v1.2.0-pre.1"
}
}Option C: Download and Install Locally
Download or clone this repository
In Unity, go to Window > Package Manager
Click + > Add package from disk...
Navigate to the downloaded folder and select
package.json
Step 2: Build MCP Server
cd mcp-server
npm install
npm run buildStep 3: Configure Cursor
Add to your Cursor MCP settings file:
Windows: %USERPROFILE%\.cursor\mcp.json
macOS/Linux: ~/.cursor/mcp.json
{
"mcpServers": {
"unity": {
"command": "node",
"args": ["C:/path/to/unity-mcp-bridge/mcp-server/dist/index.js"]
}
}
}Note: Use forward slashes
/in paths, even on Windows.
Step 4: Start the Server
In Unity, go to Window > Unity MCP Bridge > Server
Click Start Server
(Optional) Enable Auto-start on Unity Open for convenience
Restart Cursor to load the MCP server
Usage
Once configured, the AI assistant in Cursor can use Unity tools automatically. Try asking:
"Check if there are any compilation errors"
"Show me the recent Unity console logs"
"Start Play Mode and take a screenshot"
"Open the Player prefab and show me its hierarchy"
"Take a screenshot of the Scene View"
"Execute 'obj.find Player' in the debug terminal"
"Run 'mem' in the terminal to check memory usage"
Example Workflows
Debugging workflow:
You edit a C# file in Cursor
Ask: "Are there any compilation errors?"
AI runs
unity_refreshthenunity_get_compilation_errorsAI shows you errors with file paths and line numbers
You fix the error, AI verifies compilation succeeds
Visual inspection workflow:
Ask: "Open the MessengerNotification prefab"
AI runs
unity_open_assetto enter Prefab ModeAI runs
unity_get_hierarchyto see the structureAI runs
unity_frame_selectedandunity_screenshotto capture the viewAI describes what it sees and suggests improvements
Available Tools
Editor Status
Tool | Description |
| Get Unity Editor status (version, project, play mode state) |
| Check if Unity is compiling and error/warning counts |
Console Logs
Tool | Description |
| Get console logs with optional type filter and limit |
| Clear all stored console logs |
| Get compilation errors with file paths and line numbers |
| Get compilation warnings |
Play Mode
Tool | Description |
| Enter Play Mode |
| Exit Play Mode |
| Toggle pause state |
| Refresh Asset Database (triggers recompilation) |
Screenshots
Tool | Description |
| Capture Game View or Scene View with configurable quality |
Parameters:
view—"game"(default) or"scene"quality—"low"(640x480, ~500 tokens),"medium"(1280x720, ~1200 tokens),"high"(native, ~2700+ tokens)
Asset Navigation
Tool | Description |
| Open prefab, scene, or script by asset path |
| Select a GameObject by hierarchy path or name |
| Frame selected object in Scene View (like pressing F) |
| Get the full hierarchy of objects in the current scene or prefab |
Debug Terminal
Tool | Description |
| Execute a command in the runtime debug terminal (requires Play Mode) |
| Get terminal status (active, visible, command count) |
| Get terminal log entries with optional type/count filters |
| Get command history |
| Execute multiple commands sequentially |
Debug Terminal
The Debug Terminal is an in-game IMGUI console for runtime debugging. Press ~ (backtick) to toggle.
Built-in Commands
Command | Description |
| List commands or show help for a specific command |
| Clear terminal output |
| Show/load scenes |
| Show current FPS |
| Detailed memory usage (managed heap, allocations, GC stats) |
| System info (CPU, GPU, RAM, resolution, quality) |
| Force garbage collection |
| Get/set time scale |
| Find a GameObject |
| Inspect components |
| Toggle active state |
| Get component property (e.g., |
| Set component property |
| List component members |
| Add a live watch expression |
| Remove watch expressions |
| Toggle debug visualization flags |
| Create/list command aliases |
| Toggle Unity log capture |
Terminal Features
Tab Completion for commands and arguments (GameObject names, scenes, components, aliases)
Command History with Up/Down arrows (persisted across sessions)
Clipboard support (Ctrl+C / Ctrl+V)
Ctrl+Backspace to delete word backward
PageUp/PageDown scrolling
Watch Panel displays live-updating values below the terminal
Command Aliases with persistence (e.g.,
alias p obj.find Player)
Custom Commands
Add game-specific commands using the [TerminalCommand] attribute:
using UnityMCPBridge.Terminal;
public static class MyCommands
{
[TerminalCommand("hp", "Set player health", "hp [value]",
CompleterMethod = "GameObjectNames")]
public static string SetHealth(string[] args)
{
// Your game logic here
return "Done";
}
}Commands are auto-discovered via reflection. See CONTRIBUTING.md for full details.
Configuration
Unity Settings (Window > Unity MCP Bridge > Server)
Setting | Default | Description |
Port | 7890 | HTTP server port |
Max Log Entries | 500 | Maximum log entries kept in memory |
Auto-start | false | Start server automatically when Unity opens |
Include Stack Traces | true | Include stack traces in log entries |
Include Warnings | true | Track compilation warnings (not just errors) |
Screenshot Quality | Low | Default screenshot quality (Low / Medium / High) |
Screenshot Cleanup | 30 min | Auto-delete screenshots older than this (0 = disabled) |
Environment Variables (MCP Server)
Variable | Default | Description |
| 127.0.0.1 | Unity HTTP server host |
| 7890 | Unity HTTP server port |
| 5000 | Request timeout in milliseconds |
Architecture
+-------------------+ +-------------------+
| Cursor |<--- MCP Protocol ------->| MCP Server |
| (AI Agent) | (stdio) | (Node.js) |
+-------------------+ +---------+---------+
|
HTTP REST
|
+---------+---------+
| Unity Editor |
| (HTTP Server) |
| Port 7890 |
+-------------------+Request flow:
AI sends tool call via MCP protocol (stdio)
MCP Server (TypeScript) translates to HTTP request
Unity HTTP Server receives on background thread
Read-only requests handled directly; actions queued for main thread
Response flows back through the same path
Troubleshooting
"Cannot connect to Unity"
Make sure Unity Editor is open
Check that MCP Bridge server is running (Window > Unity MCP Bridge > Server)
Verify the port matches in both Unity and MCP server config
"Request timeout"
Unity might be busy (compiling, loading assets)
Try clicking in Unity window to "wake it up"
Increase
UNITY_TIMEOUTenvironment variable for slow operations
Port already in use
Change the port in Unity MCP Bridge settings
Update
UNITY_PORTin your MCP server config or environment
Server stops after code changes
This is expected — Unity recompiles and reloads the domain. If Auto-start is enabled, the server restarts automatically.
Screenshots are empty or wrong
Make sure a Camera exists in the scene (Game View requires a camera)
For Scene View screenshots, ensure the Scene View window is open
Try using
unity_frame_selectedto position the camera before capturing
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
Fork the repository
Create your feature branch (
git checkout -b feature/amazing-feature)Commit your changes (
git commit -m 'Add some amazing feature')Push to the branch (
git push origin feature/amazing-feature)Open a Pull Request
Support
If you find this project useful, consider supporting its development:
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Your org's AI agents, tasks, runs, search, and brain files as MCP tools and resources.
Remote MCP access to user-authorized Linux, Windows and Intel Mac devices for AI assistants.
Use AI models for chat, image, and video generation from Claude Code and other MCP hosts.
Shared memory for your AI tools: tasks, notes and context every tool can read and write over MCP.
Related MCP Servers
- AlicenseNot gradedqualityNot gradedmaintenanceEnables AI assistants to interact with Unity Editor through the Model Context Protocol, allowing natural language control of Unity projects including scene manipulation, GameObject creation, component updates, package management, and test execution.-
- AlicenseNot gradedqualityDmaintenanceEnables AI agents to control the Unity Editor through MCP, allowing scene building, runtime scripting, visual QA, and more.5Apache 2.0
- AlicenseNot gradedqualityBmaintenanceEnables AI assistants to control the Unity Editor via MCP, allowing scene manipulation, asset management, compilation, and testing through natural language.MIT
- AlicenseNot gradedqualityDmaintenanceEnables AI agents to access Unity Editor project information, scene hierarchies, object inspection, selection state, and console logs through MCP.MIT