Fire in da houseTop Tip:Paying $100+ per month for Perplexity, MidJourney, Runway, ChatGPT and other tools is crazy - get all your AI tools in one site starting at $15 per month with Galaxy AI Fire in da houseCheck it out free

unity-mcp-template

MCP.Pizza Chef: dunward

unity-mcp-template is a simple MCP server project demonstrating how to control Unity using a TypeScript-based MCP server. It provides a foundational example for building and configuring custom tools to interact with Unity, using IMGUI for the EditorWindow and avoiding complex dependencies for compatibility. This server enables real-time, structured interaction between Unity and MCP clients, facilitating development of AI-enhanced workflows within Unity environments.

Use This MCP server To

Control Unity editor via MCP server commands Build custom Unity tools with TypeScript MCP integration Manage Unity EditorWindow using IMGUI through MCP Develop AI-driven Unity workflows with real-time context Expand Unity functionality by creating new MCP tools Integrate Unity projects with external MCP clients Automate Unity tasks using MCP server scripting

README

GitHub License

Unity MCP Template

mcp-template-ezgif com-resize

This is a simple example project demonstrating interaction between a TypeScript-based MCP server and Unity. You can build and configure your own tools to expand and develop further.

Create more tools your own!

Quick Start

unity-mcp-sample is a Unity example project. To minimize version-related issues and ensure compatibility with legacy versions, it does not use packages like NewtonsoftJSON. Additionally, the EditorWindow is implemented using IMGUI. The MCP can be managed through the UnityMCP-ShowWindow at the top.

Build MCP Server

within the unity-mcp-server

npm install
npm run build

Add MCP in Claude Desktop

Open Claude Desktop Settings, and Developer-Edit Config

{
    "mcpServers": {
      "unity-mcp": {
        "command": "node",
        "args":["F:/unity-mcp-template/unity-mcp-server/dist/index.js"]
      }
    }
  }

Create your own tools!

Both input data structure should be same.

Unity

Refer to CreateObjectTools and create the tool you want.

Typescript

Refer to createObject and create the tool you want.

TODO List

  • Enable Unity to send result messages to MCP
  • Discussion here Change TCP structure (currently implemented with client-server reversed due to a bug in the TypeScript SDK)
    • Unity (Current : TCP Server, TODO : TCP Client)
    • MCP (Current : TCP Client, TODO : TCP Server)

unity-mcp-template FAQ

How do I build the unity-mcp-template server?
Navigate to the unity-mcp-server directory, run 'npm install' then 'npm run build' to build the server.
Does unity-mcp-template support Unity versions with NewtonsoftJSON?
This template avoids NewtonsoftJSON to ensure compatibility with legacy Unity versions.
How is the Unity EditorWindow implemented in this MCP server?
The EditorWindow uses IMGUI for simplicity and compatibility.
Can I create additional tools with unity-mcp-template?
Yes, the template encourages building and configuring your own MCP tools to extend functionality.
How do I manage the MCP server within Unity?
Use the UnityMCP-ShowWindow accessible at the top of the Unity editor to manage the MCP server.
Is this MCP server limited to TypeScript?
The provided example uses TypeScript, but you can adapt the MCP server to other languages if needed.
What LLM providers can I use with this MCP server?
You can integrate with OpenAI, Anthropic Claude, and Google Gemini models for AI workflows.
Does this template support real-time interaction between Unity and MCP clients?
Yes, it enables real-time, structured communication between Unity and MCP clients.