MCP Server

MCP ServerπŸ”—

LocalGPT Gen can run as an MCP (Model Context Protocol) server, exposing the gen tools over stdio. This lets desktop AI apps β€” Claude Desktop, Codex Desktop β€” coding agents, and MCP-compatible editors like VS Code, Zed, and Cursor drive the Bevy 3D window directly.

Why MCP?πŸ”—

LocalGPT Gen runs no model of its own: the window and the tools that build in it are the whole binary, and whatever drives them runs in another process β€” Claude Desktop, Codex Desktop, a coding agent in a terminal, an editor’s built-in AI.

MCP is how they reach it. It’s a standard protocol that these tools already support. By running localgpt gen mcp-server (which forwards to localgpt-app gen mcp-server when the desktop app is installed, or to localgpt-gen mcp-server), the Bevy window opens and all gen tools become available to any MCP client over stdio. The client is the orchestrator β€” it manages the conversation, calls tools, and drives the scene building β€” under its own login; Gen holds no key.

Quick StartπŸ”—

# Start Gen as an MCP server (Bevy window opens, tools served over stdio)
localgpt gen mcp-server        # or directly: localgpt-app mcp-server / localgpt-gen mcp-server

Then configure your client to spawn it (see sections below).

Available ToolsπŸ”—

The MCP server exposes the 88 gen tools, and nothing else: no memory, web, file or shell tools, and nothing that calls a model or a service.

Scene toolsπŸ”—

  • Scene query β€” gen_scene_info, gen_screenshot, gen_entity_info
  • Entity creation β€” gen_spawn_primitive, gen_spawn_batch, gen_spawn_mesh, gen_load_gltf
  • Entity modification β€” gen_modify_entity, gen_modify_batch, gen_delete_entity, gen_delete_batch
  • Camera & environment β€” gen_set_camera, gen_set_light, gen_set_environment
  • Audio β€” gen_set_ambience, gen_audio_emitter, gen_modify_audio, gen_audio_info
  • Behaviors β€” gen_add_behavior, gen_remove_behavior, gen_list_behaviors, gen_pause_behaviors
  • World skills β€” gen_save_world, gen_load_world, gen_export_world, gen_clear_scene
  • Export β€” gen_export_screenshot, gen_export_gltf, gen_export_html
  • Undo/Redo β€” gen_undo, gen_redo, gen_undo_info

See Gen Tools Reference for full documentation on each tool.

The rest of the setπŸ”—

By area, for game-like world building:

Avatar & Characters (5 tools)πŸ”—

ToolDescription
gen_spawn_playerSpawn a controllable player character with movement, camera, and collision
gen_set_spawn_pointSet spawn/respawn location for the player
gen_add_npcCreate an NPC with idle, patrol, or wander behavior
gen_set_npc_dialogueAttach a branching conversation tree to an NPC
gen_set_camera_modeSwitch camera mode (first_person, third_person, top_down, fixed)

Interactions & Triggers (5 tools)πŸ”—

ToolDescription
gen_add_triggerAdd trigger+action pairs (proximity, click, area, collision, timer)
gen_add_teleporterCreate a portal that teleports the player to a destination
gen_add_collectibleMake an entity collectible with score value and pickup effects
gen_add_doorAdd interactive door behavior with optional key requirements
gen_link_entitiesWire one entity’s event to trigger another entity’s action

Terrain & Landscape (5 tools)πŸ”—

ToolDescription
gen_add_terrainGenerate procedural terrain from Perlin/Simplex noise
gen_add_waterCreate a transparent animated water plane
gen_add_pathCreate walkable paths between waypoints
gen_add_foliageScatter vegetation (trees, bushes, grass, flowers, rocks)
gen_set_skyConfigure sky, sun direction, ambient light, and fog

In-World UI (5 tools)πŸ”—

ToolDescription
gen_add_signPlace readable billboard text in the 3D world
gen_add_hudAdd persistent screen-space HUD elements (score, health, timer)
gen_add_labelAttach a floating name label to an entity
gen_add_tooltipAdd contextual tooltips on proximity or look-at
gen_add_notificationShow transient notification messages (toast, banner, achievement)

Physics (5 tools)πŸ”—

ToolDescription
gen_set_physicsEnable physics on an entity (dynamic, static, or kinematic body)
gen_add_colliderAdd collision shapes (box, sphere, capsule, cylinder, mesh)
gen_add_jointCreate physical constraints between entities (fixed, revolute, spring, etc.)
gen_add_forceCreate force fields or apply impulses
gen_set_gravityControl gravity for the scene, in a zone, or on one entity

WorldGen Pipeline (15 tools)πŸ”—

ToolDescription
gen_plan_layoutGenerate a structured world layout plan from a text description
gen_apply_blockoutApply a blockout spec to create terrain, regions, and paths
gen_populate_regionPopulate a region with entities using three-tier placement (hero/medium/decorative)
gen_set_tierSet an entity’s placement tier (hero, medium, decorative)
gen_set_roleSet an entity’s semantic role (ground, structure, prop, vegetation, etc.)
gen_bulk_modifyModify multiple entities by role or tier (e.g., recolor all vegetation)
gen_modify_blockoutAdd, remove, resize, or move blockout regions with incremental regeneration
gen_evaluate_sceneTake a screenshot with optional entity highlighting for the agent’s own evaluation
gen_auto_refineAutomatically evaluate and improve scene quality via screenshot loop
gen_build_navmeshBuild a walkability grid for the current terrain
gen_validate_navigabilityCheck that key points are reachable via the navmesh
gen_edit_navmeshManually override navmesh cells (block, allow, add connection)
gen_regenerateRegenerate regions after blockout changes, preserving manual edits
gen_render_depthRender a depth map of the scene from a specified camera angle

