Create your Unity apps with LLMs!
Unity MCP Bridge connects Unity with AI assistants through the Model Context Protocol (MCP), enabling you to create Unity applications using natural language commands.
Unity MCP Bridge uses a three-component architecture to connect AI assistants with Unity:
[AI Assistant (Cursor/Claude)] ββ [Unity MCP Server (Python)] ββ [Unity MCP Bridge (Unity Package)]
-
AI Assistant (Cursor, Claude Desktop, etc.)
- Sends natural language commands
- Receives tool responses and Unity data
- Manages conversation context
-
Unity MCP Server (Python)
- Translates MCP protocol to Unity commands
- Manages tool execution and responses
- Handles communication between AI and Unity
-
Unity MCP Bridge (Unity Package)
- Executes Unity operations (create objects, manage assets, etc.)
- Provides real-time Unity data and status
- Manages Unity Editor state
- Command Flow: AI Assistant β MCP Server β Unity Bridge β Unity Editor
- Response Flow: Unity Editor β Unity Bridge β MCP Server β AI Assistant
- Real-time Updates: Unity state changes are automatically reported back
When you ask an AI to "create a red cube", the system:
- Parses the natural language request
- Maps it to appropriate Unity MCP tools
- Executes the commands in Unity
- Reports back the results and any errors
π See GitHub Setup Guide for detailed instructions.
π See GitHub Setup Guide for detailed instructions.
- Open Unity Hub β Create new 3D project
- Window β Package Manager β + β Add package from git URL
- Enter:
https://github.com/praxilabs/unity-mcp.git?path=/UnityMcpBridge
- Go to Window β Unity MCP β Installation Manager
- Click the Install Server button
- Install Cursor or Claude Desktop
- Unity β Window β Unity MCP β Auto Configure
- Verify green status indicator π’
- Try generating any logic using Unity MCP Bridges available tools you can find tools in the "π οΈ Overview on Tools" section, for a more detailed look go to Tool Reference .
- π For system architecture details, see System Explanation .
The Unity MCP Bridge includes a comprehensive Cursor Rules framework that provides AI assistants with specialized knowledge for Unity development tasks.
Cursor Rules are .mdc files that contain domain-specific knowledge and guidelines for AI assistants. They help the AI understand:
- Unity-specific workflows and best practices
- Graph logic patterns for XNode-based experiments
- Tool usage guidelines and common scenarios
- Error handling and troubleshooting approaches
core.mdc- Fundamental Unity MCP concepts and patternsconcise.mdc- Guidelines for clear, minimal documentationrequest.mdc- How to handle user requests effectivelyretro.mdc- Retrospective analysis and improvement patterns
- Control Flow - Managing sequence execution and branching
- Click Nodes - Mouse interaction and UI element handling
- Camera Nodes - Camera positioning and movement logic
- UI Nodes - Popup messages, MCQs, and interface elements
- Loop Nodes - Iteration and conditional execution
- Progress Nodes - Experiment progression tracking
- Table Nodes - Data management and record keeping
- Tool Nodes - Collider toggling and utility operations
- Utility Nodes - Delays, freezing, and system utilities
- Misc Nodes - Animation and other specialized operations
- Automatic Application: Rules are automatically applied when using Cursor IDE with this project
- Context-Aware Suggestions: AI will suggest appropriate tools and patterns based on your request
- Best Practice Guidance: Rules ensure consistent, high-quality Unity development workflows
- Error Prevention: Built-in guidelines help avoid common Unity development pitfalls
When you need to request new features, refactoring, or changes:
- Structured Approach: Follows a 5-phase protocol from reconnaissance to final verification
- System-Wide Analysis: Ensures all dependencies and impacts are considered
- Zero-Trust Audit: Mandatory self-audit to prevent regressions
- Evidence-Based: Requires empirical verification of all changes
After completing work, use this to:
- Analyze Performance: Review the entire session for successes and failures
- Distill Lessons: Extract durable, universal principles from the interaction
- Update Doctrine: Integrate learnings into the AI's operational rules
- Continuous Improvement: Evolve the AI's capabilities based on real experiences
For persistent bugs or issues:
- Deep Diagnostics: Systematic investigation beyond surface-level fixes
- Root Cause Focus: Identifies the absolute underlying cause, not just symptoms
- Reproducible Testing: Creates minimal test cases to verify fixes
- Regression Prevention: Ensures fixes don't introduce new problems
When you ask the AI to "create a click sequence that shows a popup", the rules framework will:
- Suggest appropriate ClickStep and UINodes
- Guide you through proper Control Flow setup
- Recommend Progress tracking for experiment management
- Ensure proper Error handling and validation
There are multiple strategies to prompt a better prompt to the AI Model we are going to discuss some of them that are effective on test.
- Q & A Strategy: using the "Before you continue ask me about relevant questions about any think that is not clear, or should be more clearer" prompt design for example.
@request.mdc
i want you to create an experiment about 1, 2, 3 and 4
the steps are A, B, C and D.
before you continue to create the experiment ask me about any relevant questions to the experiment that will help you making a better experiment
ask me about any unclear terminology or any confusing steps that needs more explaination.-
Pros & Cons Strategy: if you are trying to compare between two things and want the model to specify which is better, you want him to list the pros and cons for each thing. then the ai will get biased towards the better solution according to the pros and cons it listed.
-
Role Prompt Strategy: it involves putting the model in a role and make it act upon for example
"you are a bounty hunter and an ethical hacker, review my app to identify any security vulnerabilities".- Rules are located in
CursorRules/rules/directory - Each
.mdcfile contains specific domain knowledge - Modify rules to match your project's specific requirements
- Rules follow markdown format with clear sections and examples
- XNode Node Management - Create, list, delete, and position nodes in XNode graphs
- Node Parameter Management - Set, get, and list node parameters
- Node Connection Tools - Create connections between nodes in XNode graphs
- Registry Management - List registry items and discover components
- Utility Tools - System verification and basic asset creation
- Unity: 2022.3 LTS or newer
- Python: 3.12 or newer
- Operating System: Windows 10+, macOS 10.15+, or Linux
- Memory: 8GB RAM minimum, 16GB recommended
- MCP Client: Cursor IDE, Claude Desktop, or compatible client
- Unity Bridge Not Connecting: Ensure Unity Editor is open and package is installed
- MCP Client Not Connecting: Check server configuration and ports
- Submodule Issues: See GitHub Setup Guide
- Tool Reference - Complete tool documentation
- System Explanation - Detailed system architecture and components
- GitHub Setup - Repository and submodule setup
MIT License. See LICENSE file.