Unity MCP Server
Exposes Unity Editor capabilities through MCP protocol, providing tools for debugging, editor operations, build management, and project structure access within the Unity development environment.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Unity MCP Servershow me the current scene hierarchy"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Unity MCP Server
Chinese | English
A Unity Editor plugin that exposes Unity Editor capabilities to external AI agents via the MCP (Model Context Protocol).
Agents (such as Kiro, Cursor, or Claude Code) can connect to the Unity Editor via the standard MCP protocol to invoke editor functions.
Philosophy
This plugin is positioned as a Unity perception layer + diagnostic toolchain for AI Agents:
Perception First — Prioritizes high-frequency scenarios such as "reading scene state, obtaining context, and assisting with diagnostics," allowing Agents to fully understand the current project state and assist in development decisions.
Structured Writing — Provides safe, auditable write capabilities (e.g., modifying properties, adding/removing nodes), but does not aim to cover all interactions of the Unity Editor GUI.
Not a Replacement for the Editor — The goal is to enhance the efficiency of collaboration between engineers and Agents, rather than moving all Editor operations into a dialog box.
Related MCP server: MCP Unity
Features
Streamable HTTP Transport — Based on the MCP 2025-03-26 specification, single HTTP endpoint
In-Process Execution — No external Node.js/Python processes required; starts directly within the Editor
Extensible Tool System — Implement the
IMcpToolinterface to register new tools with zero modifications to core codeDomain Reload Auto-Recovery — Service automatically restarts after entering/exiting PlayMode
Built-in Tools
For full parameter descriptions and usage examples, see Tool Documentation.
Debug Tools
Tool | Function |
| Get Unity Console logs (supports filtering) |
| Clear log buffer |
| Get full stack trace of the most recent Error/Exception |
| Get performance metrics like FPS, DrawCalls, memory, etc. |
| Take a screenshot of the Game/Scene view |
Editor Tools
Query
Tool | Function |
| Get GameObject tree structure |
| Get serialized field values in Inspector |
| Get information about currently selected objects |
| Search for GameObjects by name/component |
| Get project root directory path |
| Get Assets directory structure |
Mutation
Tool | Function |
| Add a GameObject |
| Delete a GameObject |
| Modify serialized field values |
| Modify Transform properties |
| Modify active state |
| Modify parent node |
| Add a component |
| Remove a component |
| Enable/disable a component |
| Select a specific GameObject |
Project
Tool | Function |
| Execute Unity menu items by path |
| Control PlayMode state |
Asset
Tool | Function |
| Delete Assets subdirectory |
Build Tools
Tool | Function |
| Trigger script compilation |
| Get list of compilation errors |
| Run Test Runner tests |
Code Tools (Experimental, Unity 2022 Mono only)
Tool | Function |
| Dynamically compile and execute C# code (supports both main thread/background modes) |
Must be manually enabled in the Window → MCP Server panel. See Tool Documentation for details.
Installation
Git URL Installation (Recommended)
Unity Editor → Window → Package Manager →
+→ Add package from git URLEnter the following URL:
https://github.com/yangfch3/Unity-MCP-Server.gitOr edit the host project's Packages/manifest.json directly:
{
"dependencies": {
"com.yangfch3.unity-mcp": "https://github.com/yangfch3/Unity-MCP-Server.git"
}
}Local Path Installation
Clone this repository
Unity Editor → Window → Package Manager →
+→ Add package from diskSelect the
package.jsonin the root of this repository
Or add to Packages/manifest.json:
{
"dependencies": {
"com.yangfch3.unity-mcp": "file:../../path/to/unity-mcp"
}
}Version Updates
After installing via Git URL, UPM locks the current commit hash in the host project's packages-lock.json. It will not update automatically.
To lock a specific version, append a Git Tag to the end of the URL:
https://github.com/yangfch3/Unity-MCP-Server.git#v0.3.0Corresponding Packages/manifest.json configuration:
{
"dependencies": {
"com.yangfch3.unity-mcp": "https://github.com/yangfch3/Unity-MCP-Server.git#v0.3.0"
}
}Without a tag, it tracks the latest commit of the default branch:
{
"dependencies": {
"com.yangfch3.unity-mcp": "https://github.com/yangfch3/Unity-MCP-Server.git"
}
}When updating versions, modify the #tag suffix in manifest.json to the new version number, or re-add the package from the git URL with the new tag in the UPM GUI.
Usage
Start Service
Unity Editor → Window → MCP Server
Set the port (default 8090) and click Start
Copy the configuration JSON from the panel
Configure Agent
Add the following content to your Agent's MCP configuration file (e.g., mcp.json):
{
"mcpServers": {
"unity-mcp": {
"url": "http://localhost:8090/"
}
}
}Extension: Adding Custom Tools
Implement the IMcpTool interface and place it in any Editor assembly; the service will automatically discover and register it upon startup:
using System.Collections.Generic;
using System.Threading.Tasks;
using UnityMcp.Editor;
public class MyCustomTool : IMcpTool
{
public string Name => "my_custom_tool";
public string Category => "custom";
public string Description => "我的自定义工具";
public string InputSchema => "{\"type\":\"object\",\"properties\":{}}";
public Task<ToolResult> Execute(Dictionary<string, object> parameters)
{
return Task.FromResult(ToolResult.Success("Hello from custom tool!"));
}
}Requirements
Unity 2022.3+
Editor environment only; does not affect runtime builds
Contributing
Contributions to this project are welcome. See CONTRIBUTING.md for details.
License
MIT
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseNot gradedqualityAmaintenanceA bridge enabling seamless communication between Unity and Large Language Models via the Model Context Protocol, allowing developers to automate workflows, manipulate assets, and control the Unity Editor programmatically.13,457MIT
- AlicenseNot gradedqualityDmaintenanceImplementation of the Model Context Protocol for Unity Editor, allowing AI assistants to interact with Unity projects through a Node.js server bridge.112MIT
- AlicenseNot gradedqualityNot gradedmaintenanceEnables AI assistants to interact with Unity Editor through the Model Context Protocol, allowing natural language control of Unity projects including scene manipulation, GameObject creation, component updates, package management, and test execution.
- AlicenseNot gradedqualityDmaintenanceA Model Context Protocol server that integrates AI assistants like Claude and Cursor directly into the Unity Editor to automate game development workflows. It provides over 40 built-in tools for scene manipulation and project management, while offering a simple C# API for creating custom extensions.9GPL 3.0
Related MCP Connectors
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to control Unreal E…
A Model Context Protocol server for Wix AI tools
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/yangfch3/Unity-MCP-Server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server