Skip to main content

Driving XGENIA from Claude Code

Early Alpha

The XGENIA MCP server is in early alpha. Tool names and result fields change between builds.

MCP runs in two directions, and it is worth being clear which one this page is about.

DirectionWhat it meansWhere it is documented
Into XGENIAThe Chat panel calls tools on your servers — your API, a docs server, a databaseMCP Servers
Out of XGENIAAn outside agent — Claude Code — drives the editor itselfThis page

The xgenia plugin for Claude Code is the second one. It bundles an MCP server that attaches to the XGENIA desktop app over the Chrome DevTools Protocol, and a skill that teaches Claude how to use it. Together they give Claude 19 tools: launch the editor, open or create a project, type prompts into the XGENIA AI panel, read the conversation back, read and click the running game itself, screenshot any part of the window, pull the debug export, and restart the app when it wedges.

Claude Code driving a Samurai slot build in XGENIA: the brief it sent is in the XGENIA AI panel, the key art the panel generated is in the preview

Claude Code sent the brief on the left. The XGENIA AI panel generated the key art and placed it in the preview. Claude Code took this screenshot. Nobody touched the editor.

How it fits together​

There are two AIs in this setup, and keeping their jobs apart is the whole trick.

Claude Code (outside)XGENIA AI (inside the editor)
RunsIn your terminal or IDEIn the editor's Chat panel, on XGENIA's server
KnowsYour goal, your repo, your judgement callsXGENIA's nodes, ports, components and art pipeline
DoesWrites the brief, watches the build, checks the result, recovers the editorBuilds the graph, wires the logic, generates the art
Is paid byYour Claude planYour OpenRouter key, plus fal.ai for art
Claude Code ──MCP (stdio)──▶ xgenia MCP server ──CDP :9223──▶ XGENIA editor
+ xgenia-mcp skill ├─ XGENIA AI panel ◀─ chat_send / chat_read
└─ game preview ◀─ preview_read / preview_click

Claude Code is the producer. It describes what the game should do, keeps an eye on cost and progress, and gets first-hand evidence from the running game. The XGENIA AI panel is the builder. It knows the editor far better than any outside agent, so it is told what to build, never how. Build a Game with Claude Code walks through a full run.

What you can do with it​

  • Build a game end to end without touching the editor. Send the brief, watch the build, press SPIN yourself, screenshot the result.
  • Get evidence, not claims. xgenia_preview_read and xgenia_preview_click read the running game's own DOM and press its buttons. "The balance drops by the bet" becomes something Claude checks, not something it takes the panel's word for.
  • Keep a build on budget. xgenia_health and xgenia_chat_read report the panel's active model and running $ cost, so a run on the wrong model is caught before it gets expensive.
  • Test XGENIA itself. Drive the same flow repeatedly and compare what happened against what the panel says happened.
  • Debug a session after the fact. xgenia_debug_export pulls the panel's own record — every tool call with its arguments and result, the thinking log, both consoles, the token spend — and xgenia_debug_query greps inside it.
  • Watch the live engine. xgenia_runtime_logs reads the running preview's log buffer directly.
  • Recover a wedged editor. xgenia_restart saves, kills the right process tree, relaunches, and reopens the project.

Requirements​

RequirementDetail
XGENIA installedOr a checkout you can run npm run dev from
Signed in once, by handThe harness detects the login screen and stops. There is no tool, flag or environment variable that types, stores or reads a password
An OpenRouter key in XGENIAThe panel the chat tools drive needs one. See Getting Started
Node 18+ and gitFor the server process and the clone
Claude CodeOr any other MCP client — nothing here is Claude-specific except the plugin packaging

Install​

The plugin's server lives in the XGENIA repository, next to the plugin, and is built from source. So install it from a local clone, which Claude Code runs in place:

git clone https://github.com/XgeniaORG/xgenia.git ~/.claude/plugins/sources/xgenia
cd ~/.claude/plugins/sources/xgenia/packages/xgenia-mcp-server
npm install && npm run build
claude plugin marketplace add ~/.claude/plugins/sources/xgenia
claude plugin install xgenia@xgenia

Restart Claude Code. /mcp should list plugin:xgenia:xgenia — Connected, and asking for /xgenia-mcp should offer the skill.

To update later: git pull in the clone, npm run build in the server folder, then claude plugin marketplace update xgenia and restart Claude Code.

Build the server before the first start

The server's dist/ folder is not committed. Without it, the plugin's launcher runs npm install and npm run build on first start — which takes longer than Claude Code's 30-second MCP connect timeout, so /mcp shows "connection timed out after 30000ms". The npm run build step above avoids that.

/plugin marketplace add XgeniaORG/xgenia gives you the skill, not the tools

A marketplace added straight from GitHub copies only the plugin's own folder into Claude Code's plugin cache. The launcher looks for the server at ../../../packages/xgenia-mcp-server, which is not in the cache, so it exits before the server starts. The skill loads; no xgenia_* tools appear. Use the local clone above until the server is published to npm.

GitHub over SSH

If your ~/.gitconfig rewrites GitHub URLs to an SSH host alias — an insteadOf rule pointing https://github.com/XgeniaORG/ at something like git@github.com-work: — Claude Code's own clone of a GitHub marketplace can fail with "Permission denied (publickey)" even though plain git clone works. Cloning it yourself, as above, sidesteps that too.

Installing the pieces by hand​

If you would rather not use the plugin system, the server and the skill install separately:

