NeoStack AI

Gemini CLI

Using Google's Gemini CLI as your AI agent

Gemini CLI provides access to Google's Gemini models with a generous free tier.

Video Tutorial

Setup

  1. Install Gemini CLI:

    npm install -g @google/gemini-cli
  2. Authenticate using one of these methods:

    • Google Account — Run gemini and sign in when prompted
    • API Key — Set GEMINI_API_KEY environment variable
    • Vertex AI — Set GOOGLE_CLOUD_PROJECT and GOOGLE_APPLICATION_CREDENTIALS
  3. Open the Agent Chat window in Unreal and select Gemini CLI from the agent dropdown

The plugin launches Gemini CLI with the --acp flag and passes the Unreal MCP server URL automatically via the ACP session/new request. No manual MCP configuration is needed.

MCP Server Configuration (Standalone Use)

If you want to use Gemini CLI outside the editor's chat panel (standalone terminal), configure the MCP server connection manually.

Via CLI Command

gemini mcp add unreal-editor http://localhost:9315/mcp --transport http

Manual Configuration

Add the following to your ~/.gemini/settings.json (Linux/macOS) or %APPDATA%\gemini\settings.json (Windows):

{
  "mcpServers": {
    "unreal-editor": {
      "httpUrl": "http://localhost:9315/mcp"
    }
  }
}

Gemini CLI supports Streamable HTTP MCP servers via the httpUrl field. Use http://localhost:9315/mcp (not /sse).

The MCP server starts automatically when Unreal Editor launches with the plugin enabled. Make sure Unreal Editor is running before starting Gemini CLI.

Features

  • Multiple Gemini models (2.5 Pro, 2.5 Flash, 2.5 Flash Lite, 3 Pro Preview, 3 Flash Preview)
  • Model is selected at launch time — use the model dropdown in the chat panel before starting a session
  • Web search and URL context tools
  • Sandbox execution environment
  • Each new chat session spawns a fresh Gemini CLI process

Available Tools

The plugin exposes a single tool: execute_script — a Lua scripting engine with access to all Unreal Editor operations.

The agent writes Lua scripts that call built-in functions to interact with the editor. Key capabilities include:

  • open_asset(path) — Load and inspect any asset (Blueprints, materials, animations, sequences, etc.)
  • create_asset(path, type) — Create new assets (30+ types)
  • find_assets(path) / find_blueprints(path) — Search the Asset Registry
  • Graph operations — Add/delete/connect nodes, set pin values, layout graphs
  • Blueprint editing — Variables, components, functions, events, widgets, state machines
  • Animation, Materials, Sequencer, AI, Audio, Level Design — Full editor coverage via 85+ Lua bindings

Agents discover detailed APIs by calling help('domain_name') within their scripts.

Pricing

Gemini CLI offers a generous free tier through Google AI Studio. Check Google AI Studio for current limits.

Custom Path

If your Gemini CLI installation is in a non-standard location, set the path in Project Settings > Plugins > Agent Integration Kit > Gemini CLI Path.

Troubleshooting

IssueSolution
MCP tools not availableEnsure Unreal Editor is running and the plugin is enabled
Connection refusedCheck that the MCP server port (default 9315) is not blocked
Wrong portVerify the port in Project Settings > Plugins > Agent Integration Kit > Server Port
Tools timing outThe default tool execution timeout is 60 seconds. Adjust in Project Settings > Plugins > Agent Integration Kit > Tool Execution Timeout

Reset MCP Configuration (Standalone)

If you're having persistent connection issues with standalone Gemini CLI:

gemini mcp remove unreal-editor
gemini mcp add unreal-editor http://localhost:9315/mcp --transport http

Debug Mode

Run Gemini CLI with debug logging to see detailed connection info:

gemini --log-level debug

The MCP server runs on http://localhost:9315/mcp by default. You can change the port in Project Settings > Plugins > Agent Integration Kit > Server Port. If the default port is occupied, the plugin scans up to 10 higher ports automatically.

On this page