Coding agents¶
Video: Let your coding agent use the farm (0:56).
Hearth gives coding agents two things:
- An MCP server,
hearth mcp, so an agent can look at the farm itself: which pools are ready, which sessions failed and why, their videos, a live screenshot of a running session. - Agent skills: short, precise instructions for setting up a farm, connecting a test suite,
debugging a session and adding devices. Install them with
hearth skills install, or add the repository as a Claude Code plugin marketplace.
Neither needs your API key in the chat. The key stays in your environment or in the cluster.
Let your agent set it up¶
Paste this into your coding agent in your test project's folder:
Set up Hearth (open-source browser and device farm for Kubernetes, https://test-zeus-ai.github.io/testzeus-hearth) for this
project's end-to-end tests. Follow https://test-zeus-ai.github.io/testzeus-hearth/guide/coding-agents/ and the hearth-setup
and hearth-connect-tests skills (after `hearth skills install`).
1. Look first: test frameworks and their versions, docker/kind/helm/kubectl, kube contexts.
2. Ask me, one question at a time, with your best guess as the default: a local farm
(`hearth up local`), AWS (`hearth up aws`), GCP (`hearth up gcp`), or an existing cluster.
3. Install the CLI: curl -fsSL https://raw.githubusercontent.com/test-zeus-ai/testzeus-hearth/main/install.sh | sh, then run `hearth doctor`.
4. Never ask me for an API key or token, never print one, never write one to a committed file.
Use `export HEARTH_KEY="$(hearth key)"` or ask me to export it in my own terminal.
5. Bring the farm up (show me each command first; ask before anything that costs money) and
check it with `hearth status`.
6. Connect the tests through config only, reading HEARTH_URL and HEARTH_KEY from the environment,
with the Playwright client's major.minor matching the farm. Run one test on the farm.
7. Register the MCP server (`hearth mcp`) with this agent, and tell me which CI secret to add.
The README has a longer version of the same prompt.
The MCP server¶
hearth mcp speaks the Model Context Protocol over stdio. It
reads the same settings as the rest of the CLI:
| Variable | Default | What |
|---|---|---|
HEARTH_URL |
http://localhost:8080 |
The farm |
HEARTH_KEY |
the default team's key from the cluster in the current kube context |
The API key; everything the agent sees is scoped to its team |
Leave HEARTH_KEY out of client configs when the agent's machine can read the cluster (a local
farm from hearth up local): the server reads the key itself, like hearth key. For a remote farm,
set HEARTH_KEY in the environment the client starts the server in, or use the client's secret
prompt where it has one (VS Code below). Do not put the key in a project file that is committed.
What the agent can do¶
The tools follow the HTTP API and act with your key's team:
| Area | What the agent can do |
|---|---|
| Farm | Read status: pools, engines and Playwright versions, ready, busy and queued counts, the team's running sessions and limit |
| Sessions | List and filter sessions (running, failed, recent), read one session with its error, stop a running session |
| Artifacts | List and fetch a session's artifacts (video.mp4, device.log) |
| Live view | Take a screenshot of a running session's screen |
| Apps | List uploaded apps and upload one for device sessions |
| Connect | Get connection settings for Playwright, CDP, Selenium and Appium on this farm |
| Hosts (admin keys) | List hosts and read one (hosts_list, host_show); add a Mac and get its join line (host_add); set its devices (host_set_plan); host_drain, host_resume, host_remove (needs confirm: true) |
The server has 28 tools; your client lists them once the server is registered (/mcp in Claude
Code). Stopping a session, uploading an app and changing hosts change the farm; agents should ask
you first. host_add returns the one-time join line for you to paste on the Mac; agents should
show it to you and not store it.
Claude Code¶
Add --scope user to have it in every project. Or install the plugin (below), which registers the
server for you. Check with claude mcp list, or /mcp in a session.
Codex¶
or in ~/.codex/config.toml:
[mcp_servers.hearth]
command = "hearth"
args = ["mcp"]
env = { HEARTH_URL = "http://localhost:8080" }
For a remote farm, put HEARTH_KEY in this user-level file's env, not in a project file.
Cursor¶
~/.cursor/mcp.json (all projects) or .cursor/mcp.json (this project):
{
"mcpServers": {
"hearth": {
"command": "hearth",
"args": ["mcp"],
"env": {
"HEARTH_URL": "http://localhost:8080",
"HEARTH_KEY": "${env:HEARTH_KEY}"
}
}
}
}
${env:HEARTH_KEY} takes the key from the environment Cursor was started in; drop the line for
a local farm.
VS Code (GitHub Copilot)¶
.vscode/mcp.json; VS Code asks for the key once and keeps it in its secret storage:
{
"inputs": [
{ "type": "promptString", "id": "hearth-key", "description": "Hearth API key", "password": true }
],
"servers": {
"hearth": {
"type": "stdio",
"command": "hearth",
"args": ["mcp"],
"env": {
"HEARTH_URL": "http://localhost:8080",
"HEARTH_KEY": "${input:hearth-key}"
}
}
}
}
Gemini CLI¶
or in ~/.gemini/settings.json:
{
"mcpServers": {
"hearth": {
"command": "hearth",
"args": ["mcp"],
"env": { "HEARTH_URL": "http://localhost:8080", "HEARTH_KEY": "$HEARTH_KEY" }
}
}
}
Other clients¶
Any MCP client that runs stdio servers works: the command is hearth, the argument mcp, and the
environment HEARTH_URL and, for remote farms, HEARTH_KEY.
Skills¶
The repository's skills/ folder holds
four skills in the Agent Skills format, a folder each with a SKILL.md:
| Skill | Use it to |
|---|---|
hearth-setup |
Install the CLI, bring up a farm (hearth up local, aws, gcp, or Helm), get the key into the environment, verify with hearth status |
hearth-connect-tests |
Wire an existing Playwright, Selenium or Appium suite to the farm: environment variables, version matching, GitHub Actions and GitLab CI |
hearth-debug-session |
Find a failed session, read its error, fetch its video and logs, take a live screenshot, map the error to a fix |
hearth-devices |
Device pools, hearth-agent on Macs and Linux hosts, app upload, Appium capabilities |
hearth skills install¶
hearth skills install # into ~/.claude/skills/, for every project
hearth skills install --project # into ./.claude/skills/, for this project only
It copies the hearth-* skill folders; run it again after upgrading the CLI to refresh them. Agents
that read skills from another folder can use the same files: copy skills/hearth-* there.
As a Claude Code plugin¶
The repository is also a Claude Code plugin marketplace. The hearth plugin brings the four
skills and registers the MCP server:
or from your shell:
claude plugin marketplace add test-zeus-ai/testzeus-hearth
claude plugin install hearth@testzeus-hearth
The plugin starts hearth mcp with HEARTH_URL and HEARTH_KEY from the environment Claude Code
runs in (HEARTH_URL defaults to http://localhost:8080), so install the CLI first. Skills from
the plugin are namespaced: hearth:hearth-setup, hearth:hearth-debug-session, and so on.