Setup
Connect Claude Code, Claude Desktop or Cursor to your game in one click from the editor, or configure the MCP server by hand, then select a project.
9 min read
Before you start#
You need two things:
- The Vastopia editor, installed as described in Install the editor. The MCP server ships inside it at
tools/vastopia-mcp/next to the editor executable —vastopia-mcp-win.exeon Windows,vastopia-mcp-macoson macOS. A Linux binary (vastopia-mcp-linux) is not bundled by default. - An MCP-capable AI app. The editor knows how to configure Claude Code, Claude Desktop and Cursor directly, and can show you the config to paste into anything else.
Sign in to the editor if you want the assistant to be able to publish. Without a login the assistant still authors content; it just cannot push builds (author-only mode).
Enable AI from the editor#
This is the recommended path. The editor already knows your project path, your login and the API it talks to, so it writes a complete client config with no typing.
- Open your game in the editor.
- Click the AI Off chip at the right end of the top bar (its tooltip reads "AI assistant — click to configure"). The AI Assistant window opens.
- The window's header shows the bound state — "AI: Off" and "Enable AI to let your assistant build this game." while nothing is enabled. Below it, the AI apps card lists the apps the editor can configure. Apps it could not detect on this machine carry a not detected badge; project-scoped entries (Claude Code and Cursor) are always offered, because enabling them only writes a file inside your project.
- Decide whether to leave Allow publishing (writes your API key to the config) checked. Checked, the assistant can push and deploy builds on your behalf. Unchecked, your credential never reaches the config file and publishing tools fail with a clear message.
- Click Enable beside the app you use. The result line reports something like "AI enabled for 'YourGame' (Claude Code)." — or, if you are not signed in, adds "Author-only mode — sign in to enable publishing."
- Restart or reconnect your AI app so it picks up the new server. The chip now reads AI · YourGame, and its dot turns green and pulses while the assistant is actively working.
Click Disable on the same row to remove the entry. Only the Vastopia entry is removed; any other MCP servers in that config file are left untouched.
Where the config is written#
| App entry in the window | Scope | File written |
|---|---|---|
| Claude Code | Project | <project>/.mcp.json |
| Claude Code (global) | User | ~/.claude.json |
| Claude Desktop | User | Windows: %APPDATA%\Claude\claude_desktop_config.json; macOS: ~/Library/Application Support/Claude/claude_desktop_config.json; Linux: ~/.config/Claude/claude_desktop_config.json |
| Cursor | Project | <project>/.cursor/mcp.json |
| Cursor (global) | User | ~/.cursor/mcp.json |
The editor merges its entry into whatever is already in the file, never clobbers other servers, and refuses to write at all if the existing file cannot be parsed (it tells you to fix or remove it first).
Other apps: copy the config#
Click Show config for other apps at the bottom of the window to reveal the exact JSON the editor would write, ready to paste into any MCP client's configuration. The entry is keyed vastopia under mcpServers and looks like this on Windows:
{
"mcpServers": {
"vastopia": {
"command": "<editor install folder>/tools/vastopia-mcp/vastopia-mcp-win.exe",
"args": [],
"env": {
"VASTOPIA_PROJECT": "C:/Users/you/VastopiaProjects/MyGame",
"VASTOPIA_WORKSPACE": "C:/Users/you/VastopiaProjects",
"VASTOPIA_API_URL": "https://vastopia-api-8a231eb9cc69.herokuapp.com/api",
"VASTOPIA_ACTOR": "yourusername",
"VASTOPIA_API_KEY": "…"
}
}
}
}
VASTOPIA_API_KEY is present only when you are signed in and Allow publishing is checked; with it unchecked the editor writes "VASTOPIA_PUBLISHING": "off" instead, which also stops the server from quietly reading your login out of the editor's own files. While the live bridge is running the entry additionally carries VASTOPIA_EDITOR_BRIDGE and VASTOPIA_EDITOR_TOKEN.
The live editor bridge#
Enabling any app while a project is open also starts the editor bridge: a loopback listener on 127.0.0.1 with a per-session token. It is what lets the assistant look at and drive your running editor. You never start it by hand.
- The bridge is re-pointed automatically when you open a different project, so an assistant can never be aimed at the wrong game.
- Disabling the last enabled app stops the bridge.
- A server that was launched before the editor opened finds the bridge anyway through a hot-attach file the editor writes, so the usual ordering (AI app first, editor second) just works.
- With no editor running, bridge-dependent tools report
connected: falseand explain — that is a normal state, not an error, and every file-based tool still works.
Manual setup#
If you run the server yourself — on a machine without the editor, in a terminal, or pointed at a different API — everything is configured through environment variables. None are required: with nothing set, the server looks for a folder of games near its own location and stops with a message if it finds none.
| Variable | What it does | Default |
|---|---|---|
VASTOPIA_WORKSPACE | Folder containing your game projects. Enables workspace mode (list_projects / select_project / create_project) so one connection can drive every game. | The nearest folder above the server that contains games |
VASTOPIA_PROJECT | Pin the server to one project directory. Required by the HTTP transport. | Unset (workspace mode) |
VASTOPIA_EDITOR_PROJECT | Path to the editor's own Godot project, for headless Godot work. | Derived from the server's location |
VASTOPIA_API_KEY | Platform API key. Without it every publishing tool is listed but fails loudly. | Unset, unless the editor supplied a login |
VASTOPIA_API_URL | Platform API base URL (point at a local API for development). | The production API |
VASTOPIA_PUBLISHING | Set to off to withhold the editor's credential even when one is available. | On when credentials exist |
VASTOPIA_ACTOR | Who mutations are attributed to in the audit log and rate limiter. | local |
VASTOPIA_EDITOR_BRIDGE / VASTOPIA_EDITOR_TOKEN | Address and token of a running editor's bridge. The editor injects these; set them by hand only to target a specific instance. Without the token the bridge is treated as unavailable. | Unset |
VASTOPIA_BRIDGE_TIMEOUT_SCALE | Multiply every bridge deadline (ping 5 s up to export_pck 600 s) on a slow machine. | 1 |
VASTOPIA_RATE_MAX | Mutating calls allowed per actor per minute. A malformed value is ignored, not treated as "no limit". | 120 |
VASTOPIA_BLENDER / VASTOPIA_BLENDER_TIMEOUT | Blender binary for FBX/OBJ import, and seconds allowed per conversion. | Discovered on PATH and usual install locations; 180 |
VASTOPIA_GODOT (or GODOT_PATH) | A Godot 4 binary for headless operations such as editor-free icon renders and PCK export. | Discovered |
VASTOPIA_HTTP_PORT / VASTOPIA_HTTP_TOKEN / VASTOPIA_HTTP_HOST / VASTOPIA_HTTP_ALLOW_REMOTE | Serve MCP over Streamable HTTP instead of stdio. Single-project only; refuses to start without a bearer token, and refuses a non-loopback host unless VASTOPIA_HTTP_ALLOW_REMOTE=yes. | Unset (stdio); host 127.0.0.1 |
On startup the server prints one line to its error stream, which your AI app usually shows in its MCP logs:
Vastopia MCP ready. Workspace: C:/Users/you/VastopiaProjects. Active project: C:/Users/you/VastopiaProjects/MyGame. Publishing: enabled (signed in as yourusername).
If the editor login is not being reused you will see Publishing: off (log in via the editor, or set VASTOPIA_API_KEY).
Select a project#
In workspace mode the server starts with no active game unless VASTOPIA_PROJECT is set or exactly one game exists in the workspace. The editor always sets VASTOPIA_PROJECT to the open game, so from the editor you can skip this.
| Tool | What it does |
|---|---|
list_projects | Lists every game in the workspace (directory, name, game_id) and marks the active one. A project is any folder containing project.vastopia, at the workspace root or one level down. |
get_active_project | Reports the selected game, or a hint to select one. Also reports the server's build stamp (version, commit, build time). |
select_project | Switches the active game by directory name, game name or game_id. An ambiguous name is refused rather than guessed. |
create_project | Scaffolds a new minimal game in the workspace (project.vastopia, assets/, server/), initialises a git repository with a suitable .gitignore, and makes it active. |
A project created by create_project is a bare skeleton, not a copy of the editor's template: it has no maps, no animation bases and no gameplay systems. Use the editor's New Project wizard (see Create your first game) when you want the template content, then point the assistant at it.
Check editor status and refresh#
These tools close the loop between files on disk and what you see in the editor.
| Tool | What it does |
|---|---|
get_editor_status | Which editor mode is active, which map is open, which editors have unsaved changes and which files are at risk, the open project, and whether you are signed in. Returns connected: false when no editor is running. |
refresh_editor | Re-reads the open map's region elements (NPC spawners, objects, locations, trigger zones) so you see what was written without reopening the map. Placement tools call this for you. It refuses when the map has unsaved changes, and only force: true overrides that. |
show_in_editor | Switches the editor to the Map Editor, opens a map, and optionally centres the camera on a tile. |
screenshot_editor | Returns a PNG of the editor viewport (downscaled to 1024 px on the long edge by default) so the assistant can look at what it built. |
A good first exchange after setup is to ask the assistant to call get_project_summary and get_editor_status. The first proves the server sees your project; the second proves the bridge is up.
Troubleshooting#
| Symptom | Cause and fix |
|---|---|
| The AI Assistant window shows "AI server is not bundled yet" | The editor install has no tools/vastopia-mcp/ binary beside it. Reinstall the editor, or follow the message's build instructions if you work from source. |
| The server exits with "no games found near this server" | It was launched by hand with no configuration and found no project.vastopia nearby. Set VASTOPIA_WORKSPACE to your games folder or VASTOPIA_PROJECT to one game. |
| Publishing tools answer "Publishing tools need a Vastopia API key" | The config was written in author-only mode, or VASTOPIA_PUBLISHING=off is set. Sign in, check Allow publishing, and click Disable then Enable on the app row to rewrite the config. |
Bridge tools say connected: false while the editor is open | The bridge only runs while an app is enabled and a project is open — confirm the chip reads AI · YourGame. If it does and the tools still report no editor, click Disable then Enable on the app row, which restarts the bridge and rewrites the config. |
| A documented tool is missing | Your bundled server is older than these docs. Ask the assistant for get_active_project and note the build stamp; update the editor to get the current server. |
| The chip says AI Off even though you enabled an app | Enabled state is read from the config file on disk. If that file was deleted or edited by hand, click Enable again. |
