Repository navigation
Server Setup
The MCP server is not part of this repository. Unity MCP uses the shared GameDev-MCP-Server (binary gamedev-mcp-server, Docker image aigamedeveloper/mcp-server), the same engine-agnostic server that Unreal-MCP and Godot-MCP use. It speaks MCP to the AI agent (stdio or streamableHttp) and SignalR to the Unity plugin.
You usually need none of this page: in Cloud mode the plugin connects to https://ai-game.dev/mcp, and in Custom mode with a local URL the plugin runs the server for you.
- The plugin downloads the server release pinned by its
ServerVersionconstant (independent of the plugin version) intoLibrary/mcp-server/<rid>/and starts it when the Editor loads. - The port is deterministic: a SHA256 hash of the project path mapped to 20000–29999. The CLI computes the same port, so nothing has to be configured.
- Server logs:
Tools/AI Game Developer/Server/Open Logs. Re-download:Download Binaries.
Download gamedev-mcp-server-<rid>.zip from the GameDev-MCP-Server releases (win-x64, win-x86, win-arm64, linux-x64, linux-arm64, osx-x64, osx-arm64), unzip and run:
./gamedev-mcp-server --port 8080 --client-transport stdio # the agent launches it
./gamedev-mcp-server --port 8080 --client-transport streamableHttp # agents connect over HTTPAgent config for stdio:
{
"mcpServers": {
"ai-game-developer": {
"command": "path/to/gamedev-mcp-server",
"args": ["--port=8080", "--client-transport=stdio"]
}
}
}unity-mcp-cli install-plugin --with-server downloads the matching binary for your machine as well.
The server binds to loopback by default, so a container needs MCP_BIND=any to be reachable through -p:
docker run -p 8080:8080 \
-e MCP_PLUGIN_CLIENT_TRANSPORT=streamableHttp -e MCP_PLUGIN_PORT=8080 -e MCP_BIND=any \
-e MCP_AUTH=token -e MCP_PLUGIN_TOKEN=<secret> \
aigamedeveloper/mcp-serverAgent config (in token mode the agent must send the secret too, or the server answers 401): { "mcpServers": { "ai-game-developer": { "url": "http://localhost:8080", "headers": { "Authorization": "Bearer <secret>" } } } }. In Unity choose Custom, set the same URL, and set the authentication to token with the same secret (or start the Editor with -UNITY_MCP_AUTH_OPTION=token -UNITY_MCP_TOKEN=<secret>).
Every option is an environment variable or a CLI argument (arguments win).
| Environment variable | Argument | Meaning |
|---|---|---|
MCP_PLUGIN_PORT |
--port |
Port for both the agent (HTTP) and the plugin (default 8080) |
MCP_PLUGIN_CLIENT_TRANSPORT |
--client-transport |
stdio or streamableHttp
|
MCP_AUTH |
--auth |
none, token or oauth
|
MCP_PLUGIN_TOKEN |
--token |
Shared secret for token mode |
MCP_BIND |
--bind |
loopback (default), any, or an IP |
MCP_PLUGIN_TOOL_TIMEOUT |
--tool-timeout |
How long one tool call may run, in ms |
The full list (OAuth, Redis sessions, origins, logging) is in the GameDev-MCP-Server README.
UNITY_MCP_SERVER_PATH=<absolute path to gamedev-mcp-server> makes the Editor launch that binary instead of the pinned release, and it is also written into generated agent configs. It is meant for server development and CI. It can also be set in a .env file at the project root. Details: docs/mcp-server.md.