Unity MCP Template logo

Unity MCP Template

by dunward

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.

View on GitHub

Last updated: N/A

What is Unity MCP Template?

A Unity example project that demonstrates interaction between a TypeScript-based MCP (Multi-Client Platform) server and Unity. It provides a template for creating custom tools for use within the Unity editor.

How to use Unity MCP Template?

  1. Build the MCP server using npm install and npm run build within the unity-mcp-server directory.
  2. Add the MCP server configuration to Claude Desktop's settings by editing the config file.
  3. Create your own tools by referring to the CreateObjectTools (Unity) and createObject (TypeScript) examples, ensuring the input data structure is consistent.

Key features of Unity MCP Template

  • Demonstrates MCP server interaction with Unity

  • Provides a template for creating custom tools

  • Uses IMGUI for EditorWindow implementation

  • Includes a sample Unity project

  • Uses TCP communication

Use cases of Unity MCP Template

  • Creating custom tools for Unity editor

  • Extending Unity's functionality with external servers

  • Building interactive development environments

  • Integrating Unity with other applications

  • Facilitating communication between Unity and TypeScript-based servers

FAQ from Unity MCP Template

What is MCP?

MCP stands for Multi-Client Platform. In this context, it refers to a server that can communicate with multiple clients, in this case, the Unity editor.

What is the purpose of this template?

The template provides a starting point for developers who want to create custom tools and integrate them with Unity using a TypeScript-based server.

Why doesn't the project use NewtonsoftJSON?

To minimize version-related issues and ensure compatibility with legacy versions of Unity.

How do I create my own tools?

Refer to the CreateObjectTools (Unity) and createObject (TypeScript) examples. Ensure that the input data structure is the same for both the Unity and TypeScript sides.

Where can I find the MCP server code?

The MCP server code is located in the unity-mcp-server directory.