Integrations
Supports containerized deployment of the MCP server, allowing the Unity tools to be run in an isolated environment with proper project mounting.
Offers integration through the repository hosting, with the server code available at a GitHub repository (unity-smithery-mcp).
Built on Node.js as a runtime environment, requiring Node.js 16+ to operate.
Unity MCP Server
A Model Context Protocol (MCP) server for Unity game development, enabling AI assistants to interact with Unity projects through a set of specialized tools.
Overview
The Unity MCP Server provides a bridge between AI assistants (like Cursor AI or Claude) and Unity projects. It offers tools for:
- Reading and searching files in Unity projects
- Parsing Unity scenes and prefabs
- Analyzing C# code and detecting errors
- Running automated tests in batch mode
- Generating scripts from templates
- Validating shaders
- And more...
The server is designed to run with Unity in batch mode, allowing for operations that require the Unity engine without needing the Editor GUI.
Installation
Prerequisites
- Node.js 16+
- Unity 2022.3 LTS or newer (recommended)
Setup
- Clone this repository:Copy
- Install dependencies:Copy
- Build the project:Copy
Configuration
The server uses the config
package for configuration. Edit config/default.json
to adjust settings:
Usage
Starting the Server
To run in Smithery mode:
Using with AI Assistants
This server is primarily designed to work with AI assistants through tools defined in the MCP specification. For Cursor or Smithery.ai integration, follow their documentation to connect to this MCP server.
Available Tools
Tool Name | Description |
---|---|
open_file | Reads the contents of a file in the Unity project |
search_files | Searches for text patterns in project files |
list_assets | Lists project assets of a certain type or in a folder |
get_project_info | Gets high-level information about the Unity project |
parse_scene | Parses a Unity scene file to extract game objects hierarchy |
parse_prefab | Parses a Unity prefab file to extract components |
find_in_scenes | Finds scenes containing a specific GameObject or component |
analyze_cs_code | Compiles C# code to find compiler errors |
find_references | Finds references to a C# class or method |
generate_script | Creates a new C# script file from a template |
validate_shader | Compiles a shader and reports errors |
inspect_yaml | Inspects a YAML asset file |
run_tests | Runs Unity's automated tests in batch mode |
simulate_playmode | Experimental - runs a scene in play mode for a short duration |
Docker Support
A Dockerfile is included for containerized deployment. Build the Docker image:
Run the container:
Smithery.ai Integration
This server can be deployed on Smithery.ai using the provided smithery.yaml
configuration.
License
MIT
Contributing
Contributions are welcome! Please open an issue or submit a pull request.
This server cannot be installed
A protocol server that bridges AI assistants with Unity projects, allowing them to analyze code, parse scenes, generate scripts, and perform other Unity operations through specialized tools.
Related MCP Servers
- AsecurityFlicenseAqualityA Model Context Protocol server that connects Claude and other AI assistants to your Notion workspace, allowing AIs to interact with databases, pages, and blocks.Last updated -12647JavaScript
- -securityFlicense-qualityA Model Context Protocol server that enables AI assistants like Claude to perform Python development tasks through file operations, code analysis, project management, and safe code execution.Last updated -1Python
- -securityAlicense-qualityA Unity Master Control Protocol implementation that allows AI agents to control and interact with Unity, enabling them to execute code, query editor state, modify GameObjects, and capture screenshots through a WebSocket-based communication system.Last updated -7MIT License
- -securityAlicense-qualityA server that enables AI assistants to understand and interact with Unity projects in real-time, providing access to scene hierarchy, project settings, and the ability to execute code directly in the Unity Editor.Last updated -40MIT License