Driving XGENIA from Claude Code
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.
| Direction | What it means | Where it is documented |
|---|---|---|
| Into XGENIA | The Chat panel calls tools on your servers — your API, a docs server, a database | MCP Servers |
| Out of XGENIA | An outside agent — Claude Code — drives the editor itself | This 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 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) | |
|---|---|---|
| Runs | In your terminal or IDE | In the editor's Chat panel, on XGENIA's server |
| Knows | Your goal, your repo, your judgement calls | XGENIA's nodes, ports, components and art pipeline |
| Does | Writes the brief, watches the build, checks the result, recovers the editor | Builds the graph, wires the logic, generates the art |
| Is paid by | Your Claude plan | Your 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_readandxgenia_preview_clickread 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_healthandxgenia_chat_readreport 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_exportpulls the panel's own record — every tool call with its arguments and result, the thinking log, both consoles, the token spend — andxgenia_debug_querygreps inside it. - Watch the live engine.
xgenia_runtime_logsreads the running preview's log buffer directly. - Recover a wedged editor.
xgenia_restartsaves, kills the right process tree, relaunches, and reopens the project.
Requirements
| Requirement | Detail |
|---|---|
| XGENIA installed | Or a checkout you can run npm run dev from |
| Signed in once, by hand | The 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 XGENIA | The panel the chat tools drive needs one. See Getting Started |
| Node 18+ and git | For the server process and the clone |
| Claude Code | Or 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.
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 toolsA 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.
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
| Variable | Purpose |
|---|---|
XGENIA_CDP_PORT | Override the debugging port (default 9223) |
XGENIA_APP_PATH | Path to an installed XGENIA binary |
XGENIA_REPO_DIR | Path to a checkout, for target: "dev" |
XGENIA_ENABLE_CDP | 1 opens the debugging port on a release build you start yourself — the same as --xgenia-cdp |
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
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:
- 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:
| Build | macOS | Windows |
|---|---|---|
| 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:
| Error text | What it means | What to do |
|---|---|---|
All providers have been ignored | Your OpenRouter privacy settings block every provider that serves this model | Pick a free model whose provider you have allowed, or allow one for this model |
This model is unavailable for free | The :free variant was withdrawn | Pick another model |
Rate limit exceeded: free-models-per-day | The account's daily free quota is used up. It covers every free model at once, so switching to another free model does not help | Wait 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-missingorpreview-frame-missingwhile the panel is plainly open on screen.xgenia_probegives it away:chatIframefound,chatFramenot found. The fix — readinglocation.hreffrom 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\.
Read next
- Build a Game with Claude Code — a full run, from brief to checked game, with every screen.
- MCP Tool Reference — all 19 tools, their arguments, and the error codes.
- The xgenia-mcp Skill — how to prompt the panel, the traps that make a working call look broken, and recovery.
- MCP Servers — the other direction: giving the Chat panel your own tools.