cd xgenia/packages/xgenia-mcp-server && npm install && npm run build
claude mcp add xgenia -- node "$PWD/dist/index.js"
cp -r xgenia/plugins/xgenia/skills/xgenia-mcp ~/.claude/skills/

The package is not on npm: npx -y xgenia-mcp and @xgenia/mcp-server both fail.

Launching XGENIA for the harness​

Dev builds always open the debugging port, 9223. Release builds open it only when the harness starts them — it passes --xgenia-cdp. An XGENIA you opened by hand from the Start menu or Dock cannot be attached to: quit it, and let xgenia_launch start it.

If XGENIA is not where the harness expects it, point XGENIA_APP_PATH at the binary. On Windows the default install is %LOCALAPPDATA%\Programs\xgenia-editor\XGENIA.exe.

Environment​

VariablePurpose
XGENIA_CDP_PORTOverride the debugging port (default 9223)
XGENIA_APP_PATHPath to an installed XGENIA binary
XGENIA_REPO_DIRPath to a checkout, for target: "dev"
XGENIA_ENABLE_CDP1 opens the debugging port on a release build you start yourself — the same as --xgenia-cdp
Launching by hand from an Electron-based IDE

VS Code, Cursor and similar export ELECTRON_RUN_AS_NODE=1 for their own embedded Node. The electron binary then runs as plain Node and XGENIA dies with TypeError: Cannot read properties of undefined (reading 'getVersion'). The harness strips that variable from anything it spawns, so xgenia_launch is unaffected — only a manual launch from such a terminal is. Unset it, or let xgenia_launch start the app.

Your first session​

You do not have to call the tools yourself. Ask Claude Code in plain language — "open my Samurai Slots project in XGENIA and ask its AI what is in it" — and the skill picks the sequence. Under the hood it looks like this:

xgenia_health → running? project open? chat mounted? busy? model? cost?
xgenia_launch { target: "app" } → only if not running
xgenia_open_project { name } → or xgenia_new_project { name }
(check chatModel and chatCost here — see below)
xgenia_chat_send { text, waitIdle: false }
xgenia_chat_read { since: <last total> } → poll; stop a run that goes astray
xgenia_chat_wait_idle → when it is nearly done
xgenia_preview_click { label: "Spin", times: 3, readLabel: "Balance" }
xgenia_screenshot { region: "full" }

Every tool returns error, tried and hint on failure instead of throwing. hint says what to do next — read it before deciding anything.

Use waitIdle: true on xgenia_chat_send for a short question. For a build, send with waitIdle: false and poll xgenia_chat_read, so a run that is going astray can be stopped instead of paid for.

Check the model before a long run​

This is the expensive mistake

One slot build ran on a model nobody chose and cost $94.63 across 29 messages, exhausting the OpenRouter account mid-session. The stored model id was malformed, did not resolve, and the request went out on whatever the live list surfaced.

xgenia_health and xgenia_chat_read both return the panel's active model, running cost and context usage as text (chatModel, chatCost, chatContextUsage). Read them before any run longer than a couple of turns. They are the same figures the panel shows when you click the cost in its footer:

Usage details popover: model, input and output tokens, cache tokens, total cost, context
  • The model is picked in the panel's model menu, bottom-left. The default is GLM 5.3 Flash.
  • Dev and packaged builds have different profiles, and therefore different models. Switching between them switches the model. Re-check after any switch.

The model is also stored per profile in editorSettings.json, under settings.aiProvider.providers.openrouter.model:

BuildmacOSWindows
Packaged app~/Library/Application Support/XGENIA/editorSettings.json%APPDATA%\XGENIA\editorSettings.json
Dev build~/Library/Application Support/Electron/editorSettings.json%APPDATA%\Electron\editorSettings.json

Two rules if you edit it:

  • That file contains your OpenRouter API key. Print only the fields you need — never dump the whole file into a transcript.
  • Quit XGENIA first (xgenia_quit), or the running app overwrites your change.

Running on free models​

Free OpenRouter models cost nothing, which makes them tempting for long unattended builds. Their limits arrive as Model Error cards in the panel — and so in xgenia_chat_read — not as tool failures:

Two Model Error cards: a free model that is no longer free, and the free-models-per-day rate limit
Error textWhat it meansWhat to do
All providers have been ignoredYour OpenRouter privacy settings block every provider that serves this modelPick a free model whose provider you have allowed, or allow one for this model
This model is unavailable for freeThe :free variant was withdrawnPick another model
Rate limit exceeded: free-models-per-dayThe account's daily free quota is used up. It covers every free model at once, so switching to another free model does not helpWait for the daily reset, or add OpenRouter credits to raise the quota

The panel already retries a 429 four times over about two minutes before it shows the card, so do not resend straight away. Free models are also weaker at using tools: expect more retries, duplicate nodes and "let me take a fresh approach" loops than on the default model.

Windows notes​

  • Known issue: blank frame URLs. On Windows, the chat panel and the preview are out-of-process iframes, and a harness that attaches after they have loaded can see their URL as empty. Every chat and preview tool finds its frame by URL, so this shows up as chatMounted: false, chat-frame-missing or preview-frame-missing while the panel is plainly open on screen. xgenia_probe gives it away: chatIframe found, chatFrame not found. The fix — reading location.href from inside a frame whose URL comes back empty — is not in the published server yet.
  • Paths. Settings live under %APPDATA%, the app under %LOCALAPPDATA%\Programs\xgenia-editor\.
Was this page helpful?