UnityMCP
Local Streamable HTTP MCP server exposing Unity Editor inspection, authoring, testing, profiling, play-mode, and build tools.
README
UnityMCP
UnityMCP is a local Streamable HTTP MCP server that exposes Unity Editor inspection, authoring, testing, profiling, play-mode, and build tools. Its core has no compile-time dependency on a game's scripts or on Netcode for GameObjects.
Requirements
- Unity 6 (
6000.0or newer) - A local MCP client such as Codex
- The package dependencies declared in
package.json(Unity installs these through UPM)
Install
Use one of these approaches:
-
In Unity Package Manager, choose Add package from git URL and enter:
https://github.com/zloybest/UnityMCP.git#v0.23.0The repository must be accessible to Git on that computer.
-
For local development, copy this entire directory into the other project's
Packages/com.zloybest.unitymcpdirectory. Keeppackage.json, the assembly definition, source files, and.metafiles together.
Do not copy only the .cs files: the package manifest supplies required Unity packages,
and the assembly definition prevents accidental references to the host game's assemblies.
The complete command and protocol reference is in
Documentation~/UnityMCP.md.
Configure Unity
- Wait for Unity to finish importing and compiling.
- Open Tools > Unity MCP > Control Window.
- Leave Auto Start enabled or start the server manually.
- Choose a free port. The default is
8090; use a different port for each concurrently open Unity project. - Click Restart after changing the port.
- Confirm the endpoint shows
http://127.0.0.1:<port>/.
Settings are stored per Unity project in ProjectSettings/UnityMCPSettings.asset.
When Unity Multiplayer Play Mode launches additional Editor instances, UnityMCP keeps
the endpoint exclusively in the main Editor. Additional Editors detect Unity's virtual
project launch marker (and CurrentPlayer.IsMainEditor when available) and suppress
server startup, preventing a clone from capturing the configured port during domain
reload.
Requests from non-loopback addresses are rejected.
Connect an MCP client
UnityMCP supports two client connection approaches:
| Approach | Best fit | Tradeoff |
|---|---|---|
| Direct Streamable HTTP | Simplest setup and lowest overhead. Recommended when the client tolerates a brief Unity reload. | A request can fail if it lands during compilation or a domain reload. |
| Stdio proxy | Long-running sessions where reload resilience matters most. | Requires Node.js 18+ and a stable checkout of this repository. |
On Windows, UnityMCP already uses its own reload-safe endpoint broker, so direct mode is usually sufficient. The optional proxy adds client-side retries and keeps the MCP stdio process stable. On other platforms, it is also useful while Unity's HTTP listener restarts.
Option A: direct HTTP
Run this once, replacing the name/port if necessary:
codex mcp add UnityMCP --url http://127.0.0.1:8090/
Equivalent config.toml configuration:
[mcp_servers.UnityMCP]
url = "http://127.0.0.1:8090/"
startup_timeout_sec = 10.0
tool_timeout_sec = 180.0
Use a distinct server name (for example UnityMCP_OtherGame) when registering more
than one Unity project. Restart Codex or begin a new session after changing MCP config,
then call the ping tool to verify the connection.
Option B: reload-tolerant stdio proxy
Clone this repository to a stable path and point Codex at the included zero-dependency
proxy. Do not use a path inside Unity's Library/PackageCache: package cache paths can
change after an update.
codex mcp add UnityMCP -- node "C:\path\to\UnityMCP\Proxy~\index.js" --stdio
Equivalent config.toml configuration on Windows:
[mcp_servers.UnityMCP]
command = "node"
args = ['C:\path\to\UnityMCP\Proxy~\index.js', "--stdio"]
startup_timeout_sec = 10.0
tool_timeout_sec = 180.0
The proxy targets http://127.0.0.1:8090/ by default. For another UnityMCP port, add:
[mcp_servers.UnityMCP.env]
TARGET_URL = "http://127.0.0.1:8092/"
It retries transient connection failures, HTTP 502/503/504, and Unity's empty
domain-reload response, then returns a retryable JSON-RPC error if Unity remains
unavailable. No npm install is
needed. See Proxy~/README.md for retry, logging, HTTP-proxy, and
authentication options.
The old names KebabMCP and KebabProxy are obsolete. Existing configurations should
rename the server table to mcp_servers.UnityMCP and update the script path to this
repository's Proxy~\index.js.
Optional integrations
- Netcode tools discover Netcode for GameObjects at runtime. Without NGO, status/list commands return empty state and start commands report that the integration is absent.
- Projects with a compatible
GameManagersession API automatically keep the relay/session-code flow; otherwise host/client start falls back to NGONetworkManager. devtools_toggle_f3anddevtools_toggle_f4are compatibility tools. They discover supported DevTools types at runtime and returnnot_foundin projects without them.- Scripted input tools use Unity Input System, installed as a package dependency.
play_startkeeps its no-argument default solo behavior. On Unity versions that provide the Play Mode Framework, passplayModeConfigas a configuration asset path or exact asset name to start that configuration. Multiplayer Play Mode scenario assets are supported without a compile-time dependency on the MPM package.
Updating
Update the Git package through Package Manager, or replace the copied package directory
with a newer complete version. Reopen Unity and verify ping reports the expected version.
Development and tests
To work on the package locally, use Package Manager's Add package from disk command
and select this repository's package.json. Add com.zloybest.unitymcp to the host
project's testables array to expose the package's Edit Mode tests in Unity Test Runner.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。