Skip to content
SiteEmail

The Gameface MCP server connects a coding agent to a running Gameface Player through the Chrome DevTools Protocol .

Once connected, the agent reads Gameface’s own warnings, inspects the DOM it produced, captures screenshots, and checks that text fits inside its box, rather than describing what it expects to have built.

Without a connection, every iteration routes through a person. The agent writes markup, someone runs the Player or Game, someone describes what looks wrong, and the agent revises. What the agent never observes is what Gameface did with its code—the information that settles the question.

The console is the clearest signal. Gameface warns about CSS it cannot resolve, diagnosing Gameface-specific bugs faster than any other available feedback. That warning means nothing while it sits unread.

  • Node.js 18+, since the server uses the global fetch API.
  • A local Gameface SDK with a Player executable. The repository does not ship one, so a Gameface licence and SDK are required. On Windows the executable normally sits at .../Player/Player.exe. Note that Player.exe lives in a Player subfolder under the SDK root rather than at the root itself.
  • Gameface 3.1.2 or newer, for the reasons covered in Version Awareness.
  1. Terminal window
    git clone https://github.com/CoherentLabs/Gameface-MCP.git
    cd Gameface-MCP
    npm install
    npm run build

    The build compiles src/ into build/, producing build/index.js. Every client configuration points at that path.

  2. Create ~/.gameface-mcp/config.json. This file belongs to the machine rather than to a project, because the server is reused across every game repository:

    ~/.gameface-mcp/config.json
    {
    "browserExecutable": "D:/path/to/your/sdk/Player/Player.exe",
    "browserArgs": ["--enable-gui=false"],
    "port": 9444,
    "cdpHost": "localhost"
    }

    Every field is optional, and browserArgs are merged into every launch.

  3. Select the client below. With the config file from step two in place, the args array needs nothing beyond the path to build/index.js, since the Player path and port are picked up automatically.

Create .mcp.json at the project root:

.mcp.json
{
"mcpServers": {
"gameface": {
"command": "node",
"args": ["/absolute/path/to/Gameface-MCP/build/index.js"]
}
}
}

These tools are rarely invoked by hand. Knowing what exists establishes what can reasonably be requested, and what to demand evidence of.

ToolFunction
get_console_logsBuffered console output plus Log-domain entries, including unsupported-feature warnings
get_computed_stylesComputed CSS for a node, meaning what Gameface kept rather than what was written
get_dom_tree / search_domSnapshot of the DOM, or nodes matching a text or XPath query
take_screenshotFull page, viewport, or a custom clip rect
eval_jsRuns JavaScript in the connected page
interact_elementClick, type, hover, focus, scroll into view, or touch
AssertionCheck performed
assert_text_fitsWhether an element’s content overflows its own box
assert_no_overlapWhether two elements’ rendered boxes intersect
assert_within_parentWhether an element stays inside its parent, an ancestor, or the viewport

perf_lint is a static check for expensive layout patterns like align-items: stretch, unsized flex items, and misuse of display: simple. No timing involved, so it does not flake.

perf_measure runs a fixed frame-timing scenario and reports p50, p95, and p99 against a recorded baseline.

Alongside the tools, the server exposes the documentation corpus and the engine constraints as MCP resources, gameface://code-instructions and gameface://rag/<file>.md. The next article covers both.

Gameface 3.1.2 or newer is required. This version introduced CDP protocol support, including engine logs through the Chrome DevTools Protocol.

The minimum version is verified at connection time via cohtmlVersion. Some older versions have CDP quirks that the server works around, but a tool returning unexpected output may indicate an engine-side gap.

Ask the agent to launch the Player and screenshot the current view. An image and a cohtmlVersion returning together confirm a live connection. A description of what the agent expects the screen to look like means the server is not connected.