
AI Game Developer: MCP for Unity, Unreal and Godot
io.github.IvanMurzak由 GitHub 账号 IvanMurzak 发布v9.3.2更新于 Nov 3, 2026
Make games with AI: one MCP server that connects your agent to Unity, Unreal and Godot editors.
概览
把 AI 智能体连接到 Unity、Unreal 和 Godot 编辑器,让它查看场景、执行 C# 脚本、运行测试并截图。
- 可以做什么
- 通过 RQL 查询读取和修改编辑器数据:场景、GameObject、组件、资源、控制台日志、设置、光照与性能分析
- 创建 GameObject、材质、文件夹和场景,保存预制体,移动或删除资源,执行菜单项
- 编译并执行 C# 代码,读取、创建或删除脚本文件,运行 EditMode/PlayMode 测试
- 对单个 GameObject、Scene 视图、Game 视图或相机截图,可选保存到项目中
- 列出、搜索、添加和移除 Unity Package Manager 包,并向智能体显示或隐藏工具
- 安装动画、Cinemachine、导航、地形、瓦片地图等可选的扩展工具集
- 适用场景
- 适合用 Unity 开发游戏(说明中也提到 Unreal 和 Godot)并希望 AI 智能体直接查看工程、修改编辑器内容、迭代 C# 代码,并用测试或截图验证结果的场景,省去手动切换窗口。
- 运行要求
- 使用托管端点并完成 OAuth 登录,或由 MCP 客户端以 stdio 启动本地服务器二进制,并在项目中安装 Unity 插件。CLI 方式需要 Node.js 运行 npm 包,并通过浏览器 OAuth 设备码登录,凭据保存在本机。项目路径不能包含空格。AI 智能体需支持 Skills 或动态 MCP 工具更新。
安装
在 SourceWeft 中
- 打开 控制台中的 AI Game Developer: MCP for Unity, Unreal and Godot,将其添加到工作区。
- 连接 所需的 凭据。它们会被私密存储,绝不会在公开页面上展示。
- 为需要使用其工具的对话启用该服务。
Web executable,通过 Streamable HTTP。 远程服务在工作区中配置后即可从网页运行时运行。
交给智能体安装
把这段提示词粘贴到 Claude Code、Codex、Cursor 等智能体,或 SourceWeft 对话中。智能体会读取该服务器的安装指南,先向你展示发布者、端点和登录方式,经你同意后再把它添加到你的客户端。密钥不会写进任何命令。
阅读 https://sourceweft.com/mcp/io.github.IvanMurzak%2FUnity-MCP/install.md,并按其中说明把这个 MCP 服务器接入我的客户端。修改任何配置之前,先告诉我它的发布者、端点和登录方式,等我确认。不要把 API 密钥写进命令或我会提交的文件;问我密钥应从哪里获取。其他 MCP 客户端
把它添加到你客户端的 mcpServers 配置中。 客户端会在首次连接时完成 OAuth 登录。
{
"mcpServers": {
"ai-game-developer-for-unity-unreal-and-g": {
"type": "http",
"url": "https://ai-game.dev/mcp"
}
}
}README
✨ AI Game Developer — Unity SKILLS, MCP
[MCP]
[OpenUPM]
[Docker Image]
[Unity Editor]
[Unity Runtime]
[r]
[Discord]
[OpenUPM]
[Stars]
[License]
[Stand With Ukraine]
[Claude] [Codex] [Cursor] [GitHub Copilot] [Gemini] [Antigravity] [VS Code] [Rider] [Visual Studio] [Open Code] [Cline] [Kilo Code]
Unity MCP is an AI-powered game development assistant for Editor & Runtime. Connect Claude, Cursor, & Windsurf to Unity via MCP. Automate workflows, generate code, and enable AI within your games.
Unlike other tools, this plugin works inside your compiled game, allowing for real-time AI debugging and player-AI interaction.
💬 Join our Discord Server - Ask questions, showcase your work, and connect with other developers!
[AI Game Developer — Unity MCP]
- ✔️ AI agents - Use the best agents from Anthropic, OpenAI, Microsoft, or any other provider with no vendor lock-in
- ✔️ Tools - A wide range of default MCP Tools for operating in Unity Editor
- ✔️ Skills - Generate skills for AI based on operating system, Unity version, plugins in the project
- ✔️ Code and Tests - Develop game mechanics and test them with AI agents
- ✔️ Runtime (in-game) - Use LLMs directly inside your compiled game for dynamic NPC behavior or debugging
- ✔️ Debug support - Let AI debug and fix the problems in a project
- ✔️ Natural conversation - Chat with AI like you would with a human
- ✔️ Flexible deployment - Works locally (stdio) and remotely (http) via configuration
- ✔️ Extensible - Create custom Tools in your project code
https://github.com/user-attachments/assets/228baf4d-4f00-4dce-939d-fb985ebdd8dd
OR use cli
[AI Game Developer — Unity SKILLS and MCP]
Quick Start
Get up and running in three steps:
- Install plugin — download the
.unitypackageinstaller or runopenupm add com.ivanmurzak.unity.mcpAlternative:
npx unity-mcp-cli install-plugin ./MyUnityProject— see CLI documentation - Pick an AI agent — Claude Code, Claude Desktop, GitHub Copilot, Cursor, or any other
- Setup AI agent — open
Window/AI Game Devin Unity and click Auto-generate skills (recommended) or Configure MCP [Setup AI Skills]Alternative:
npx unity-mcp-cli setup-skills claude-code ./MyUnityProject— see CLI documentation
That's it. Ask your AI "Create 3 cubes in a circle with radius 2" and watch it happen. ✨
Skills and Tools Reference
Since 1.0.0 the plugin exposes a small set of tools, and most Editor work goes through RQL, a query language over the Editor's data: rql-query reads, rql-mutate changes, and rql-schema describes the sources, types and calls (start there when unsure). The one-tool-per-action tools of earlier versions (gameobject-create, scene-save, console-get-logs and others) were replaced by RQL in #1017. See docs/default-mcp-tools.md for the full reference.
🧰 Browse the full MCP tools registry online: ai-game.dev/docs/tools
Shown to the AI agent by default: rql-query, rql-mutate, rql-schema, screenshot-isolated, script-execute, tests-run, unity-tool-list. The other tools are installed but hidden from the agent's tool list (a hidden tool still runs when called by name). Show them with tool-set-visibility, in the AI Game Developer window, or with unity-mcp-cli configure <path> --enable-tools <ids>.
RQL (scenes, GameObjects, components, assets, console, editor)
rql-query- Read Editor data with an RQL query, e.g.roots | recurse children | select name activerql-mutate- Change Editor data or call Editor operations, e.g.editor | call CreateGameObject({name: "Ground", primitive: "Plane"})rql-schema- Describe the sources, types, members and calls RQL can use, and print the topic guides- Sources:
scenes,roots,objects(every GameObject in the loaded scenes),selection,prefab(the prefab open in prefab mode),editor(create GameObjects, materials, folders and scenes; open and save scenes and prefabs; copy, move and delete assets; execute menu items; …),settings,console(captured Editor log entries),shaders,componentTypes,tests,testResults,profiler,lighting; assets by path withunity.asset("Assets/…")
Screenshots
screenshot-isolated- Render a GameObject in isolation from a chosen angle (optional composite 2x2 view)screenshot-scene-view- Captures a screenshot from the Unity Editor Scene View (hidden by default)screenshot-game-view- Captures a screenshot from the Unity Editor Game View (hidden by default)screenshot-camera- Captures a screenshot from a camera and returns it as an image (hidden by default)- All four take an optional
savePath, for when the user wants the picture as a file: the PNG is also written inside the project (never over an existing file) and the result saysSaved to <absolute path>; underAssets/it is imported as a Unity asset
Scripting, tests and packages
script-execute- Compiles and executes C# code dynamically using Roslynscript-read- Reads the content of a script file (hidden by default)script-update-or-create- Updates or creates script file with the provided C# code (hidden by default)script-delete- Delete the script file(s) (hidden by default)tests-run- Execute Unity tests (EditMode/PlayMode): any RQL selection over thetestssource as one run, results filtered with RQLpackage-list,package-search,package-add,package-remove- Unity Package Manager packages (hidden by default)
Tool management
unity-tool-list- List every tool and whether the agent sees ittool-set-visibility- Show or hide tools in the agent's tool list (hidden by default)tool-set-enabled-state- Deprecated alias oftool-set-visibility(hidden by default)
Profiling & Diagnostics
- RQL source
profiler(viarql-query/rql-mutate) - memory, rendering, script and frame snapshots, module flags;Start,Stop,ClearFrames,EnableModule,Save,Load
Lighting
- RQL source
lighting(viarql-query/rql-mutate) - the active scene's environment (ambient, fog, skybox, sun, reflections; undoable), its Lighting Settings asset and the bake:CreateSettings,UseSettings,Bake,CancelBake,ClearBakedData,BakeReflectionProbes LightProbeGroup.PlaceGrid(size, spacing)- fill a box with evenly spaced light probes;ReflectionProbe.Bake()- bake a Custom probe next to its scene
Install Additional Skills and Tools
Install extensions when need more tools or create your own tools.
[AI Game Developer — Unity SKILLS and MCP]
Contents
- Quick Start
- Skills and Tools Reference
- Contents
- Installation
- AI Workflow Examples
- Customize Tools
- Runtime usage (in-game)
- Unity
MCP Serversetup - How Unity MCP Architecture Works
- Contribution 💙💛
More Documentation
[AI Game Developer — Unity SKILLS and MCP]
Installation
Step 1: Install Unity MCP Plugin
⚠️ Requirements (click)
[!IMPORTANT] Project path cannot contain spaces
- ✅
C:/MyProjects/MyProject- ❌
C:/My Projects/MyProject- ❌
C:/My Projects/My Project- ❌
C:/MyProjects/My Project
Option 1 - Installer
- ⬇️ Download Installer
- 📂 Import installer into Unity project
- You can double-click on the file - Unity will open it automatically
- OR: Open Unity Editor first, then click on
Assets/Import Package/Custom Package, and choose the file
Option 2 - CLI (recommended)
Install the plugin via unity-mcp-cli — no Unity Editor needed:
See full CLI documentation for all available commands.
Cloud sign-in & project pinning:
unity-mcp-cli loginruns the browser OAuth device flow and stores the credential in the shared machine store (~/.ai-game-dev/credentials.json) — there is no personal access token to paste. By default the AI-agent config thatsetup-mcpwrites points at a per-project pinned endpoint (https://ai-game.dev/mcp/p/<pin>); pass--no-pinto use the sharedhttps://ai-game.dev/mcpendpoint instead. Teams can distribute access with an enrollment code:unity-mcp-cli install-plugin --enroll <code>.
Step 2: Install AI agent
Choose a single AI agent you prefer - you don't need to install all of them. This will be your main chat window to communicate with the LLM.
- Claude Code (recommended)
- Claude Desktop
- GitHub Copilot in VS Code
- Antigravity
- Cursor
- Windsurf
- Any other supported
The AI Game Developer is quite universal, which is why you may use any AI agent you prefer - it will work as smoothly as any other. The only important requirement is that the AI agent must support Skills or dynamic MCP Tool updates.
Step 3: Configure AI agent
Automatic configuration
- Open Unity project
- Open
Window/AI Game Dev - Option 1: Click
Auto-generateSkills (recommended) - Option 2: Click
ConfigureModel Context Protocol (MCP)
If your MCP client is not in the list, use the raw JSON shown in the window to inject it into your MCP client. Read the instructions for your specific MCP client on how to do this.
Manual configuration
If automatic configuration doesn't work for you for any reason, use the JSON from the AI Game Developer (Unity-MCP) window to configure any MCP Client manually.
Command line configuration
Create command
1. Choose your <command> for your environment
2. Replace <unityProjectPath> with the full path to Unity project
3. Replace <port> with your port from AI Game Developer configuration
4. Add MCP server using command line
[Gemini CLI] Gemini CLI
Replace
<command>from the table above
[Claude Code CLI] Claude Code CLI
Replace
<command>from the table above
[GitHub Copilot CLI] GitHub Copilot CLI
Server name: ai-game-developer
Server type: local
Command: <command>
Replace
<command>from the table above
[AI Game Developer — Unity SKILLS and MCP]
AI Workflow Examples
Communicate with the AI (LLM) in your AI agent. Ask it to do anything you want. The better you describe your task or idea, the better it will perform the job.
Some AI agents allow you to choose different LLM models. Pay attention to this feature, as some models may work much better than others.
Example prompts:
Make sure
Agentmode is enabled if using VS Code with Copilot
Disabling update notifications for the whole team
The plugin shows an update popup at Editor startup when a newer version is available on OpenUPM. By default, each team member sees this popup until they individually click "Do not show again" (which is a per-user setting stored on their machine).
For multi-person Unity projects where one engineer owns plugin versioning, you can disable the popup for the entire team by opening Edit ▸ Project Settings ▸ AI Game Developer and enabling "Disable update notifications for the entire team". The setting is persisted to ProjectSettings/AI-Game-Developer-UpdateSettings.asset and only needs to be set once per project — commit that file and every team member who pulls the commit will have the popup suppressed.
The same toggle is also reachable via Tools ▸ AI Game Developer ▸ Updates ▸ Disable Update Notifications (Team) in the menu bar.
Advanced Features for LLM
Unity MCP provides advanced tools that enable the LLM to work faster and more effectively, avoiding mistakes and self-correcting when errors occur. Everything is designed to achieve your goals efficiently.
Core Capabilities
- ✔️ Agent-ready tools - Find anything you need in 1-2 steps
- ✔️ Instant compilation - C# code compilation & execution using
Roslynfor faster iteration - ✔️ Full asset access - Read/write access to assets and C# scripts
- ✔️ Intelligent feedback - Well-described positive and negative feedback for proper issue understanding
Reflection-Powered Features
- ✔️ Object references - Provide references to existing objects for instant C# code
- ✔️ Project data access - Get full access to entire project data in a readable format
- ✔️ Granular modifications - Populate & modify any piece of data in the project
- ✔️ Method discovery - Find any method in the entire codebase, including compiled DLL files
- ✔️ Method execution - Call any method in the entire codebase
- ✔️ Advanced parameters - Provide any property for method calls, even references to existing objects in memory
- ✔️ Live Unity API - Unity API instantly available - even when Unity changes, you get the fresh API
- ✔️ Self-documenting - Access human-readable descriptions of any
class,method, orpropertyviaDescriptionattributes
[AI Game Developer — Unity SKILLS and MCP]
Customize Tools
Unity MCP supports custom MCP Tool, MCP Resource, and MCP Prompt development by project owners. The MCP server takes data from the Unity MCP Plugin and exposes it to a client. Anyone in the MCP communication chain will receive information about new MCP features, which the LLM may decide to use at some point.
Add custom Tool
To add a custom Tool, you need:
- A class with the
AiToolTypeattribute - A method in the class with the
AiToolattribute - Optional: Add a
Descriptionattribute to each method argument to help the LLM understand it - Optional: Use
string? optional = nullproperties with?and default values to mark them asoptionalfor the LLM
Note that the line
MainThread.Instance.Run(() =>allows you to run code on the main thread, which is required for interacting with Unity's API. If you don't need this and running the tool in a background thread is acceptable, avoid using the main thread for efficiency purposes.
Add custom MCP Prompt
MCP Prompt allows you to inject custom prompts into the conversation with the LLM. It supports two sender roles: User and Assistant. This is a quick way to instruct the LLM to perform specific tasks. You can generate prompts using custom data, providing lists or any other relevant information.
[AI Game Developer — Unity SKILLS and MCP]
Runtime usage (in-game)
Use Unity MCP in your game/app. Use Tools, Resources or Prompts. By default there are no tools, you would need to implement your custom.
Sample: AI powered Chess game bot
There is a classic Chess game. Lets outsource to LLM the bot logic. Bot should do the turn using game rules.
Mark game-only tools [AiToolType(Target = ToolTarget.Runtime)] (using com.IvanMurzak.McpPlugin.Common;): only the game registers them, and the MCP server sends their calls to the running game even while the Editor is connected.
Why runtime usage is needed?
There are many use cases, lets imagine you are working on a Chess game with bot. You may outsource the bot decision making to LLM by writing few lines of code.
[AI Game Developer — Unity SKILLS and MCP]
Unity MCP Server setup
Unity MCP Server supports many different launch options and Docker deployment. Both transport protocols are supported: streamableHttp and stdio. If you need to customize or deploy Unity MCP Server to a cloud, this section is for you. Read more...
Variables
Doesn't matter what launch option you choose, all of them support custom configuration using both Environment Variables and Command Line Arguments. It would work with default values, if you just need to launch it, don't waste your time for the variables. Just make sure Unity Plugin also has default values, especially the --port, they should be equal.
Command line args support also the option with a single
-prefix (-port) and an option without prefix at all (port).
For analytics and authorization webhook variables (
MCP_PLUGIN_WEBHOOK_*), see docs/mcp-server.md.
Choosing a transport: Use
stdiowhen the MCP client launches the server binary directly (local use — this is the most common setup). UsestreamableHttpwhen running the server as a standalone process or in Docker/cloud, and connecting over HTTP.
Plugin Variables
The Unity MCP Plugin reads the following environment variables (and command-line arguments) on startup to override values from the saved config file. Overrides are applied in memory only and are never written to the config file (UserSettings/AI-Game-Developer-Config.json), so the saved values (for example connectionMode or transportMethod) still show what was chosen in the AI Game Developer window. To change a setting permanently, change it in the window, in an Editor started without that override (while an override is active, a change to the same setting in the window is not kept).
Command-line args take precedence over environment variables. Both override the saved config file value. The short flags
-url,-token, and-authare aliases; the full-UNITY_MCP_*arg names are also accepted.Cloud vs Custom mode in
UserSettings/AI-Game-Developer-Config.json:connectionModedefaults toCloud, which connects tohttps://ai-game.dev/mcpand never auto-starts the local server (even ifkeepServerRunningistrue). The saved"host"field is used only whenconnectionModeis"Custom"; editing"host"in the file does not switch the mode. To use a local server, select Custom in the AI Game Dev window, or set"connectionMode": "Custom"while Unity is closed.
Example (CI/CD batch mode):
Docker 📦
Make sure Docker is installed. And please make sure Docker Desktop is launched if you are at Windows operation system.
Read advanced Docker configuration instructions.
streamableHttp Transport
MCP Client config:
Replace
urlwith your real endpoint if it is hosted in cloud.
stdio Transport
For using this variant, MCP Client should launch the MCP Server in the docker. It is achievable through the modified MCP Client configuration.
MCP Client config:
Custom port
MCP Client config:
Replace
urlwith your real endpoint if it is hosted in cloud
Binary executable
You may launch Unity MCP Server directly from a binary file. You would need to have a binary compiled specifically for your CPU architecture. Check GitHub Release Page, it contains pre-compiled binaries for all CPU architectures.
MCP Client config:
Replace
<project>with your Unity project path.
[AI Game Developer — Unity SKILLS and MCP]
How Unity MCP Architecture Works
Unity MCP serves as a bridge between LLMs and Unity. It exposes and explains Unity's tools to the LLM, which then understands the interface and utilizes the tools according to user requests.
Connect Unity MCP to LLM clients such as Claude or Cursor using the integrated AI Connector window. Custom clients are also supported.
The system is highly extensible - you can define custom MCP Tools, MCP Resource or MCP Prompt directly in your Unity project codebase, exposing new capabilities to AI or automation clients. This makes Unity MCP a flexible foundation for building advanced workflows, rapid prototyping, and integrating AI-driven features into your development process.
What is MCP
MCP - Model Context Protocol. In a few words, that is USB Type-C for AI, specifically for LLM (Large Language Model). It teaches LLM how to use external features. Such as Unity Engine in this case, or even your custom C# method in your code. Official documentation.
What is AI agent
It is an application with a chat window. It may have smart agents to operate better, it may have embedded advanced MCP Tools. In general well done MCP Client is 50% of the AI success of executing a task. That is why it is very important to choose the best one for usage.
What is MCP Server
It is a bridge between MCP Client and "something else", in this particular case it is Unity Engine. This project includes MCP Server.
What is MCP Tool
MCP Tool is a function or method that the LLM can call to interact with Unity. These tools act as the bridge between natural language requests and actual Unity operations. When you ask the AI to "create a cube" or "change material color," it uses MCP Tools to execute these actions.
Key characteristics:
- Executable functions that perform specific operations
- Typed parameters with descriptions to help the LLM understand what data to provide
- Return values that give feedback about the operation's success or failure
- Thread-aware - can run on main thread for Unity API calls or background thread for heavy processing
When to use Tool
- Automate repetitive tasks - Create tools for common operations you do frequently
- Complex operations - Bundle multiple Unity API calls into a single, easy-to-use tool
- Project-specific workflows - Build tools that understand your project's specific structure and conventions
- Error-prone tasks - Create tools that include validation and error handling
- Custom game logic - Expose your game's systems to AI for dynamic content creation
Examples:
- Creating and configuring GameObjects with specific components
- Batch processing assets (textures, materials, prefabs)
- Setting up lighting and post-processing effects
- Generating level geometry or placing objects procedurally
- Configuring physics settings or collision layers
What is MCP Resource
MCP Resource provides read-only access to data within your Unity project. Unlike MCP Tools that perform actions, Resources allow the LLM to inspect and understand your project's current state, assets, and configuration. Think of them as "sensors" that give the AI context about your project.
Key characteristics:
- Read-only access to project data and Unity objects
- Structured information presented in a format the LLM can understand
- Real-time data that reflects the current state of your project
- Contextual awareness helping the AI make informed decisions
When to use MCP Resource
- Project analysis - Let AI understand your project structure, assets, and organization
- Debugging assistance - Provide current state information for troubleshooting
- Intelligent suggestions - Give AI context to make better recommendations
- Documentation generation - Automatically create documentation based on project state
- Asset management - Help AI understand what assets are available and their properties
Examples:
- Exposing scene hierarchy and GameObject properties
- Listing available materials, textures, and their settings
- Showing script dependencies and component relationships
- Displaying current lighting setup and render pipeline configuration
- Providing information about audio sources, animations, and particle systems
What is MCP Prompt
MCP Prompt allows you to inject pre-defined prompts into the conversation with the LLM. These are smart templates that can provide context, instructions, or knowledge to guide the AI's behavior. Prompts can be static text or dynamically generated based on your project's current state.
Key characteristics:
- Contextual guidance that influences how the AI responds
- Role-based - can simulate different personas (User requests or Assistant knowledge)
- Dynamic content - can include real-time project data
- Reusable templates for common scenarios and workflows
When to use MCP Prompt
- Provide domain knowledge - Share best practices and coding standards specific to your project
- Set coding conventions - Establish naming conventions, architecture patterns, and code style
- Give context about project structure - Explain how your project is organized and why
- Share workflow instructions - Provide step-by-step procedures for common tasks
- Inject specialized knowledge - Add information about specific Unity features, third-party assets, or custom systems
Examples:
- "Always use PascalCase for public methods and camelCase for private fields"
- "This project uses a custom event system located in Scripts/Events/"
- "When creating UI elements, always add them to the Canvas in Scene/UI/MainCanvas"
- "Performance is critical - prefer object pooling for frequently instantiated objects"
- "This project follows SOLID principles - explain any architecture decisions"
[AI Game Developer — Unity SKILLS and MCP]
Uninstall 🧹
To completely remove the plugin from your Unity project:
- Open Window ▸ Package Manager, select the AI Game Developer — MCP package, and click Remove.
- Close Unity, then delete the
Assets/Plugins/NuGetfolder (along with itsAssets/Plugins/NuGet.metafile).
[AI Game Developer — Unity SKILLS and MCP]
Contribution 💙💛
Contributions are highly appreciated. Bring your ideas and let's make game development simpler than ever before! Do you have an idea for a new Tool or feature, or did you spot a bug and know how to fix it?
Please give this project a star 🌟 if you find it useful!
- 👉 Read Development documentation
- 👉 Fork the project
- Clone the fork and open the
./Unity-MCP-Pluginfolder in Unity - Implement new things in the project, commit, push it to GitHub
- Create Pull Request targeting original Unity-MCP repository,
mainbranch.
来源:README.md,提交 f1c7513
工具
0版本历史
2- v9.3.2最新Nov 3, 2026
- v0.17.1Sep 16, 2026
评分
已满足适用检查项的 85%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通必需25 分
- 已声明认证方式必需10 分
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分