MCP ExplorerExplorer

Unity Mcp Template

@dunwardon a year ago
10 MIT
FreeCommunity
AI Systems
#mcp#mcp-client#mcp-server#template-project#unity#typescript#unity-mcp#ai
Simple template project for controlling Unity via MCP

Overview

What is Unity Mcp Template

unity-mcp-template is a simple template project designed to facilitate interaction between a TypeScript-based MCP server and Unity, allowing developers to create and configure their own tools for enhanced functionality.

Use cases

Use cases include creating custom tools for game development, managing real-time interactions between Unity and a TypeScript-based server, and expanding Unity’s capabilities through additional tools.

How to use

To use unity-mcp-template, you need to build the MCP server by running ‘npm install’ and ‘npm run build’ within the unity-mcp-server directory. Then, configure the MCP in Claude Desktop settings by adding the server command and arguments.

Key features

Key features include compatibility with legacy versions of Unity, the use of IMGUI for EditorWindow implementation, and the ability to create custom tools in both Unity and TypeScript.

Where to use

unity-mcp-template can be used in game development, particularly for projects that require integration between Unity and custom server-side applications, enhancing the development workflow.

Content

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

  • [x] 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)

Tools

No tools

Comments

Recommend MCP Servers

View All MCP Servers