Content
# Cocos MCP Log Bridge
A powerful log bridging tool for synchronizing log information between the Cocos Creator editor and Cursor AI, helping developers analyze and resolve issues more effectively.
[](https://github.com/czh2774/cocosMCP/stargazers)
[](https://github.com/czh2774/cocosMCP/blob/main/LICENSE)


## 🌟 Features
- **Real-time log synchronization**: Get the latest logs directly from the Cocos Creator editor
- **Smart filtering**: Supports filtering by type (normal logs, warnings, errors)
- **Keyword search**: Precisely locate specific issues
- **One-click clear**: Clear logs anytime to reduce distractions
- **Scene information**: Obtain basic information and node lists of the current scene
- **Scene operations**: Supports basic operations like opening scenes
- **TCP communication bridge**: A stable and reliable communication mechanism
- **Cursor AI integration**: Fully compatible with the Cursor MCP protocol
## 🚀 Quick Start
### Prerequisites
- Cocos Creator 3.8.0 or higher
- Python 3.7 or higher
- uv package manager (recommended) or pip
### Installation Steps
1. **Clone the repository**
```bash
git clone https://github.com/czh2774/cocosMCP.git
```
2. **Copy to Cocos Creator project**
Copy the cloned `cocosMCP` directory to the `extensions` directory of your Cocos Creator project.
3. **Install Python dependencies**
```bash
cd your-project/extensions/cocosMCP/Python
uv pip install -r requirements.txt
```
4. **Enable the extension in Cocos Creator**
Launch Cocos Creator, go to `Extensions -> Extension Manager`, and ensure the `cocosMCP` extension is enabled.
5. **Configure Cursor AI**
In the Cursor AI settings, configure the MCP server to point to the Python server script.
### Basic Usage
```python
# Query logs
logs = await mcp.query_logs({
"show_logs": True,
"show_warnings": True,
"show_errors": True
})
# Clear logs
await mcp.clear_logs()
# Check connection status
status = await mcp.connection_status()
# Get scene information
scene_info = await mcp.get_scene_info()
# List all nodes in the scene
nodes = await mcp.list_scene_nodes()
# Open the scene with the specified UUID
await mcp.open_scene("scene-uuid-here")
```
## 📚 Detailed Documentation
This project includes three detailed documents:
- [User Guide](USAGE.md): Installation, configuration, and usage methods
- [Developer Guide](DEVELOPMENT.md): Code structure, extension features, and maintenance instructions
- [Troubleshooting](TROUBLESHOOTING.md): Common issues and solutions
## 🔧 Technical Architecture
Cocos MCP consists of three main parts:
1. **Cocos Creator Extension**: Editor extension written in TypeScript
2. **TCP Communication Bridge**: Connects the editor and the Python server
3. **Python MCP Server**: Handles requests from Cursor AI

## 🤝 Contribution Guidelines
Contributions of code, issue reporting, or feature suggestions are welcome! Please refer to the [Developer Guide](DEVELOPMENT.md) for details.
## 📄 License
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
## 🙏 Acknowledgments
- The excellent game engine provided by the Cocos Creator team
- The intelligent programming assistant developed by the Cursor AI team
- The support and feedback from all contributors and users
---
If you have any questions or suggestions, please submit an [Issue](https://github.com/czh2774/cocosMCP/issues).