Skip to main content
Glama

setup_unity_bridge

Install or update Unity MCP bridge scripts to enable Claude to interact with Unity projects, even when Unity server is not running.

Instructions

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

Input Schema

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

Implementation Reference

  • Handler for 'setup_unity_bridge' tool in executeTool method. Validates input, calls UnityBridgeDeployService.deployScripts, and returns success/error message.
    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}`);
      }
    }
  • Registration of the tool in getTools() array, defining 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']
      }
    },
  • Input schema definition for the tool parameters: projectPath (required string), forceUpdate (optional boolean).
    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']
    }
  • Core helper method that validates the Unity project, creates necessary directories, and deploys the MCP bridge scripts (UnityHttpServer.cs and UnityMCPServerWindow.cs) with version checking and meta file generation.
    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');
    }
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It adds useful context about working 'even if Unity server is not running,' which is valuable operational insight. However, it doesn't cover other behavioral aspects like permissions needed, whether it modifies project files destructively, error handling, or output format, leaving gaps for a mutation tool.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that front-loads the core purpose and includes a key operational detail. Every word earns its place with no redundancy or fluff, making it highly concise and well-structured for quick understanding.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (a mutation operation with 2 parameters), lack of annotations, and no output schema, the description is minimally adequate. It covers the basic purpose and a key behavioral trait but omits details on prerequisites, side effects, or return values, which are important for safe usage in this context.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already fully documents both parameters (projectPath and forceUpdate). The description doesn't add any meaning beyond what the schema provides, such as explaining the implications of 'forceUpdate' or typical projectPath formats. Baseline 3 is appropriate when the schema does the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the specific action ('Install/update') and target resource ('Unity MCP bridge scripts to a Unity project'), distinguishing it from sibling tools like folder operations or script/shader management. It explicitly mentions the unique capability of working without the Unity server running, which sets it apart from other tools.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides clear context for when to use this tool ('Install/update Unity MCP bridge scripts') and implicitly suggests it's for setup/maintenance tasks. However, it doesn't explicitly state when not to use it or name alternatives among siblings (e.g., vs. script_create or project_info), missing full comparative guidance.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other 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