Lets agents run editor code inside Unity, fetch logs and editor state, and access project files.
接入配置
选择客户端,复制配置,再按项目文档补齐环境变量。
claude mcp add unity-integration --env MCP_WEBSOCKET_PORT='<MCP_WEBSOCKET_PORT>' -- node build/index.js~/.codex/config.toml
[mcp_servers.unity-integration]
command = "node"
args = ["build/index.js"]
env = { MCP_WEBSOCKET_PORT = "<MCP_WEBSOCKET_PORT>" }
# codex mcp add unity-integration --env MCP_WEBSOCKET_PORT='<MCP_WEBSOCKET_PORT>' -- node build/index.js~/.cursor/mcp.json
{
"mcpServers": {
"unity-integration": {
"command": "node",
"args": [
"build/index.js"
],
"env": {
"MCP_WEBSOCKET_PORT": "<MCP_WEBSOCKET_PORT>"
}
}
}
}.vscode/mcp.json
{
"servers": {
"unity-integration": {
"type": "stdio",
"command": "node",
"args": [
"build/index.js"
],
"env": {
"MCP_WEBSOCKET_PORT": "<MCP_WEBSOCKET_PORT>"
}
}
}
}~/.gemini/settings.json
{
"mcpServers": {
"unity-integration": {
"command": "node",
"args": [
"build/index.js"
],
"env": {
"MCP_WEBSOCKET_PORT": "<MCP_WEBSOCKET_PORT>"
}
}
}
}claude_desktop_config.json
{
"mcpServers": {
"unity-integration": {
"command": "node",
"args": [
"build/index.js"
],
"env": {
"MCP_WEBSOCKET_PORT": "<MCP_WEBSOCKET_PORT>"
}
}
}
}.trae/mcp.json
{
"mcpServers": {
"unity-integration": {
"command": "node",
"args": [
"build/index.js"
],
"env": {
"MCP_WEBSOCKET_PORT": "<MCP_WEBSOCKET_PORT>"
}
}
}
}需要的环境变量
MCP_WEBSOCKET_PORT
把占位值换成你自己的密钥;不要把密钥提交到代码仓库。