Skip to main content
Glama
xinyuzjj

Godot MCP Enhanced

by xinyuzjj

launch_editor

Open the Godot editor for a project by specifying its directory path.

Instructions

Launch Godot editor for a specific project

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
projectPathYesPath to the Godot project directory

Implementation Reference

  • src/index.ts:458-475 (registration)
    Registration of the 'launch_editor' tool in the setupToolHandlers method, defining its name, description, and input schema (requires projectPath).
    private setupToolHandlers(): void {
      this.server.setRequestHandler(ListToolsRequestSchema, async () => ({
        tools: [
          // Project Management
          {
            name: 'launch_editor',
            description: 'Launch Godot editor for a specific project',
            inputSchema: {
              type: 'object',
              properties: {
                projectPath: {
                  type: 'string',
                  description: 'Path to the Godot project directory',
                },
              },
              required: ['projectPath'],
            },
          },
  • The handleLaunchEditor method: validates projectPath, detects Godot path, checks for project.godot file, then spawns the Godot editor using 'godot -e --path <project>'.
    private async handleLaunchEditor(args: any): Promise<ToolResult> {
      args = this.normalizeParameters(args);
    
      if (!args.projectPath) {
        return this.createErrorResponse('Project path is required');
      }
    
      if (!this.validatePath(args.projectPath)) {
        return this.createErrorResponse('Invalid project path');
      }
    
      try {
        if (!this.godotPath) {
          await this.detectGodotPath();
          if (!this.godotPath) {
            return this.createErrorResponse('Could not find a valid Godot executable path');
          }
        }
    
        const projectFile = join(args.projectPath, 'project.godot');
        if (!existsSync(projectFile)) {
          return this.createErrorResponse(`Not a valid Godot project: ${args.projectPath}`);
        }
    
        this.logDebug(`Launching Godot editor for project: ${args.projectPath}`);
        const process = spawn(this.godotPath, ['-e', '--path', args.projectPath], {
          stdio: 'pipe',
        });
    
        process.on('error', (err: Error) => {
          console.error('Failed to start Godot editor:', err);
        });
    
        return this.createSuccessResponse(`Godot editor launched successfully for project at ${args.projectPath}.`);
      } catch (error: unknown) {
        const errorMessage = error instanceof Error ? error.message : 'Unknown error';
        return this.createErrorResponse(`Failed to launch Godot editor: ${errorMessage}`);
      }
    }
  • Input schema for launch_editor: takes a required 'projectPath' string parameter describing the path to the Godot project directory.
    inputSchema: {
      type: 'object',
      properties: {
        projectPath: {
          type: 'string',
          description: 'Path to the Godot project directory',
        },
      },
      required: ['projectPath'],
    },
  • validatePath helper used by handleLaunchEditor to check path validity (rejects null/undefined and paths containing '..').
    private validatePath(path: string): boolean {
      if (!path || path.includes('..')) {
        return false;
      }
      return true;
    }
  • detectGodotPath helper used by handleLaunchEditor to find the Godot executable path from environment variable or common system paths.
    private async detectGodotPath(): Promise<void> {
      if (this.godotPath && await this.isValidGodotPath(this.godotPath)) {
        this.logDebug(`Using existing Godot path: ${this.godotPath}`);
        return;
      }
    
      if (process.env.GODOT_PATH) {
        const normalizedPath = normalize(process.env.GODOT_PATH);
        this.logDebug(`Checking GODOT_PATH environment variable: ${normalizedPath}`);
        if (await this.isValidGodotPath(normalizedPath)) {
          this.godotPath = normalizedPath;
          this.logDebug(`Using Godot path from environment: ${this.godotPath}`);
          return;
        }
      }
    
      const osPlatform = process.platform;
      this.logDebug(`Auto-detecting Godot path for platform: ${osPlatform}`);
    
      const possiblePaths: string[] = ['godot'];
    
      if (osPlatform === 'darwin') {
        possiblePaths.push(
          '/Applications/Godot.app/Contents/MacOS/Godot',
          '/Applications/Godot_4.app/Contents/MacOS/Godot',
          `${process.env.HOME}/Applications/Godot.app/Contents/MacOS/Godot`,
          `${process.env.HOME}/Applications/Godot_4.app/Contents/MacOS/Godot`,
          `${process.env.HOME}/Library/Application Support/Steam/steamapps/common/Godot Engine/Godot.app/Contents/MacOS/Godot`
        );
      } else if (osPlatform === 'win32') {
        possiblePaths.push(
          'C:\\Program Files\\Godot\\Godot.exe',
          'C:\\Program Files (x86)\\Godot\\Godot.exe',
          'C:\\Program Files\\Godot_4\\Godot.exe',
          'C:\\Program Files (x86)\\Godot_4\\Godot.exe',
          `${process.env.USERPROFILE}\\Godot\\Godot.exe`
        );
Behavior2/5

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

No annotations are provided, so the description must disclose behavioral traits. It only says 'launch', which is vague and does not specify side effects (e.g., whether it blocks, opens a new window, or affects existing editor sessions). The description lacks transparency for an action that may require user interaction or have system impact.

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

Conciseness4/5

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

The description is a single sentence that is concise and front-loaded with the verb and resource. It avoids unnecessary words, but it could be slightly more structured to include key context without adding length.

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 low complexity (one required parameter, no output schema), the description is minimally adequate. However, it does not mention that the project path must be valid or that the editor may need to be installed, leaving potential gaps for an agent unfamiliar with Godot.

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?

The input schema has 100% coverage with a clear description for the single parameter 'projectPath'. The tool description adds no extra semantics beyond the schema, meeting the baseline for a simple parameter.

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 action 'launch' and the resource 'Godot editor for a specific project', making the purpose unambiguous. It also distinguishes from siblings like run_project which executes the project rather than opening the editor.

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

Usage Guidelines2/5

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

The description only says 'for a specific project' which implies a prerequisite, but it does not provide explicit guidance on when to use this tool versus alternatives like run_project or other project management tools. No examples or exclusion criteria are given.

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/xinyuzjj/godot-mcp'

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