# Unity MCP Server
[](https://modelcontextprotocol.io/introduction)
[](https://openupm.com/packages/com.ivanmurzak.unity.mcp/)
[](https://hub.docker.com/r/ivanmurzakdev/unity-mcp-server)
[](https://unity.com/releases/editor/archive)
[](https://unity.com/releases/editor/archive)
[](https://github.com/IvanMurzak/Unity-MCP/actions/workflows/release.yml)</br>
[](https://discord.gg/cfbdMZX99G)
[](https://github.com/IvanMurzak/Unity-MCP/stargazers)
[](https://github.com/IvanMurzak/Unity-MCP/blob/main/LICENSE)
[](https://stand-with-ukraine.pp.ua)
The **MCP Server** acts as the bridge between the **AI Client** (Claude, Cursor, etc.) and the **Unity Editor/Game**.
<div align="center">
`AI Client` ↔️ **`MCP Server`** ↔️ `Unity Plugin`
</div>
## Topology
1. **Client Connection**: The AI Client connects to the Server using either `stdio` (standard input/output pipe) or `streamableHttp`.
2. **Plugin Connection**: The Unity Plugin connects to the Server via TCP/WebSockets on a specified port (default: `8080`).
## Deployment Options
### 1. Local Automatic (Recommended)
The **Unity Plugin** automatically downloads and runs the appropriate server binary for your OS. No manual setup required. Configuration is done via the Unity Editor window.
### 2. Docker
See **[Docker Deployment](DOCKER_DEPLOYMENT.md)**. Best for cloud hosting or isolated environments.
### 3. Manual Binary
You can run the server manually if you need advanced control or debugging.
Download from **[Releases](https://github.com/IvanMurzak/Unity-MCP/releases)**.
```bash
# Basic run (HTTP mode)
./unity-mcp-server --port 8080
# STDIO mode (for piping)
./unity-mcp-server --client-transport stdio
```
## CLI Arguments
The server executable accepts the following arguments:
| Argument | Description | Default |
| :------------------- | :--------------------------------------------------- | :------ |
| `--port` | Port for the Unity Plugin connection. | `8080` |
| `--client-transport` | Protocol for AI Client connection (`streamableHttp`, `stdio`). | `streamableHttp` |
| `--plugin-timeout` | Timeout in ms for plugin responses. | `10000` |
> **Note**: These can also be set via Environment Variables (e.g., `MCP_PLUGIN_PORT`).
## Architecture
The server is built on **.NET 9**, utilizing:
- **Model Context Protocol SDK** for AI communication.
- **ASP.NET Core** for HTTP/WebSockets.
- **ReflectorNet** for dynamic assembly analysis (used by the plugin).