No memory, web, file or shell toolsπŸ”—

Only the gen_* tools are served. An MCP client that is a coding agent has its own memory, web, file and shell tools, and Gen keeps no memory of its own: what it keeps is the worlds.

Claude DesktopπŸ”—

Add to your Claude Desktop MCP configuration:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
{
  "mcpServers": {
    "localgpt-gen": {
      "command": "localgpt-gen",
      "args": ["mcp-server"]
    }
  }
}

Restart Claude Desktop after saving. The gen tools appear in Claude’s tool list β€” ask it to build a scene:

Build a medieval castle with a moat, drawbridge, and warm torchlight

Claude will call gen_spawn_primitive, gen_set_light, gen_set_camera, etc. to construct the scene in the Bevy window.

CodexπŸ”—

Add to ~/.codex/config.toml, which Codex’s CLI and app share:

[mcp_servers.localgpt-gen]
command = "localgpt-gen"
args = ["mcp-server"]

Coding agents in a terminalπŸ”—

Claude Code, Codex and Gemini CLI take the same entry in their own MCP configs. To drive a Gen window that is already open β€” started with --mcp-relay β€” point the client at localgpt-gen mcp-server --connect instead, a bridge to that window rather than a new one: see MCP Relay.

VS Code (Copilot)πŸ”—

VS Code supports MCP servers through its Copilot agent mode. Add to your workspace .vscode/settings.json or user settings:

{
  "mcp": {
    "servers": {
      "localgpt-gen": {
        "command": "localgpt-gen",
        "args": ["mcp-server"]
      }
    }
  }
}

You can also add it via the command palette: MCP: Add Server and choose β€œstdio” transport.

Once configured, use Copilot in agent mode (@workspace) and ask it to build 3D scenes. The gen tools show up as available tools that Copilot can call.

Zed EditorπŸ”—

Add to your Zed settings (~/.config/zed/settings.json):

{
  "context_servers": {
    "localgpt-gen": {
      "command": {
        "path": "localgpt-gen",
        "args": ["mcp-server"]
      }
    }
  }
}

The gen tools become available in Zed’s agent panel.

CursorπŸ”—

Add to your Cursor MCP configuration (.cursor/mcp.json in your project or global config):

{
  "mcpServers": {
    "localgpt-gen": {
      "command": "localgpt-gen",
      "args": ["mcp-server"]
    }
  }
}

WindsurfπŸ”—

Add to your Windsurf MCP configuration (~/.codeium/windsurf/mcp_config.json):

{
  "mcpServers": {
    "localgpt-gen": {
      "command": "localgpt-gen",
      "args": ["mcp-server"]
    }
  }
}

How It WorksπŸ”—

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”       MCP stdio (JSON-RPC)        β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  MCP client         │◄──────────────────────────────────►│  localgpt-gen    β”‚
β”‚  (Claude Desktop,   β”‚        tools/list                  β”‚                  β”‚
β”‚   Claude Code,      β”‚        tools/call                  β”‚  MCP Server      β”‚
β”‚   VS Code, Zed)     β”‚                                    β”‚       β”‚          β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜                                    β”‚   GenBridge      β”‚
        β–²                                                  β”‚       ↓          β”‚
        β”‚ manages conversation,                            β”‚     Bevy         β”‚
        β”‚ decides which tools                              β”‚     3D           β”‚
        β”‚ to call and when                                 β”‚   Engine         β”‚
        β”‚                                                  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
   the client is the
   orchestrator

The MCP client is the orchestrator. It manages the conversation, decides which tools to call, and drives scene building. LocalGPT Gen provides the runtime (the Bevy 3D engine) and exposes it through standard MCP tools; it runs no agent of its own.

  1. The client spawns localgpt-gen mcp-server as a child process
  2. MCP handshake happens over stdio (JSON-RPC 2.0, one message per line)
  3. The client discovers the tools via tools/list
  4. The agent reasons about the scene and calls tools as needed β€” gen_spawn_primitive, gen_screenshot, etc.
  5. Tool calls are dispatched through the GenBridge channel to the Bevy main thread
  6. Results are sent back to the client, which continues building

A call may carry only the arguments its tool takes. One that carries another is refused before it reaches the scene, and the answer lists the arguments the tool takes, so the agent can send the call again.

Combining with Scene FileπŸ”—

You can load an existing scene while starting the MCP server:

localgpt-gen mcp-server --scene ./my-scene.glb

The agent then works on the loaded scene.

The world’s own shimπŸ”—

For a .world package an app has open, localgpt world mcp serves the package’s tools β€” submit, undo, log, tips, goto, verify, screenshot, selection β€” over stdio to any MCP client, with no window of its own; see CLI Commands.

claude mcp add world -- localgpt world mcp

TipsπŸ”—

  • Verbose logging: Add --verbose to see MCP protocol messages and tool list in stderr: localgpt-gen mcp-server --verbose
  • Binary path: If localgpt-gen is not in your $PATH, use the full path (e.g., /Users/you/.cargo/bin/localgpt-gen) in the MCP server configuration
  • One instance: Each standalone mcp-server spawns its own Bevy window. If a Gen window is already open with --mcp-relay, use --connect to reach it instead (see MCP Relay)
  • Screenshots: the agent can take screenshots via gen_screenshot to see what it built and course-correct