-
Notifications
You must be signed in to change notification settings - Fork 0
MCP Server
rf-theia ships an MCP server so Claude Code can run scenarios, list
keywords, inspect results, and analyze traces directly — driving the live
supervisor + Tracer.hh feed through the same harness a human would use.
Install with the mcp extra; it provides the rf-theia-mcp console script:
pip install 'rf-theia[mcp]'The server is rf_theia.adapters.mcp_server (a FastMCP
app named rf-theia).
Verified against rf_theia/adapters/mcp_server.py:
| Tool | Arguments | What it does |
|---|---|---|
run_scenario |
scenario_path, timeout=120, tags="", dryrun=False
|
Run a .robot file or directory (path relative to the scenarios root). dryrun resolves keywords without executing (smoke test). Returns return code + stdout/stderr. |
list_scenarios |
— | Discover .robot files under the scenarios root, each with its Documentation line. |
list_keywords |
— | Enumerate the keywords exposed by TheiaTestLibrary (name + first doc line). |
create_scenario |
rel_path, content
|
Write a new .robot file under the scenarios root (creates subdirs). |
get_test_results |
output_dir="" |
Parse the last run's output.xml (default /tmp/rf_theia_output) into a pass/fail summary. |
analyze_trace |
trace_path |
Summarize a Tracer.hh trace file: per-event-kind counts, per-node totals, correlation-pair count, first/last timestamps (JSON). |
tail_supervisor_log |
path, lines=80
|
Tail any file — supervisor stderr, FC daemon logs, etc. |
Runs land in /tmp/rf_theia_output (output.xml), and robot is invoked from
the consuming workspace's .venv/bin/robot so the harness + Robot resolve
from the project that owns the scenarios.
rf-theia is standalone; the scenarios it runs live in the consuming repo. The
server resolves both the scenario tree and the venv from the environment that
run_mcp.sh exports:
| Var | Meaning | Default |
|---|---|---|
RF_THEIA_WORKSPACE |
the consuming workspace root (holds .venv/) |
the dir holding rf-theia/ (i.e. rf-theia/..) |
RF_THEIA_SCENARIOS |
the .robot scenario tree |
$RF_THEIA_WORKSPACE/testing/scenarios |
If RF_THEIA_SCENARIOS is unset, the server falls back to
$RF_THEIA_WORKSPACE/testing/scenarios, then legacy in-tree layouts
(<pkg>/../scenarios, <pkg>/scenarios). The Robot venv is taken from
$RF_THEIA_WORKSPACE/.venv/bin.
rf-theia/run_mcp.sh is the bridge between the standalone harness and the
consuming repo. It:
- locates the workspace (the dir holding the
rf-theia/submodule, unlessRF_THEIA_WORKSPACEis already set), - checks
<workspace>/.venv/bin/pythonexists (errors with setup hints if not), - exports
RF_THEIA_WORKSPACE,RF_THEIA_SCENARIOS(default<workspace>/testing/scenarios), and prepends the workspace toPYTHONPATH, - execs
python -m rf_theia.adapters.mcp_serverfrom the workspace venv.
So the workspace needs the harness installed in its venv:
python3 -m venv .venv
./.venv/bin/pip install -e 'rf-theia/[mcp,dev]'Point the workspace-root .mcp.json at the launcher so Claude Code discovers it:
{
"mcpServers": {
"rf-theia": {
"command": "rf-theia/run_mcp.sh"
}
}
}For a non-standard layout, override the scenario tree:
{
"mcpServers": {
"rf-theia": {
"command": "rf-theia/run_mcp.sh",
"env": {
"RF_THEIA_SCENARIOS": "/abs/path/to/scenarios"
}
}
}
}A typical loop:
-
list_scenarios/list_keywords— see what's available and the keyword surface. -
create_scenario— write a focused repro (or edit one in the repo). -
run_scenariowithdryrun=True— confirm keywords resolve. -
run_scenario(live) — drive the real supervisor + trace feed. -
get_test_results— read the pass/fail summary. - On failure:
analyze_tracefor an event/node breakdown,tail_supervisor_logfor the supervisor's stderr.
- Writing Scenarios — the keyword surface these tools run.
- Home — harness overview and the harness-vs-scenarios split.
Install
pip install rf-theia
pip install 'rf-theia[mcp]'Related wikis