Skip to main content
Glama

setup_unity_bridge

Installs or updates Unity MCP bridge scripts in a Unity project, enabling direct interaction with Unity assets and scripts, even without an active Unity server.

Instructions

Install/update Unity MCP bridge scripts to a Unity project (works even if Unity server is not running)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
forceUpdateNoForce update even if scripts are up to date
projectPathYesPath to the Unity project

Implementation Reference

  • Tool registration in getTools() method including name, description, and input schema
    { name: 'setup_unity_bridge', description: 'Install/update Unity MCP bridge scripts to a Unity project (works even if Unity server is not running)', inputSchema: { type: 'object', properties: { projectPath: { type: 'string', description: 'Path to the Unity project' }, forceUpdate: { type: 'boolean', description: 'Force update even if scripts are up to date', default: false } }, required: ['projectPath'] } },
  • Handler in executeTool that validates args and delegates to UnityBridgeDeployService
    case 'setup_unity_bridge': { const { projectPath, forceUpdate } = args; if (!projectPath) { throw new Error('projectPath is required'); } try { await this.deployService.deployScripts({ projectPath, forceUpdate }); return { content: [{ type: 'text', text: `Unity MCP bridge scripts installed successfully to:\n${projectPath}/Assets/Editor/MCP/\n\nPlease restart Unity Editor or open Window > Unity MCP Server to start the server.` }] }; } catch (error: any) { throw new Error(`Failed to install scripts: ${error.message}`); } }
  • Core deployment logic that validates project, creates directory, and deploys embedded scripts via deployScript method
    async deployScripts(options: DeploymentOptions): Promise<void> { const { projectPath, forceUpdate = false } = options; // Validate Unity project const projectValidation = await this.validateUnityProject(projectPath); if (!projectValidation.isValid) { throw new Error(`Invalid Unity project: ${projectValidation.error}`); } // Create Editor/MCP directory if it doesn't exist const editorMCPPath = path.join(projectPath, 'Assets', 'Editor', 'MCP'); await fs.mkdir(editorMCPPath, { recursive: true }); // Deploy each script for (const script of this.SCRIPTS) { await this.deployScript(projectPath, script, forceUpdate); } this.logger.info('Unity MCP scripts deployed successfully'); }

Other Tools

Related Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/zabaglione/mcp-server-unity'

If you have feedback or need assistance with the MCP directory API, please join our Discord server