Content
# Unity MCP Trae Project
A comprehensive Unity Editor automation solution implementing the Model Context Protocol (MCP) for AI-powered development workflows.
## 🚀 Overview
This project provides a complete MCP server implementation for Unity Editor, enabling AI assistants (especially Trae AI) to control Unity through a standardized API. The project includes both the Unity package and supporting tools for testing and development.
## 📁 Project Structure
```
unity-mcp-trae/
├── unity-ai-mcp-trae/ # Main Unity package (ready for Asset Store)
│ ├── Documentation/ # API reference and guides
│ ├── Editor/ # Core MCP server implementation
│ ├── Runtime/ # Runtime components
│ ├── Tools/ # 64+ Unity automation tools
│ ├── Samples~/ # Example scenes and scripts
│ └── package.json # Unity package configuration
├── McpDesktopClient/ # Desktop testing client
├── Documentation/ # Project-wide documentation
├── Tests/ # Test suites
└── unity-ai-mcp-trae-v1.9.95.tar.gz # Ready-to-upload package
```
## ✨ Key Features
### Unity MCP Package (`unity-ai-mcp-trae/`)
- **64+ Automation Tools**: Complete coverage of Unity Editor functionality
- **MCP Protocol**: Standard JSON-RPC API for AI integration
- **Trae AI Optimized**: Specially designed for Trae AI workflows
- **Thread-Safe**: Proper Unity main thread handling
- **Comprehensive Documentation**: API reference, quick start guide, examples
- **Asset Store Ready**: Complete with LICENSE, third-party notices, samples
### Desktop Client (`McpDesktopClient/`)
- **Testing Interface**: GUI for testing MCP server functionality
- **Preset Management**: Pre-configured test scenarios
- **Real-time Logging**: Monitor MCP communication
- **Sample Data**: Example requests and responses
## 🛠 Tool Categories
The Unity package includes 64+ tools across 16 categories:
| Category | Count | Examples |
|----------|-------|----------|
| **Scene Management** | 3 | List, open, load scenes |
| **Play Mode** | 3 | Start, stop, status |
| **GameObjects** | 7 | Create, find, delete, transform |
| **Components** | 5 | Add, remove, configure |
| **Materials** | 4 | Create, configure, assign |
| **Physics** | 4 | Rigidbody, colliders, forces |
| **Audio** | 3 | Play, stop, configure |
| **Lighting** | 2 | Create, configure lights |
| **Scripts** | 4 | Create, modify, compile |
| **UI System** | 4 | Canvas, elements, events |
| **Animation** | 5 | Animator, clips, playback |
| **Input** | 4 | Actions, events, simulation |
| **Particles** | 4 | Systems, effects, properties |
| **Assets** | 1 | Import assets |
| **Logging** | 3 | Get, clear, stats |
| **Debug** | 2 | Scene info, stack traces |
## 🚀 Quick Start
### For Unity Developers
1. **Install the Package**:
- Extract `unity-ai-mcp-trae-v1.9.95.tar.gz`
- Import into Unity via Package Manager
- Or install from Asset Store (when published)
2. **Start MCP Server**:
- Open **Tools > CLH-MCP > MCP Server**
- Click **Start Server**
- Server runs on `http://localhost:8080/mcp`
3. **Configure Trae AI**:
- Click **推送到Trae AI** in MCP Server window
- Restart Trae AI to apply configuration
### For Developers/Testers
1. **Run Desktop Client**:
```bash
cd McpDesktopClient
dotnet run
```
2. **Test MCP Server**:
- Use preset test scenarios
- Monitor real-time communication
- Validate tool responses
## 📖 Documentation
### Unity Package Documentation
- **[API Reference](unity-ai-mcp-trae/Documentation/API_Reference.md)**: Complete tool documentation
- **[Quick Start Guide](unity-ai-mcp-trae/Documentation/Quick_Start_Guide.md)**: Getting started tutorial
- **[README](unity-ai-mcp-trae/README.md)**: Package-specific information
### Project Documentation
- **[Thread Stack Info Guide](THREAD_STACK_INFO_GUIDE.md)**: Threading implementation details
- **[Validation Tools](VALIDATION_AND_ERROR_DETECTION_TOOLS.md)**: Error handling and validation
- **[Async Play Mode](unity-ai-mcp-trae/ASYNC_PLAY_MODE.md)**: Play mode automation
- **[Logging Guide](unity-ai-mcp-trae/LOGGING_GUIDE.md)**: Debugging and monitoring
## 🔧 System Requirements
### Unity Package
- **Unity**: 2023.2 or later
- **Platform**: Windows, macOS, Linux
- **Dependencies**: None (self-contained)
### Desktop Client
- **.NET**: 6.0 or later
- **Platform**: Windows (primary), cross-platform compatible
## 🤖 AI Integration
### Supported AI Assistants
- **Trae AI**: Primary target with optimized configuration
- **Any MCP Client**: Standard JSON-RPC protocol support
### Example AI Commands
- "Create a player character with Rigidbody and Collider"
- "Set up a basic scene with lighting"
- "Create a UI canvas with buttons"
- "Import and configure materials"
- "Set up particle effects"
## 🔒 Security
- **Local Only**: Server binds to localhost only
- **No External Dependencies**: Self-contained implementation
- **Safe Operations**: All operations run within Unity Editor context
- **Permission Control**: Tool-level enable/disable configuration
## 📦 Asset Store Package
The `unity-ai-mcp-trae-v1.9.95.tar.gz` file contains the complete Unity package ready for Asset Store submission:
- ✅ All required documentation
- ✅ MIT License and third-party notices
- ✅ Example scenes and scripts
- ✅ Comprehensive API documentation
- ✅ Proper Unity package structure
## 🛠 Development
### Building
1. Make changes to `unity-ai-mcp-trae/` directory
2. Update version in `package.json`
3. Update `CHANGELOG.md`
4. Test with desktop client
5. Package for distribution
### Testing
1. Use **Tools > CLH-MCP > MCP Test Window** in Unity
2. Run desktop client for comprehensive testing
3. Verify compatibility with **Tools > CLH-MCP > 验证Unity 2023.2兼容性**
## 📄 License
MIT License - see [LICENSE](unity-ai-mcp-trae/LICENSE) for details.
## 🤝 Contributing
This project is designed for AI-powered Unity development. Contributions should focus on:
- Additional Unity automation tools
- Improved AI integration
- Enhanced documentation
- Better error handling
## 📞 Support
- Check Unity Console for error messages
- Review documentation in respective folders
- Use built-in compatibility and test tools
- Refer to troubleshooting sections in guides
---
**Transform your Unity development with AI automation!** 🚀🤖
Connection Info
You Might Also Like
everything-claude-code
Complete Claude Code configuration collection - agents, skills, hooks,...
markitdown
MarkItDown-MCP is a lightweight server for converting URIs to Markdown.
cc-switch
All-in-One Assistant for Claude Code, Codex & Gemini CLI across platforms.
servers
Model Context Protocol Servers
servers
Model Context Protocol Servers
Time
A Model Context Protocol server for time and timezone conversions.