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.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
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
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
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…
Make games with AI: one MCP server that connects your agent to Unity, Unreal and Godot editors.
Your org's AI agents, tasks, runs, search, and brain files as MCP tools and resources.
Related MCP Servers
- AlicenseNot gradedqualityBmaintenanceA 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.16,080MIT
- AlicenseNot gradedqualityDmaintenanceImplementation of the Model Context Protocol for Unity Editor, allowing AI assistants to interact with Unity projects through a Node.js server bridge.2MIT
- 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 gradedqualityNot gradedmaintenanceExposes Unity Editor project context and manipulation tools to AI coding agents, enabling automated scene hierarchy analysis, script inspection, and asset management. It supports both read and write operations including GameObject editing, component configuration, and animation authoring within the Unity environment.2-