UnityMCP
Unity Editor integration with Model Context Protocol (MCP) enabling AI assistants like Claude to interact with Unity projects. Features a TypeScript MCP server and C# Unity plugin with extensible command handler architecture, TCP/IP communication, and dynamic plugin discovery.
claude mcp add --transport stdio isuzu-shiranui-unitymcp node path/to/index.js \ --env NOTE="Replace with actual index.js path in your setup if needed"
How to use
UnityMCP is an integrated MCP server framework that enables large language models and AI agents to interact with Unity Editor through a scalable, plugin-based architecture. The server components are implemented in TypeScript for the MCP client side, while Unity exposes C# components to host and route MCP commands, resources, and prompts. It automatically detects and registers available handlers, supports command handlers (Tools), resource handlers (Resources), and prompt handlers (Prompts), and communicates with external AI services via TCP/IP. With this setup, you can extend Unity functionality by creating custom handlers that perform actions in the editor, expose data as resources, or provide reusable prompt templates for workflows, all accessible to models like Claude or other MCP-enabled agents. The system is designed to be editor-friendly, with an extensible plugin architecture and straightforward onboarding through the installer and quick setup flow.
To use the server, start the TypeScript MCP client (the TS server) and connect the Unity side via the provided TCP/IP protocol. If you are configuring Claude Desktop integration, you can install and configure the TypeScript client from Unity Editor preferences or use the manual configuration path to point Claude Desktop at your running MCP server. Once connected, you can issue MCP commands, fetch resources, and apply prompts through the unified MCP protocol, leveraging the auto-discovery of handlers to minimize manual setup. The documentation demonstrates both C# and TypeScript handler implementations, illustrating how to build command, resource, and prompt handlers that can be consumed by the MCP framework.
How to install
Prerequisites:
- Node.js 18.0.0 or newer and npm installed
- Unity 2022.3.22f1 or newer (Unity 6.1 compatibility confirmed)
- .NET/C# 9.0 installed and configured for Unity plugin development
Installation steps:
- Install Node.js and npm from the official website (if not already installed).
- Clone or download the UnityMCP repository from GitHub.
- Install TypeScript/MCP client dependencies:
- Navigate to the TypeScript client directory (where the MCP TS runtime lives).
- Run:
npm install
- Build or prepare the TypeScript MCP client entry point (index.js or equivalent) that the server will run:
- If a build script is provided, run:
npm run build
- If a build script is provided, run:
- Prepare the MCP server launch configuration:
- Use Node to start the TS MCP client with the appropriate entry point, e.g.:
node path/to/index.js
- Use Node to start the TS MCP client with the appropriate entry point, e.g.:
- In Unity, ensure the Unity MCP editor tooling is installed and configured:
- Open Unity and install the Unity MCP package via Package Manager using the git URL provided in the README.
- Open the Unity MCP preferences and configure host/port for the TCP/IP connection to the MCP client.
- (Optional) Configure Claude Desktop integration:
- If using Claude Desktop, install the TypeScript client via the installer in Unity Editor preferences, or manually point Claude Desktop to the TS client executable and provide the generated configuration JSON when prompted.
Note: Adjust the path/to/index.js in the startup command to your actual built entry file for the TS MCP client. The example config in Claude Desktop shows how to wire up the unity-mcp server by referencing the node runtime and the compiled index.js.
Additional notes
Tips and notes:
- The MCP server automatically detects and registers available handlers (both command, resource, and prompt handlers) to reduce manual configuration.
- When configuring Claude Desktop or other MCP clients, you can use the provided example JSON to wire the Unity MCP server into your environment. Ensure the path to index.js is correct for your setup.
- If you modify or add new handlers, re-run any discovery/registration steps or restart the MCP client to ensure the new handlers are picked up by the server.
- Environment variables are optional but can be used to point to custom paths, set logging levels, or tweak network settings.
- For TypeScript-based handlers, follow the BaseCommandHandler/BaseResourceHandler patterns shown in the README examples to ensure compatibility with the MCP protocol.
- Be mindful of security considerations when exposing MCP endpoints; restrict access to trusted clients and consider enabling TLS or network ACLs if supported by your deployment.
Related MCP Servers
ironcurtain
A secure* runtime for autonomous AI agents. Policy from plain-English constitutions. (*https://ironcurtain.dev)
create -app
A CLI tool for quickly scaffolding Model Context Protocol (MCP) server applications with TypeScript support and modern development tooling
grok-faf
First MCP server for Grok | FAST⚡️AF • URL-based AI context • Vercel-deployed
mcpapp-colorpicker
A Model Context Protocol (MCP) App built with .NET that provides an interactive color picker with a rich UI
mcp-turso
MCP server for interacting with Turso-hosted LibSQL databases
LiquidSoapMCP
MCP server for LiquidSoap 2.4.0 documentation and script assistance