Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

MCP server

mtui-mcp is a Model Context Protocol server that exposes mtui’s functionality as tools an LLM client can call. Its tool surface is synthesised from the same command registry the mtui REPL uses: each non-denied command becomes one tool, with a JSON input schema derived from the command’s clap argument spec, dispatched through the same engine as the REPL. Adding, renaming, or removing a command changes the MCP tools automatically. Two commands, get and put, are denied synthesis and re-served under the same names as hand-written tools that carry file content in-band (see File transfer tools) — a path on the server’s filesystem would be meaningless to a remote --transport http client. put can still upload a file that already sits on the server, by source=, on either transport, gated by [mcp] put_dirs. The underlying semantics of each tool are the command semantics in the Command reference.

Building and running

The server lives behind the mcp feature, enabled by default alongside the mtui REPL’s cli feature (see Installation):

cargo run -p suse-mtui --bin mtui-mcp -- --help

Two transports are served:

  • stdio (default) — one process == one client. Use this for a local LLM client that spawns the server as a subprocess.

    mtui-mcp                       # stdio
    
  • streamable HTTP — many clients, with per-client session isolation.

    mtui-mcp --transport http --host 127.0.0.1 --port 8000
    

    --host/--port bind the HTTP listener and are ignored under stdio. The bind address is not restricted, but rmcp’s DNS-rebinding guard checks each request’s Host header, which must be localhost, 127.0.0.1 or ::1; anything else gets a 403. Keep the listener on loopback or behind an authenticated boundary (see Security boundary).

Logs go to stderr; stdout is the transport, so never write to it. set_log_level changes the level of that log, which belongs to the server: under --transport http a call from any client changes it for every session, and none of it reaches the client. A runtime level replaces the whole startup filter, per-target RUST_LOG directives included. The OTLP tracing diagnostics keep the startup level.

Tool profiles

The advertised tool surface can be narrowed with [mcp] profile:

  • full (default) — every synthesised tool.
  • core — a curated everyday subset; the rest are filtered out before they reach the wire.

Fine-tune with [mcp] tools_allow (add specific tools on top of the profile) and [mcp] tools_deny (remove specific tools; deny wins last). See the [mcp] table in Configuration for these and the resource caps (max_output_bytes, max_active_jobs, session budget, …).

Agent clients should prefer core: the full surface (78 tools) is sent on every request, while core (45 tools) covers the everyday flow — load → inspect → run/install → fill the report → approve/reject — without the host bookkeeping and server-tuning tail. If a workflow never lists the queue or polls openQA, deny those on top:

[mcp]
profile = "core"
tools_deny = ["updates", "openqa_overview"]

Security boundary

Profiles are not authentication or authorization. They reduce the advertised tool surface; they do not gate callers. HTTP session isolation is likewise not caller authentication. Keep the HTTP transport on its default loopback interface, or place it behind an authenticated boundary you trust to operate the remaining maintenance tools. Audit records attribute to a session, not a person (see Audit log). The audit trail such a deployment leaves is local-only unless shipped: see Shipping the audit log.

Permanent deny-list

Some commands are never synthesised into MCP tools, under every profile — this cannot be re-enabled with [mcp] tools_allow. The permanent-deny criterion is stated once, beside the list it governs — see the MCP_DENYLIST docs in crates/mtui-core/src/registry.rs — and each entry below names the reason it meets it.

  • The interactive/REPL-only commands, which require a controlling terminal or have no headless meaning: quit, exit, EOF, switch, shell, help, edit.
  • config_set: it writes operator config — endpoints, credentials, identity, timeouts — retargeting the infrastructure the session trusts, with no operator-visible artifact. config_show stays exposed, so a client can still verify the posture it operates under. A config_set call is refused as an unknown tool.
  • The path-based transfer commands get and put, replaced by the hand-written in-band tools of the same names (#434): their synthesized forms exchanged server-local paths a remote client cannot read or create. (Only the synthesized command forms are permanently gone; the replacement hand-written get/put are ordinary tools — present in full, restorable under core via tools_allow, removable via tools_deny.)
  • teregen_login: every call spends one of ~20 challenges/60s for the principal, so a looping client would lock the tester out of commit and approve. REPL-only; the REPL operator runs the check deliberately.

Local process execution and terminal launching are not on this list because they are not in mtui at all. The former lrun (run a command as the local process user) was removed outright — an MCP client already has its own local execution, and a REPL user is already at a shell. The former terms (spawn a terminal emulator per refhost) went the same way: it duplicated shell (#566).

The deny-list is intersected with the live registry and consistency-tested; a renamed or removed command that leaves a stale deny-list entry is warned about at boot, so the boundary cannot drift silently.

config_show filtering

config_show prints less over MCP than at the REPL (#410). The REPL operator owns the machine and can read mtui.toml directly, so it prints every resolved value verbatim (secrets as <set>). A headless client gets only what it needs to operate the session: endpoint URLs with embedded userinfo stripped and the operational tunables/flags. The no-argument bulk dump is refused headlessly — name the attribute(s) explicitly — as are the operator-local values (session_user, template_dir, refhosts_path, and a ssl_verify CA-bundle path; its true/false form is shown). Values config show never lists (the oscrc location, the OBS API URL, lock/history paths) reach neither surface through this tool.

whoami prints the oscrc principal and signing-key fingerprint on both surfaces by design: it is the remote auth identity the server sees (not operator-local paths), and a refused assign or commit is triaged against it. Key/oscrc/store file paths stay REPL-only.

Session state and isolation

Session state is isolated per client. Under stdio one process serves one client, so there is exactly one config / loaded template set / group of connected hosts. Under HTTP each connected client gets its own isolated session (its own config view, loaded templates, and hosts), so concurrent clients never see each other’s state. Clients load their own state at runtime via the load_template and add_host tools — mtui-mcp takes no boot-time update/host flags (see Invocation).

The HTTP registry refuses to create more than [mcp] session_cap concurrent sessions and reaps a session after [mcp] session_idle_timeout seconds of inactivity (disconnecting its hosts, for a client that vanished without ending its session).

A session’s teardown releases its pool claims, removes its operation locks (with or without a lock -c comment) and disconnects its hosts. It runs when the session ends: on stdin EOF, SIGINT, SIGTERM or SIGHUP under stdio; under HTTP when the client ends the session (DELETE), when the transport’s keep-alive gives up on it, at the idle sweep, and for every session at server shutdown on the same signals. A teardown gives up after 45 seconds. Nothing runs on SIGKILL or a crash: those holds stay until a later session reaps them past [lock] stale_age / pool_stale_age (one day by default) or someone runs unlock -f / unlock -p -f. list_refhosts --free names the holder, start time and comment of every lock it finds, without attaching or reaping. list_refhosts with summary: true answers “is there a free host for this product, version and arch” per slot instead of per host: with testplatform and free: true each requested arch gets one row with its free hosts and a free/busy/unknown/none verdict, none naming an arch the inventory has no host for. With json: true each row is

{"slot": {"product": "sles", "version": "15-SP6", "arch": "x86_64", "addons": []},
 "hosts": 2, "free": ["host-a"], "locked": 0, "pool": 1, "unreachable": 0,
 "verdict": "free"}

Every key is always present: without free: true, free, locked, pool and unreachable are null and verdict is "none" or null. The counts never overlap: an operation-locked host counts as locked even when also pool-claimed. The reply is a bare array unless rows were cut; then it is {"rows": [...]} plus "window": {"kept", "total"} for limit/offset, "truncation" for the row budget, and "probe": {"probed", "total"} when free left hosts unprobed. A verdict is a snapshot of one testplatform: it does not reserve the host, a host your own update pool-claimed shows as taken, and one host can be the only free candidate for slots of two testplatforms.

This isolation depends on rmcp’s legacy Mcp-Session-Id session lifecycle, so over HTTP mtui-mcp advertises protocol revisions 2024-11-05 through 2025-11-25 and declines 2026-07-28: that revision removes protocol-level sessions, and rmcp’s transport layer classifies any non-initialize request carrying complete 2026-07-28 metadata as stateless regardless of config, mints a throwaway server for it, and serves it inline — which would tear down and rebuild the per-client McpSession (its SSH connections, pool claims) on every such request. A client asking for it over HTTP falls back to the latest revision mtui-mcp does support.

Over stdio there is one client per process and no per-request session to protect, so that inline lifecycle is harmless: mtui-mcp advertises 2026-07-28 there too, so a client that opens with server/discover at that revision succeeds instead of being refused.

Multiple templates: scoping and fan-out

A session can hold several loaded templates at once (call load_template more than once; loading an already-loaded RRID reloads it). list_templates lists the set, and each template keeps its own test report and SSH host group.

Every command that acts on a loaded template carries the shared -T/--template and --all-templates flags, so its synthesised tool exposes two optional parameters. The session-level tools — load_template, unload, list_templates, list_refhosts, updates, review_state, config_show, whoami, set_log_level — expose neither, and regenerate exposes only template:

  • template="<RRID>" — scope this one call to a single loaded template (the analogue of the REPL -T flag). An unknown RRID returns a clean error.
  • all_templates=true — force fan-out across every loaded template.
  • all_templates=false — suppress fan-out on a tool whose command fans out by default, narrowing it to one template instead.

A client still sending template/all_templates to unload, list_templates, list_refhosts, updates, whoami or set_log_level, or all_templates to regenerate, has the call refused with unknown argument(s): … (they were ignored with a server-log warning in 26.4). load_template never accepted them; config_show never took them.

Omitting both parameters resolves per command: a read/annotate tool (list_* other than the session-level ones above, show_*, openqa_*, checkers, checkout, export, set_workflow, comment, analyze_diff, reload_openqa, reload_products, set_host_state, set_timeout) fans out across every loaded template, prefixing each template’s output with an === <RRID> === banner. A host-mutating or remote-write tool (update, prepare, downgrade, install, uninstall, set_repo, run, reboot, lock, unlock, add_host, remove_host, approve, reject, assign, unassign, request_review, commit, plus the hand-written get/ put transfer tools) never implicitly fans out: with several templates loaded and neither parameter set, the call is refused rather than guessed at — the error names the loaded RRIDs and the template=/all_templates=true escape hatches. This is the same rule the report_* tools use for their own required-with-several-loaded template parameter (below).

A fanned-out call that fails on one template keeps running on the others and reports an aggregate failure at the end.

switch is not an MCP tool (moving the active-template pointer is REPL-only navigation): over MCP you target a template per call with template=. load_template and unload <rrid> are exposed — each names its own RRID. list_templates is available as a read-only listing.

What approve reports on OBS

After an OBS approval (maintenance and PI requests) succeeds, approve reads the request again and, below approved <rrid>, prints one line per review still new that belongs to a QA group (a group whose name starts with qam) or to the acting user: still open: review by group <group>, or still open: review by user <user>. The automation groups qam-auto and qam-openqa are named too, as still open: review by group <group> (automated), because an open automated review also keeps the request from releasing. At most ten are named; a still open: <n> more line counts the rest. Only when none is open does it print no QA review left open on <rrid>. If that read fails, the one line is approved <rrid>; could not re-read its reviews (<cause>), check them: the approval stands and the call succeeds, but never with the all-clear line. A refused or failed approval makes no read. The Gitea path prints only approved <rrid>, since its bot posts the official review asynchronously. The reply is text only: a command tool returns one text block, so there is no structured open_reviews field. The REPL prints the same lines.

Non-interactive prompt behaviour

MCP sessions run with no interactive prompter installed, so a command that would prompt at the REPL never blocks waiting for input:

  • approve refuses non-interactively on a Gitea checkout-hash mismatch (at the REPL it prompts for confirmation, default no) unless accept_head names the PR head as Gitea reports it now — the refusal prints that head. The value is a pin, checked even when the report is not stale, and the LGTM is refused again if the head moves before it is posted. A missing Gitea token or a failed Gitea call refuses on every surface, since the check never produced a verdict to confirm. The reviewer and document checks, the Slack gate and the backend’s own checks (Gitea: hash gate, assignment, already decided; OBS: -g, assignment) all run before reviewer records or uploads anything, so a refusal from them publishes nothing. The verdict check, on OBS and Gitea alike, cannot: it reads TeReGen’s copy of the document after the upload, immediately before posting (approve needs PASSED; reject needs FAILED and a non-blank top comment; an unreadable document refuses), and a Gitea head that moves during the upload is refused at the LGTM with the reviewer already stored. A document changed on TeReGen after that read is not noticed. On Gitea a job_cancel that lands during the read stops the call with nothing posted. Without reviewer, both refuse while the loaded document has uncommitted edits. PI requests skip the verdict check.
  • load_template’s interactive “Force continue loading template ?” fallback — for a stale checkout hash that TeReGen also refuses to regenerate (already hand-edited) — is exposed as the --force-continue argument; without it the load is unconditionally abandoned, since the question’s non-interactive default is “no” (openSUSE/mtui#517). A force-continued load neither repairs nor bypasses the recorded mismatch, so it does not touch approve’s refusal above — and commit, export, reject --reviewer and request_review refuse the same way, unless given their own --allow-stale, so a stale-loaded report cannot be published or overwritten non-interactively either. approve’s check_hash() re-query is live (asks Gitea again, every call) and replaces that load-time verdict for approve -r; the others instead read whether the load itself saw a mismatch, so a report that loaded clean and only goes stale once the session is already open (a maintainer pushes to the PR while mtui-mcp still holds it loaded) passes them silently — commit is the one where that gap is most likely to matter, since it is the publish step.
  • A command timeout aborts immediately instead of offering the REPL’s wait/retry prompt.
  • comment and commit take their text/message as a required argument (no editor/stdin prompt), and regenerate gates overwrite on the --force flag rather than a prompt.
  • On a Gitea pull request, comment refuses text containing @<group>-review: (anywhere in the text, any letter case) before sending it: the review bot (group-review) reads such a line as an approval or, whatever else follows the colon, a decline, and a decision goes through approve / reject and their checks. reject refuses the same in its message, before the reviewer upload.
  • On a Gitea pull request, assign / unassign accept a user override only if it is a Gitea login (letters, digits, -, _, ., starting with a letter or digit), since it is written into the assignment comment.

SSH authentication is public-key only in every surface. A failed key auth reports the host as unreachable; mtui-mcp never falls back to a password prompt.

File transfer tools

The hand-written get and put tools replace the synthesized commands of the same names (#434), carrying content in-band in both directions. The REPL get/put commands work on literal paths instead, with downloads landing in {report_wd}/downloads/{name}.{host}.

With no template loaded, both tools act on the hosts added with add_host, as the REPL put does, so a fleet pass needs no update loaded. A template that is not loaded is still refused. Such a transfer runs on the session itself, so it first waits for every call already running, such as a list_refhosts --free or updates, and holds new calls back until it finishes. A slow reply is that wait, not a lost call; do not send the transfer again.

get (read-only)

Downloads remote (an absolute file path; folders are not supported in-band) from every enabled host and returns, per host, the remote size, a truncated flag, and the content: UTF-8 as content, binary as content_b64 (standard base64). Reads are capped per host at [mcp] max_input_bytes, enforced while reading — a host never buffers more than the cap (0 disables it and reads the whole file) — and each host gets an equal share of the [mcp] max_output_bytes wire budget. With a cap set, size is the file size the server reports when the file is opened, so it can differ from the returned bytes if the file changes during the read; a server that reports no size fails the call, naming the host, rather than being read without a bound. Without a cap, size is the number of bytes read. Truncation never splices a notice into the content: the truncated flag and size are the signal. Pass hosts (a list of connected hostnames) to retry or page a subset when one host’s file was truncated; unknown or disabled names refuse the call. Any host failure fails the whole call with the host named — partial content is never returned as success.

put

Uploads a payload — content (UTF-8), content_b64 or source, exactly one of the three — to <target tempdir>/<filename> on every enabled host, the same destination the REPL put uses. filename must be a bare name (no path separators); with source it defaults to the basename of the path you named. A payload above [mcp] max_input_bytes is refused outright: truncating an upload would corrupt it. Any host failure fails the call with the host named. Pass hosts (a list of connected hostnames) to write to a subset; unknown or disabled names refuse the call before anything is written, and the reply lists only the hosts written.

put neither takes nor checks the operation lock (/var/lock/mtui.lock): it writes to a host even when another owner holds that host’s lock, because an upload is not a zypper transaction. To leave such a host out, name the others in hosts, or disable it with set_host_state first.

source is an absolute path of a file on the machine running mtui-mcp, so the bytes never pass through the model. It works on both transports and is off until the operator lists directories in [mcp] put_dirs; without it the call is refused. The file must be a regular file whose resolved path (symlinks followed) lies strictly inside a listed directory, in any depth; anything else is refused before a lock is taken or a byte is sent, and a path outside every listed directory is refused the same way whether or not it exists. The refusal lists put_dirs. The file is read once, so the bytes that are size-checked, hashed and uploaded are the same buffer. The reply gains source: {path, bytes, sha256} — the resolved path, the byte count and the SHA-256 of what was uploaded.

List only directories whose contents may leave the machine and that only the operator can write. A file that someone else can place or swap in a listed directory (or in one of its parents) is uploaded to every host. Final symlinks are refused at open, but a directory component swapped between the check and the read is not defended against.

The destination path is unchanged, but a file is published atomically (see Uploads): readers of <filename> see the whole old file or the whole new one, an existing symlink or hardlink at that name is replaced rather than written through, and the file ends up mode 0770. A host whose server lacks posix-rename@openssh.com, or whose destination directories other users could swap, is refused by name and nothing is written there.

Command behaviour notes

  • Every tool schema sets additionalProperties: false, so an argument the tool does not declare is refused with unknown argument(s): ….

  • review_state (read-only) takes one or more RRIDs or Gitea pull request URLs in update and needs no loaded template. It only reads: no assign, no lock, no regeneration, no load. Each row names the holder of each QA group’s review (owner), the state of that review (gate), when it got there (since), when the update was created, the pull request head and base branch, and the template (current, stale, generating, missing: <first error line>, or n/a for a bare pull request URL, which names no RRID).

    • SLFO: the gate comes from the group’s latest review on the pull request that carries a verdict and is not dismissed — a later comment or draft does not count: owed (review requested, or the group only commented, which carries no verdict but clears Gitea’s request), approved, changes-requested, …, stale after a push, closed when the pull request was closed with the review owed, - when the group has no review. A review whose state, reviewer, dismissed or stale cannot be read makes the gate ? with the reason; a team review request is not the group’s and is skipped. approve, reject and assign count a decision comment as “already decided” only while these reviews do not show the group’s review owed again, yet the two can still disagree: a pull request approved with no decision comment is approved here but still open to approve, and assign’s review-requested guard reads the requested reviewers.
    • OBS: per qam group new, new (assigned) (an assign accepted the group review and its user review is open) or accepted, or the request’s own state once it left review. Automation groups (qam-auto, qam-openqa) are in --json with "automated": true and left out of the table.
    • An SLFO RRID’s pull request is the one its published document names (its number must be the RRID’s); without that document the row fails and asks for the URL. The base branch is shown as Gitea names it: mtui has no mapping from a codestream to a branch, so it does not judge it.
    • A value that cannot be read is ?, - means nothing (nobody, no review), n/a does not apply. A source that fails is named under the table (gitea, obs, teregen, document) and the call is then a tool error carrying the partial table; a cancel prints the rows already read and fails read N of M updates — unless a lookup had already failed, which the error then names first. An owner the open reviews and the review history disagree on is ? with a note:, and --mine is then ? too.
    • --json prints {"rows", "failed", "notes"}; each row’s values are typed objects ({"status": "known", "value": …}, {"status": "unknown"}, …), so a client never parses ? or approved, stale.
  • coverage (read-only) answers, per declared test-platform slot of each loaded report (a platform in install.test_platforms and one of its archs), whether testing.install.checks holds a check from a host the refhosts inventory resolves for that slot with the testplatform query add_host builds: checked (with the host), no-refhost, owed, not expected (an uncovered slot in the kernel workflow, which records no install check) or unreadable (the platform’s base, addon or archs could not be read back, so nothing is matched against it; a warning line comes first). Unlike add_host, which draws one host for identical queries, every declared platform and arch gets its own row. A check counts for one slot at most; the checks that count for none are listed with the reason: the inventory is unavailable, the host is not in it, the host serves no declared slot, or every slot it serves is counted for another check. It contacts no host and does not judge what a check shows. A report with no declared platforms is an error, never “nothing owed”; when the inventory cannot be read or holds no hosts, the first line says so and no slot is checked or no-refhost. In the auto workflow openQA install jobs are not counted against the slots.

  • list_metadata and updates show the QEM Dashboard’s embargo flag, read from its incident list (/api/incidents): yes, no, or unknown with a reason. no comes only from an incident that was read, paired with the update and carries embargoed: false; no paired incident, a missing or non-boolean flag, a failed read and a cancel are all unknown, never no. An incident is paired by its dashboard number (the review id for SLFO, the maintenance id otherwise), its type, and its project when that can be derived: always for a classic update, and for a git one from a pull request URL that names the update’s own pull number (openqa_jobs and openqa_overview take the project from any pull request URL). Without a project the number and type must match exactly one incident, and since pull request numbers repeat across repositories that incident must also share a source package with the update, or the state is unknown; when the URL names another pull number the reason says so (its pull request URL names another pull request, …). A Product Increment has no incident and is always unknown.

    • list_metadata puts Embargoed first and reads the dashboard once per template; a failed read shows unknown (<reason>) and the call still succeeds. list_metadata --json prints {"rrid", "embargoed", "embargoed_reason", "metadata": [{"label", "value"}]} for one template (it never fans out: pass template with several loaded); embargoed_reason is null unless the state is unknown. A git update without a pull request URL of its own pull number is unknown: with no repository to check, the incident cannot be confirmed as its own.
    • updates reads the dashboard only when asked, with field: ["Embargoed"] or embargoed, and then once for the whole queue, never per row. embargoed (yes, no, unknown, all) filters before limit/offset; no never matches an unknown row, unknown matches every row whose state could not be read, all keeps every row and only adds the state. Every row shows the state: the default layout appends embargoed=<state>, and a field list without Embargoed gets it added last. With json, rows gain qem_embargoed and qem_embargoed_reason whenever the dashboard is read, which with json means embargoed was passed (field cannot be combined with json); a row without them means the dashboard was not asked. A queue row names no workflow, so its RRID kind stands in: a Maintenance id is paired as a classic incident, an SLFO review id as a git pull request number. An SLFO row whose url is a pull request URL of that number on the configured Gitea origin ([gitea] url) is paired within the repository the URL names, as a loaded git update is; a missing url, one that is not such a URL, one on another origin, or one naming another pull number leaves the row unpaired by repository, and then the number must be unique and share a package with the row’s srcrpms. When the dashboard cannot be read (or no HTTP client can be built for it) every state is unknown, the text listing opens with a warning: line, and the call fails after the listing.
  • updates with live: true reads each shown row’s review gate, owner and template as review_state does, after limit/offset. review_group lists a row in any of its groups, so a row is judged on the review_group groups its own review groups also name (all of them when the row names none); without review_group, on the qam groups TeReGen lists it for. Automation groups (qam-auto, qam-openqa) never count, and the call is refused, before any request, when review_group names one. The output starts with the summary (live: read N of M shown rows: …), the dropped N rows whose verdict is no longer owed: … line in the unassigned and mine views, and the line saying the untracked list was not read, so a capped reply keeps them; each row’s live cells are one bounded line. Rows held by someone the view does not admit, rows not concluded (no review of a group, or groups that disagree) and rows whose read failed are listed apart; a failed read makes the call a tool error carrying the listing and naming those rows. With json: true it is one document, {"summary", "rows", "held", "unsettled", "live_failed", "dropped", "untracked", "notes", "truncation"?}; each row’s live object carries standing, owner, gate, since, created and template as the row shows them (unknown is null) and the typed read under review. It fails the same way. Without live the tool’s output and cost are unchanged. The tool is still advertised read_only: false; live adds only reads.

    • Together with embargoed (or field: ["Embargoed"]) the embargo filter runs first, before limit/offset and the row budget, so a row it drops costs no live read. The default layout shows embargoed=<state> before the live cells; a filter that leaves no row gives the empty live document (with json) or its message and the untracked line; a dashboard that cannot be read fails the call after the listing, named ahead of any live failure and outranking a cancel.
  • The openqa_overview and openqa_jobs tools hide their operator override flags (--url-openqa, --url-dashboard-qam, --url-qam, --test-pattern, --no-fetch, #410): a headless client uses the operator’s configured endpoints, and a sent one is refused as an unknown argument. The REPL keeps every flag.

  • openqa_jobs ends each red row with its failed modules from the listing it already reads. Its history (0-50, default 0) costs one or more openQA requests per distinct red scenario among the rows it prints (at most 100 scenarios, up to 51 pages each, four at a time, two minutes in all): a failed or timed-out lookup is named on its row and in a warning: line ahead of the summary, and fails the call after the listing, so a missing history never reads as “fails nowhere else”. A job_cancel keeps the listing printed and marks the unread scenarios not read: cancelled.

  • install, uninstall, prepare and downgrade resolve each checked host’s transaction with a dry run first and fail by name a host where it would remove a protected package the call did not name, or where the dry run fails (a 104 “not found” dry run is not a failure; see Removal guard); other removals come back as <host>: the transaction also removes …. update does the same in both its prepares: a host its first prepare refuses is left out of the patch, its reason comes back once as <host>: its prepare was refused: … however the update ends, and the failed result names the host; a host its --newpackage prepare refuses comes back in a newpackage prepare after update failed (…) warning while the update stands. Transactional, SLE 11 and YUM hosts are not checked, and each comes back once as <host>: no dry run exists for this host, …. allow_removal: true skips the check. run and the rollback of a failed update are not checked.

  • check_hosts runs up to four root commands per host (rpm -q, df -Pk /, systemctl --failed, and a grep of the section headers of /etc/zypp/repos.d/*.repo), so it is not advertised readOnlyHint and writes an audit intent record. It takes neither the operation lock nor a pool claim, writes no history row, keeps its probes out of the host log (show_log and export never see them), changes no package or repository, and runs no zypper: zypper takes the ZYpp lock while it runs, and mtui’s update script does not wait for that lock, so a zypper probe overlapping another tester’s update or prepare would make their zypper exit 7 and fail their run. The probes run in parallel across hosts and one after another on each host, each bounded to 60 s. It fails when any host’s verdict is fail or unknown, after printing every host. After a cancel it still fails, naming the hosts, rather than reporting a cancel, when any host could not be checked (disabled, unconnected, YUM) or any check that ran ended fail or unknown; only the checks the cancel stopped are left out. In text output the first line is the overall verdict, so it survives truncation; --json is one document (summary, the checks it ran, the ones it leaves unchecked: dependencies, patches, reboot), and a truncated JSON reply is not valid JSON — raise mcp_max_output_bytes or narrow with hosts. With json the tool never fans out: it covers the template named, or the only template loaded; with several loaded and no template it is refused as ambiguous rather than reporting on one the client cannot see, and all_templates is refused, so a reply is always one document. failed_units does not apply to SLE 11 and is listed in that host’s not_checked with a reason, without making it unknown; a YUM-family, disabled or unconnected host is unknown with a reason. With a report loaded, its own test repositories are not reported as left over. The probe outputs are verified on SLES 15-SP6, 12-SP5 and 16.0 x86_64 hosts; SLE 11, transactional hosts and other architectures are not yet.

  • The prepare tool fails — instead of reporting success — when the loaded report’s metadata names no package versions, and when no prepare command could be built for a connected host (#396), so automation keying on prepare’s success does not see a false positive on a metadata-empty report.

  • On a report whose metadata carries a binaries block, prepare narrows the package list per host to what that host’s products compose, and fails by name a host whose products compose none of it — rather than sending a list zypper refuses with “capability not found” (104). An architecture a product declares but the metadata never mentions composes nothing, not the full list, so it gets the same named refusal. update excludes such a host from its patch, scopes its own lock/repository/package-check to the hosts that do compose it, and reports a failure naming it, instead of patching a host its own prepare established no baseline on. On every report kind, update also excludes by name, before anything runs on it, a host the update’s repositories do not reach (no repository of this update matches the host's products (…); it was excluded from the update, its products could not be read; … for a host whose system was never read, or this update has no repository to add; … when the update has none): the patch would find nothing to install there and pass. A host either exclusion leaves out is left out of the automatic rollback too: when a patched peer fails its check, the rollback reaches only the hosts the patch was dispatched to. prepare with update set fails such a host by name the same way (…; nothing was installed), before anything runs on it, instead of installing from the repositories it already had; the other hosts are prepared. The refusal is in the tool’s error, once, also when a peer stops the prepare before its verdict: then one prepare failed on <hosts> (…) summary carries both.

  • update’s tool result carries diagnostics for every non-fatal degradation of the run — a composition refusal, a host excluded because its test update repository genuinely failed to register, or because its refresh failed on a read-only root (its partial add is undone and its lock released before the patch reaches its peers; when that undo fails too on a read-only root, the entry ends with what transactional-update -n rollback did: …: staged snapshot dropped, …: nothing was staged, or that it failed and a staged snapshot could remain), a host excluded because the update’s repositories do not reach it, a repository refresh that may have left stale metadata on a read-write host that still gets patched, a prepare host failure it continues past, a failed --newpackage step, a failed update naming the hosts it did not complete on and whether it rolls back or leaves their test repositories configured, a read-only-root host the rollback left out because its refresh failed while its repository removal succeeded, and which the reset put back (<host>: refreshing repos failed: …; no downgrade was run: staged snapshot dropped, or …: nothing was staged), a failed automatic rollback, and the three ways the post-update test-repo cleanup can fail — on both the success and the failure path. The server’s tracing goes to its own stderr, not the tool result, so a tracing::warn! alone would never reach an MCP client.

  • On each host update completed on, it also names every tracked package that did not end at the update’s version, one degradation each, from the version queries made before the patch and after it (on a transactional host, after its reboot). The state after the patch decides the finding: unchanged (including a package already at or above the update’s version before the patch), lower than before, raised but still below the update’s version, raised above it, no longer installed, or a version query before or after the patch that did not answer. Each line names what was observed and all three versions: <host>: pkg was already above the update's version before the patch, which did not change it (before the patch: 2.1-1; after it: 2.1-1; the update's version: 2.0-1). When the update’s version of a package could not be read from its metadata, the package is still judged unchanged, lower or removed (the update's version: could not be read), but not as below or above it. A package with several installed copies (a kernel) is judged on its newest copy. Not judged: a package not installed before the patch (one new to the host) unless the query after the patch did not answer, one the host does not track, one the update does not compose for the host’s products, and disabled, excluded or refused hosts. At most ten packages are listed per host, then <host>: N more tracked packages with a version finding, not listed here (see `list_packages`), which counts as one degradation. These qualify the confirmation like any other degradation; the update still counts as completed on the host.

  • Every workflow fan-out (install, uninstall, prepare, downgrade, update) confirms success as <verb> completed on <hosts>, so a clean run is never an empty tool result. update’s confirmation is printed above its diagnostics — the head of the buffer is what survives max_output_bytes — and is qualified whenever the run recorded a degradation: update completed on h1: the patch passed its checks, with 2 degradations reported below. The count is of degradations only; a check’s own recognised sections (the vendor-support notice, extra rpm output) ride in the same diagnostics and are routine on a healthy update, so they leave the confirmation bare. A partial run — one that failed on some hosts and completed on the rest, with nothing rolled back — still fails, naming the hosts it failed on, but first prints the confirmation for the hosts it completed on, so they need no second run. A host counts as completed only when it passed its check and, if transactional, came back from its reboot with the new snapshot active. An update is partial when it excluded a host (its products compose none of the update’s packages, or its test update repository failed to register), or when a peer’s patch never ran, could not work out what to patch, or did not come back from its reboot. On the last three it first finishes the peers whose patch passed as a successful run would: it reboots the transactional ones, then runs the --newpackage step, records the post-update package versions and removes the test update repositories on every host it completed on. Its degradation names the hosts it did not complete on, and for each says what the host’s record shows about the test update repositories: “still configured on ” (the script stopped before its cleanup, reported a failed removal, or has none, as on yum), “may still be configured on ” (the removal is not confirmed: nothing reported it, or the host is transactional and its staged snapshot may still list them), or nothing when the script reported them removed or this session added none. A rollback leaves out a peer that could not work out what to patch, since no patch ran there, and a peer whose patch never ran to completion, which it may be unable to reach or would hit with a second transaction; the degradation names each with its reason. The hosts the rollback reverts are named, from the same record, in a separate after the rollback, … degradation once it has run. A patch that failed its check rolls back the patched hosts, those two kinds of peer apart, and names no host as completed. So does a reboot that did not take on a reachable host, but only when every reboot that failed is on a reachable host and no peer’s patch never ran: the rollback cannot reach a peer lost to its reboot, and would start a second transaction on a peer whose first was never observed to end. Otherwise nothing is rolled back and the hosts whose reboot failed are named among the failures. A cancelled run names none as completed either. A rollback that fails itself names the hosts it did not restore.

  • add_host without -t follows added <hosts> (or no reference hosts resolved/connected) with one line per test-target slot or testplatform it left without a host and why: no matching refhost, an arch of the testplatform no reference host covers, every candidate claimed by another RRID, every candidate already serving another slot of the update, or a mix of the two, no candidate connected (unreachable, claimed remotely, operation lock held by <user> since <time> for another owner’s live operation lock, or refused because the update workflow cannot drive it: no command set for <Product version>, <root mode> with the root mode as detected, such as transactional or transactional-update.conf but root mode unknown, an unrecognised product, or an unreadable base product), the retry budget spent, or the refhosts inventory unavailable. The call still returns Ok in that case, so these lines are the signal to check.

  • With an update loaded, add_host -t refuses a host the update workflow cannot drive: could not attach any requested host: <host> (<reason>) when none attached. With nothing loaded it attaches such a host for run, get and put. load_template prints no unserved-slot lines, but prints skipped <host>: <reason> for each host it refused this way or skipped for another owner’s operation lock, including a pool host whose slot a sibling then served. add_host prints the same line for a refused host whose reason no unserved-slot line gives.

  • export emits one WARNING: line per host whose install-result block it left unverified in the report: WARNING: no package of this update is tracked for <host>... when the host tracks none (for example, the update ships packages for none of its products), and WARNING: no package version data recorded for <host>... when the host’s tracked packages were never checked (no update ran in this session).

  • export names the testing.install.checks rows it did not rewrite. With -t it rewrites the selected hosts’ rows only and keeps every other row, including that of a host no longer connected: testing.install.checks: kept the rows of the hosts not selected: <hosts>. Without -t it rewrites the checks from the connected hosts: testing.install.checks: dropped the rows of the hosts not connected: <hosts>. The rows are ordered by host.

  • reload_products follows <host>: reloaded products (<base>), for a host whose products changed, with <host>: tracked packages: +crmsh, ~smc-tools (required 1.0-1 -> 1.2-1), -foo (kept for their recorded checks: bar) — unchanged when nothing was gained, lost or required at a new version, and ; no package of this update is tracked there now when the host tracks none — then <host>: N newly tracked packages were never checked; run `update` before `export`. Until update checks them, export leaves that host’s verdict undecided without a warning of its own.

  • run prints its own verdict above its per-host output, for the same head-survives-max_output_bytes reason: run completed on h1 (exit 0), h2 (exit 1) names every host it ran on with its exit code, followed by FAILED on h2 (exit 1) when any host exited non-zero. run returns Ok on a non-zero remote exit — a non-zero exit is often expected — so this verdict, not the tool’s success/failure status, is the signal to check.

  • The run tool’s command is argv tokens, not a shell line: the tokens are re-quoted before dispatch, so ["cat /etc/os-release"] reaches the host as one quoted word (exit 127) and ["zypper","lr","|","grep","x"] passes a literal | as an argument. Split the words yourself (["cat","/etc/os-release"]), and for anything needing a shell — pipes, redirection, ; — ask for one explicitly: ["sh","-c","zypper lr | grep x"].

  • checkers lists the checker runs TeReGen holds for the update, not the report’s build_checks/ logs, which report_files lists. TeReGen serves checker results for SLFO ids only, so for any other id the tool does not ask it and answers No checker results for <id> (TeReGen serves checker results for SLFO ids only). For an SLFO id, No checker results for <id> means TeReGen answered with an empty list. A lookup that failed fails the tool with Checker lookup for <id>: TeReGen …, naming the cause: TeReGen unreachable, a body that is not JSON or carries no checkers array, or an error status with TeReGen’s own reason, as in TeReGen answered 404 Not Found: SMELT does not know update …. A 404 is TeReGen’s “nothing to give”; a 502 or 504 means SMELT failed or timed out, so the results are unknown. TeReGen’s text is stripped of terminal control sequences and cut to 500 characters. rrid="<RRID>" reads the checker runs of an update that is not loaded: it runs once whatever is loaded, loads nothing and touches no host, takes no template lock: like a session-level command it takes the registry gate shared, so a call scoped to one loaded template does not hold it up, but a call that holds the session exclusively, or is queued to — a fan-out update over several loaded templates, load_template, add_host with nothing loaded — delays it. It is audited under the RRID it reads, and refuses template/all_templates alongside it. The id must parse as an RRID whose maintenance component is letters, digits, ., _ and - only.

  • show_update_repos with check: true fetches the repository of each of the report’s install targets (repodata/repomd.xml, then its primary metadata, gzip or zstd) from the server mtui runs on — no refhost is needed — and gives each a status: ok, missing, empty, not published (a 404 on repomd.xml) or no answer (anything else that stopped the metadata being fetched or fully read, with the reason). A repository that could not be read is never reported as empty or missing, and only redirects that stay inside the repository are followed. The tool fails when any repository is not ok, after listing all of them, and when there is nothing to check. A cancel lists only the repositories already checked: the tool then fails with an ordinary error ending “; stopped after K of M” when one of them was not ok, and as cancelled otherwise. With json: true as well the reply’s first content block starts with one JSON object on one line:

    {"source": "install.targets", "total": 2, "checked": 2, "not_ok": 1, "ok": false,
     "repositories": [{"product": "SLES", "version": "15.5", "arch": "x86_64",
       "repository": "https://***@host/path/", "status": "missing", "packages": 12,
       "missing": ["foo"], "reason": "12 packages; not published at …: foo"}]}
    

    source is update_repos when the report has no install targets (each is then checked for being published and non-empty only); checked is below total after a cancel; packages is null when the metadata was not read. On failure the error summary follows the object on the next line. json never fans out: with several templates loaded, pass template; with all_templates: true the call is refused. Repository URLs are masked like every other URL mtui prints, and reasons and names are reduced to one printable line.

  • report_check (read-only) lists what the report document still owes before it can be approved. source is local (default: the loaded document, uncommitted edits included) or server (TeReGen’s stored copy, the one approve reads, fetched without credentials). Errors: unanswered (an owed field that is null, or a string that is empty or only whitespace: verdict; each issue’s reproducer, status and comment unless a tester filed it; with review, its three source questions, the build-log test_suite_present, test_suite_sufficient and both comments, and test_suite_passed only while test_suite_present is true; verdict and comment of testing.install and testing.regression where present), missing-section (testing.install and testing.regression on the manual workflow, testing.regression on the kernel workflow, nothing on auto; and, under any workflow, review on a maintenance or SLFO report, which the schema requires and only a PI report lacks), contradiction (a PASSED report over a FAILED install or regression verdict) and reject-reason (a FAILED report with no comment). Warnings: install-row (a row whose verdict is not PASSED, that lists no package, changes no version or loses a package), export-only (a regression comment holding only the kernel export’s block), openqa-running (one finding for a PASSED report over exported openqa_overview rows still running, naming how many and the first three) and no-install-log (install checks but no install log). The top comment, the reviewer and new_issues are not owed, and nothing judges whether an answer is right.

    The workflow is the loaded template’s, set at load: auto for load_template -a, switched to manual when the QEM Dashboard has no install results (or cannot be read); kernel for -k; set_workflow changes it (it is in the core profile). The document does not store it, so the same copy can owe sections under one workflow and none under another; each testing missing-section message names the workflow it was judged under, and so does approve’s refusal when one of its findings is one, even past the five it lists. A missing review does not depend on the workflow, and commit cannot add it: the refusal says to regenerate the document or report it to TeReGen. An install log is a *.log file other than checkers.log: locally in the install logs directory, read as commit collects it (absent or not a directory holds none); on the server in install_logs/ or uploads/, or, from a server that names no directory, an uploaded one. uploads/ also holds the committed results/ files, so a .log among those counts as well: the warning can miss a report whose only logs are results, never the other way round.

    With json: true the reply is one JSON object, counts first:

    {"ok": false, "errors": 1, "warnings": 0, "id": "SUSE:Maintenance:1:2",
     "source": "server", "workflow": "manual", "verdict": "PASSED",
     "etag": "\"abc\"", "dirty": false, "listed": 1,
     "omitted": {"errors": 0, "warnings": 0},
     "findings": [{"code": "unanswered", "severity": "error",
       "pointer": "/testing/regression/comment", "message": "not answered"}]}
    

    ok is true only when the check ran and found no error. At most 50 findings are listed, every error before any warning; listed says how many and omitted how many of each were left out, and the counts cover all. etag is the server copy’s, or for local the one the loaded copy was read or committed at, and null while the loaded copy has uncommitted edits. A server read that fails (a 404, an error status, a transport error, a body that does not parse, or a failed artifact listing) fails the tool naming the cause; it never answers ok. Without json the reply is the same as text, the summary first, as for show_update_repos. json never fans out, as for show_update_repos. With no document loaded it refuses like the report tools.

Report document tools

Eleven hand-written tools work on the loaded report as a document: nine read and edit it as named sections and issues rather than lines of text, and two list and read its files. Each accepts an optional template="<RRID>" selecting which loaded template to act on; with more than one template loaded an unscoped call is refused — the same “one template, or refuse” rule described under Multiple templates: scoping and fan-out — and with zero or one loaded it may be omitted. All refuse cleanly when no report is loaded.

The sections are verdict, comment, people, update, install, issues, new_issues, testing and review; review is absent from a PI report, and new_issues from a report whose teregen predates it. Reads never change the report.

report_sections (read-only)

  • Parameters: template (optional).
  • Returns { "id", "dirty", "sections": [{"name","size","has_unanswered"}], "complete", "unfilled": [...] }. size is the byte length of the section’s compact JSON (advisory). unfilled holds the RFC 6901 pointer of every null leaf in the whole document, in sorted key order, leaving out tester-filed (new: true) issues, which start out unanswered by design; complete is true when there is none. dirty is true while edits await commit.

report_section_read (read-only)

  • Parameters (required): section. Plus optional template.
  • Returns { "id", "section", "data" }. A section the report lacks refuses.

report_section_write

Replaces one tester section with value.

  • Parameters (required): section (verdict, comment, people, issues, new_issues, testing or review), value (declared as an object, array or string). Plus optional template. A string holding a JSON object or array is decoded for every section except verdict and comment, whose strings are always taken literally. Any other string for those sections is refused without echoing it: one that is not valid JSON names the parse error and its position (trailing characters at line 1 column 572), and one holding a JSON scalar names its kind.
  • No string sets verdict or comment back to unanswered: "null" is not a verdict and is refused, and "null" or "" is stored as the comment’s text. Use report_section_clear for that. A JSON null value is still accepted for these two, but the declared schema has no null arm, so a client that builds its call from the schema cannot send one.
  • update and install are pipeline-owned and refused. A section the report lacks refuses. An issues write must keep exactly the same issue keys; use report_issue_write for one entry. A new_issues write replaces the whole list of tester-filed bugs ([{"id","title","comment"?}]); an id that clashes with a pipeline issue or repeats is refused.
  • The whole candidate document is re-parsed against the typed schema, and a value carrying a key the schema would drop (an unknown key in a closed object, or null on an optional field) is refused. A refusal lists the offending pointers and leaves the report untouched. String patterns and array minimums are not checked locally, so the server can still refuse at commit.
  • A write changes local state only and marks the report dirty; commit uploads it. A later export overwrites the checks in testing.install (with -t, only the selected hosts’ rows), testing.openqa and people.testers.
  • Returns { "id", "section", "dirty": true, "size" }.
  • To set one field without sending the rest of its section back, such as testing.regression.comment next to the check rows export wrote, use report_field_write.

report_section_clear

Sets verdict or comment back to unanswered (null), so report_sections lists it in unfilled again.

  • Parameters (required): section (verdict or comment). Plus optional template. It takes no value.
  • Any other section is refused, as none of them can be unanswered as a whole. A null inside one, such as testing.regression.verdict, is written with report_section_write.
  • Applied to local state like report_section_write: it marks the report dirty, and commit uploads it.
  • Returns { "id", "section", "dirty": true, "size" }.

report_field_write

Sets one field of the report document, addressed by its RFC 6901 pointer as report_sections lists it under unfilled, and keeps the rest of its section as it is. A product increment’s testing.install.checks can run to tens of kilobytes; this tool never sends them.

report_field_write pointer=/testing/regression/comment value="zypper ps clean"
report_field_write pointer=/testing/install/verdict value="PASSED"
report_field_write pointer=/testing/install/checks/1/verdict value="PASSED"
  • Parameters (required): pointer, value (declared as a string or a boolean). Plus optional template. value replaces the field as given: a string is stored literally, so "null" or "{}" is text, and a JSON null clears the field back to unanswered, but the declared schema has no null arm, so a client that builds its call from the schema cannot send one: such a client clears a nested field with report_section_write, where the null travels inside the section’s value, and verdict or comment with report_section_clear. A yes/no field, such as /issues/<key>/reproducer or /review/build_log/test_suite_passed, takes true or false.
  • Only the fields the REPL report editor (edit) lets a tester change are accepted, from one shared list: verdict, comment, people.reviewer.name, an issue’s reproducer/status/comment, a tester-filed bug’s title/comment under new_issues, the verdict and comment of testing.install and testing.regression, a check row’s verdict, and the review answers and comments. Anything else is refused as read-only, notably a check row’s refhost, before and after, and all of testing.openqa: those are export’s. The next export rewrites every covered host’s check row, its verdict included. When the report has a new_issues list, a tester-filed bug is changed there, not under issues. A pointer to an object or list that holds such fields, such as /testing/regression, is refused as not a field.
  • A pointer under an absent testing.regression creates it with its keys null, then sets the field. An absent testing.install cannot be created this way, as its checks come from export.
  • The changed section goes through the same validation as report_section_write, and the write likewise changes local state only and marks the report dirty; commit uploads it.
  • Returns { "id", "pointer", "section", "dirty": true }.

report_issue_read (read-only)

  • Parameters (all optional): issue_id (such as bsc#1234567), template.
  • Without issue_id, returns { "id", "issues": [{"id","title","status", "severity","new"}] }, where new is true for a bug a tester filed and null otherwise; with it, { "id", "issue_id", "issue" }.

report_issue_write

Replaces one existing issue with value; the set of issues cannot grow or shrink. Validated and applied exactly like report_section_write. value is declared as an object; a string holding a JSON object is decoded.

  • Parameters (required): issue_id, value. Plus optional template.
  • Returns { "id", "issue_id", "dirty": true }.

report_new_issue_write

Files a bug found while testing, or updates one already filed. teregen keeps such a bug as an issue with new: true, so it also shows in report_issue_read.

  • Parameters (required): issue_id (bsc#…, bnc#…, boo#…, jsc#… or ijsc#…), title. Optional: comment, template.
  • An existing tester-filed bug gets the new title/comment and keeps its reproducer and status (answer those with report_issue_write); an empty comment clears it. A pipeline issue is refused.
  • Applied to local state like report_issue_write; commit uploads it.
  • Returns { "id", "issue_id", "dirty": true }.

report_new_issue_delete

Removes a bug filed with report_new_issue_write.

  • Parameters (required): issue_id. Plus optional template.
  • A pipeline issue, or an id the report does not have, is refused.
  • Returns { "id", "issue_id", "dirty": true }.

report_files (read-only)

Lists the report directory’s files — build_checks/, the install_logs directory, results/ and checkers.log — matched with the files teregen holds for the report, by name and server directory.

  • Parameters: template (optional).
  • Returns { "id", "files": [{"path","name","size","server"}], "server_only": [{"name","dir","path","origin","size","at"}] }, plus "server_error" when the server listing failed. files are the local regular files, sorted by path (report-directory-relative; subdirectories and symlinks are skipped). server is { "dir", "origin", "size", "at" } for the server copy report_file_read would read for that path (origin is pipeline or uploaded; dir is uploads, install_logs or build_checks, null from a server that does not say), or null when it has none; sizes differ until commit uploads. server_only lists server files with no local copy, one per dir when several directories hold the same name. path is the path report_file_read reads that copy from, or null when no path does: a same-named copy in uploads is read in place of the install_logs one, and a copy whose dir is missing or is not build_checks, install_logs or uploads, or whose name is not a plain file name, cannot be read on its own.
  • A failed server listing (not found, still generating, unreachable) never fails the call: the local list is returned with server_error set.

report_file_read (read-only)

Reads one of those files as text.

  • Parameters (required): path, relative to the report directory — either checkers.log or a file directly inside build_checks/, the install_logs directory or results/. Optional: offset (1-based first line, default 1), limit (maximum lines), template.

  • Returns { "id", "path", "total_lines", "content" }; a windowed read also carries offset and returned_lines. content is bounded by [mcp] max_output_bytes, and the read stops at [mcp] max_input_bytes (0 disables the cap), cutting a line that crosses it. A capped read ends with a notice, and total_lines then counts only the lines read up to the cap; the size of the unread rest is unknown.

  • A file the report directory lacks is read from the server instead, and the result then carries "source": "server" (a local read has no source key). The listing decides where the file is: mtui takes the first of these server directories that lists the file’s name.

    Local pathServer directories, in order
    build_checks/<name>build_checks
    <install_logs>/<name>uploads, then install_logs
    results/<name>uploads
    checkers.loguploads

    The tester’s committed copy in uploads wins over the pipeline’s install_logs file of the same name. With [mcp] max_input_bytes set, mtui sends Range: bytes=0-<cap> and so fetches at most one byte past the cap, which makes the usual capped-read notice appear; with 0 the whole file is fetched. The fetch is anonymous, like the listing.

  • Refuses a path that escapes the report directory (.., an absolute path, a symlink out), one outside the readable set, and a file that is neither local nor listed by the server. A server that lists the file but does not tag it with a directory (a teregen without artifact download) is refused with a message saying so; a report that is still generating is refused with a retry hint.

A result larger than [mcp] max_output_bytes comes back as { "truncated": true, "size", "content" }, where content is the capped JSON text, rather than as clipped (invalid) JSON.

Published report tools

Three hand-written read-only tools read TeReGen’s published copy of a report by rrid, with nothing loaded: a status table over several updates, a second tester reviewing a colleague’s report, a look before picking an update up. They never touch the loaded templates, the active template or a host, and send only anonymous GET requests to [url] teregen_api_v2. An rrid is refused before any request unless it parses and its maintenance component is letters, digits, ., _ and - only; a short spelling (S:M:…) reads the canonical id, which every result carries as rrid.

Every result also carries "source": "published". When this session has the same update loaded with report-document edits not yet uploaded by commit, it adds a note saying the published copy does not include them (or, when the loaded report is busy, that this is unknown); local files not yet uploaded are not tracked. A client cancel stops the call at its next request. Each call briefly locks the session to read its config and that flag, so a call that holds the session exclusively (a fan-out update, load_template, add_host with nothing loaded) delays it until it ends. These tools take no registry gate. Short server strings (id, kind, workflow, generated_at, a file’s name and dir) come back as one printable line, as error text does; section data and file content are returned as stored and may contain control characters, exactly as report_section_read and report_file_read return the loaded copy’s.

published_report (read-only)

  • Parameters: rrid (required), section (optional, one of the section names above).
  • Without section, returns { "rrid", "published": true, "id", "kind", "workflow", "generated_at", "sections": [{"name","size","has_unanswered"}], "complete", "unfilled": [...] }, the fields as report_sections gives them (there is no dirty). With it, { "rrid", "published": true, "id", "section", "data" }; a section the report lacks is refused.
  • TeReGen’s 404 on the document is an answer, not an error: { "rrid", "published": false, "message": "No report is published for <RRID>" }. Every other outcome is an error naming its cause: still generating, committing an earlier upload, stale, the id rejected, a transport failure or other status, a body that is not a report document (or a schema version this mtui does not read), or a document filed under another id.

published_files (read-only)

  • Parameters: rrid (required).
  • Returns { "rrid", "source", "count", "files": [{"name","dir","path","origin","size","at"}] } in the server’s order. path is what published_file_read reads the file from, by the table under report_file_read; it is null when a same-named copy in a preferred directory answers every such path, the dir is missing or not one of build_checks, install_logs and uploads, or the name is not a plain, printable file name. A failed listing is an error, never an empty list; whether a 404 here means no report is published is not established, so it is an error naming the 404.

published_file_read (read-only)

  • Parameters (required): rrid, path (checkers.log, or one plain file name directly under build_checks/, the install_logs directory or results/). Optional: offset, limit, as for report_file_read.
  • Returns { "rrid", "source", "path", "dir", "total_lines", "content" }, plus offset and returned_lines for a window. The path rules, the server directories, the byte caps and the decoding are report_file_read’s: the fetch asks for one byte past [mcp] max_input_bytes and ends a cut read with the same notice, and content is cut so the whole result fits [mcp] max_output_bytes with every other field kept.
  • Only a name the server’s listing holds is fetched; any other path is refused after the listing and before any file request. A path with ., .., an empty or absolute component, or outside the readable set is refused before any request. A file listed without a dir is refused with a message saying so.
  • An empty file has "total_lines": 0, "empty": true and a message saying it is empty. Bytes are decoded as lossy UTF-8, as report_file_read decodes them.

Like the report document tools, a published_report or published_files result larger than [mcp] max_output_bytes comes back as { "truncated": true, "size", "content" }.

Background jobs

Long-running commands run as background jobs so a tool call returns promptly with a job id you can poll. The slow host commands — run, check_hosts, update, downgrade, prepare, install, uninstall, set_repo, reboot, regenerate, add_host, load_template and request_review — accept a background=true parameter. Instead of holding the request open for the minutes the operation takes, the call returns immediately with the job id(s); when the command fans out across several templates it mints one job per template, each independently pollable and cancellable.

add_host and load_template -a connect to a whole batch of reference hosts, and one unreachable candidate among them can hold the call open far past any client’s patience — backgrounding is the only way to keep such a call cancellable via job_cancel.

Four job-control tools manage them:

  • job_list (read-only) — every job in the session and its state.
  • job_status(job_id, wait_seconds=0) (read-only) — one job’s state (running / done / failed / cancelled) and elapsed time; wait_seconds blocks for a terminal state first.
  • job_result(job_id, wait_seconds=0) (read-only) — a finished job’s captured output; it errors while the job is still running (or wait for it with wait_seconds) and surfaces the command’s failure envelope if it failed.
  • job_cancel(job_id) — cancel a running job. (A command already executing on a host may run to completion there even after cancel returns — the same caveat as Ctrl-C on a foreground run.) Two commands treat a cancel as a normal ending rather than a failure: request_review --watch stops watching (the request stays posted) and regenerate stops waiting (the server keeps building). Both return success, so their job ends done, not cancelled, with the reply text saying what was and was not finished. That covers regenerate’s wait only: a cancel while it reloads the finished report ends the job cancelled, as does a cancel while load_template waits for TeReGen.

wait_seconds (0-120, default 0) turns a poll loop into one held request: job_status and job_result park until the job is terminal or the budget lapses, then reply exactly as a plain poll would — the running snapshot, the output, or a “still running” error that now points at wait_seconds. Keep it under the client’s own request timeout; a value above 120 is refused, not clamped. While parked the call emits progress heartbeats if the client supplied a progressToken, and a notifications/cancelled interrupts it. Over HTTP rmcp additionally pings the per-request SSE stream every 15s; a client that silently disconnects instead leaves the wait to run out its budget server-side, holding nothing.

A job blocked mid host-operation cannot stop at a checkpoint, so cancelling it force-aborts the dispatch — which skips the operation’s own unlock(). A forced cancel therefore releases /var/lock/mtui.lock on the job’s behalf and reports the outcome in its reply.

What it releases is deliberately narrow: only the locks the cancelled job’s own host group actually took, and never a comment-marked (exclusive) hold such as a Product Increment assignment lock or an operator’s lock -c <text> reservation. Locks are owned per user + PID on the wire, so a broader sweep would remove a sibling template’s — or another MCP session’s — live hold on a shared refhost and report it as released.

The reply distinguishes: which hosts are now unlocked; which are still locked and by whom (check with list_locks; unlock --force releases the whole group of every loaded template); which release failed (check with list_locks and retry unlock once the host is reachable); and which templates could not be reached inside the release budget, whose lock state is therefore unknown. A cancel with no held lock to act on says nothing extra.

The release covers the templates the job’s dispatch resolved once it held its lock, so a job that ran on one template leaves the others alone; a job cancelled before it got that far uses the scope recorded when it was minted. A dispatch run with nothing loaded releases only the hosts added with add_host, even if a template was loaded since. One that resolved no template at all — a session-level command — falls back to every loaded template and the hosts added with add_host, the conservative reading for a dispatch that may have run across all of them.

Nothing else is done at the hosts. The remote command may still be running there; where it is a package transaction, the package manager’s own system-wide lock keeps serialising it, but a run or reboot has no such second layer and the release is purely mtui-side bookkeeping.

A cooperative cancel — a body that unwound at a checkpoint — is unchanged: it ran its own unlock discipline, and the cancel does not second-guess it.

Jobs are scoped to the session (under HTTP, the caller’s isolated session, so one client never sees another’s jobs). The per-session job budget (max_active_jobs, max_completed_jobs) and the single-result size cap (max_output_bytes) bound resource use so one client cannot exhaust the server or dwarf the client’s context.

Audit log

mtui-mcp executes consequential actions with nobody watching, so a configured server keeps a durable record of what ran. Set [mcp] audit_log to a file path; unset (the default) disables auditing and leaves behaviour byte-identical.

The sink is versioned JSONL, one object per line, opened O_APPEND with mode 0600 and fsynced before the response returns — entries survive a server restart and are never truncated. The open is O_NOFOLLOW and the resulting descriptor is vetted: anything that is not a regular file owned by the serving user is refused, so a planted symlink or FIFO cannot divert the append (or the 0600 tightening) onto another file. O_NOFOLLOW covers the path’s final component only — the sink’s directory must be writable by the serving user alone. A same-user hardlink is allowed on purpose; it crosses no boundary. The record is durable and append-only but not tamper-evident: there is no hash chain and no HMAC, so anyone writing as the owner can rewrite history undetected. Tamper evidence means shipping each record off-host as it lands — see OTLP log export. Every record carries principal: null, reserved for a future authenticated caller identity (#412): under HTTP every client acts with the server’s credentials, so records attribute to a session, never a person, and nothing client-declared (a header, a tool argument, an initialize client name) may ever populate it. An outcome record carries the schema version, the arrival timestamp, the sequence number, the session id, the transport, the reserved principal, the tool name, the (redacted, see below) arguments, the outcome (ok / error / unknown-tool), the duration, and the RRIDs and host names the call resolved to. An intent record carries the same header and the same arguments, and nothing that only exists afterwards. A terminal record carries no arguments at all.

With no template loaded, a call that acts on a report, such as run, lock or put, names the hosts added with add_host, and its rrids stay empty. A call that addresses no template (whoami, the job tools) names no host. The scope is the one the call ran under, so a call that waited for a load_template names the template it then ran on.

Host names on a record are best-effort: they are empty when the session is busy with an exclusive background job (a backgrounded load_template or add_host), because a record write never waits on the work it records; rrids are always recorded.

[mcp] audit_log_max_bytes (default 256 MiB) bounds the sink: the first open that finds the file at or over the cap rotates it to <path>.1, shifting .1….4 down one and discarding what was .5. That is usually an append, but the start-up probe opens the sink the same way, so a server can rotate before it answers anything. Archiving beyond .5 is the operator’s job. 0 disables rotation altogether; any other value below 4096 is raised to it with a warning, because a cap under one record’s worth rotates the trail away.

Rotation is housekeeping and never a gate: it neither blocks the dispatch worker nor refuses a call. Two servers may share one path, so it is serialised by an advisory lock on the file itself — taken without waiting. A writer that finds the lock held, or a filesystem that cannot take it at all (an NFS export without lockd answers ENOLCK), appends past the cap and rotates on a later call. A rename it cannot perform warns and keeps appending too, and that warning is not repeated until a rotation succeeds. Two consequences worth knowing when reading the files back: a writer that opened the sink just under the cap lands its line in <path>.1, so seq is monotonic overall but the order across the boundary file is not; and on NFS, Linux emulates flock with per-process POSIX locks, so two HTTP sessions in one process do not serialise there — at worst a second shift, never a refused call.

A tool that is not advertised readOnlyHint writes an intent record before it runs — schema version, arrival timestamp, sequence number, session, transport, reserved principal: null (see Audit log), event: "intent", tool, (redacted) arguments, and the trace correlation when the client supplied one. The bounded vendor tracestate rides alongside when it validates (1..=512 bytes, key=value members, at most 32; keys at most 256 characters — tenant 241, system 14 — values at most 256); malformed or oversized values are dropped, never stored. Nothing else, because nothing else exists yet. Its outcome record then carries intent: <seq>, and its duration_ms — measured from arrival, like ts — includes the intent record’s own write. Read-only tools skip the intent and write only the outcome record, so a poll loop still costs one record per call.

Both fields are an untrusted correlation key only: whatever the client sent, never an identity or an authorisation, reaching no shell and changing no dispatch or output byte — the same call with and without them answers identically, and the records differ only by those fields.

A backgrounded call therefore writes three records: the intent, a dispatch record naming the started job_ids, and a terminal record when the job reaches done / failed / cancelled, joinable by job id. The terminal record carries no arguments and no intent — it joins its dispatch by job_id, which also matters because a terminal record’s seq is not ordered against the calls around it in either direction: neither against its own dispatch record, since a job that settles at once can be minted first, nor against a job_result(wait_seconds) reply that waited for it. Join by job_id, never by seq. The terminal record also carries no trace context: the job outlives the call whose _meta supplied it.

A configured sink is probed once at start-up, before the OTLP probe: if it cannot be opened the server refuses to start and names the path on stderr, rather than loading quietly and failing on the first tool call.

Afterwards the sink fails in two different ways, on purpose. If the intent write fails the call is refused and nothing ran — the guarantee the sink exists to make. If the outcome write fails the work has already happened, so the executed result is still returned with [audit: outcome record lost (<reason>)] appended — as a trailing text block on a successful reply, or to the message of an error one. Discarding a result to report a logging failure would tell the client a refusal that never happened. The notice is always the last content block, so content[0] stays the verbatim payload a --json caller parses, and it is not counted in the record’s response_bytes. A failed terminal write can only warn — its dispatch already answered.

Reading the log back: an intent that no later record points at means “started, outcome not recorded” — a crash or a kill, or a lost outcome write whose client was told in band (and which the OTLP stream may still hold).

A put that uploaded a source file adds upload: {path, bytes, sha256} to its outcome record (the resolved path and a fingerprint, never the body). The intent record already holds the requested path in args.source; a call that failed on some host has no upload.

No tool argument carrying a credential in bulk lands verbatim. File-body payloads (put content/content_b64, report_section_write/report_issue_write/report_field_write value, report_new_issue_write title/comment) each record {bytes, sha256} over the original string, so a credentials file or SSH key uploaded via put stays correlatable without being persisted. Always fingerprinted, never inline, regardless of size — the same redaction feeds the file body, the OTLP body, and the size accounting, and no payload key is ever an indexed OTLP attribute.

Everything else is masked, not trusted. Every recorded string, at any nesting — run and comment argv included — runs through a token scanner that strips URL userinfo (and only that: every other byte of a URL is kept, since the record is of what ran) and replaces the value of a secret-named flag or key: --password secret, DB_PASSWORD=…, x-api-key: …, Authorization: Bearer …, Authorization: token … and '{"password":"…"}' all record <redacted>, through the quoting a shell line or a JSON payload wraps them in, while token_bucket=50, max_tokens=100, grep token file and ssh -p 22 host are left legible. Bearer, Basic and token keep their place in front of the credential they name — but only after a key that is itself a credential name, so Basic functionality verified stays a sentence.

The scanner keys on the name beside the value, so what it does not catch is worth knowing rather than discovering: a bare secret with no key beside it; a single-letter flag, whose meaning is per-program (sshpass -p secret, curl -u user:pass, psql -U user); a value attached to one (-pSECRET, -U user%pass); and anything passed by environment variable, stdin or a file the tool reads.

All file I/O runs on the blocking pool (spawn_blocking), so a down or slow disk never stalls the dispatch worker or the other calls it is serving — the one call that waits is the one whose own records are being written.

OTLP log export

The same record can also go to an OpenTelemetry collector as OTLP/HTTP LOGS (hand-rolled protobuf over the workspace reqwest/rustls stack — no opentelemetry-* crates): one log record per audit event, body = the verbatim JSONL line (already redacted and fingerprinted as above). Configuration is env-only (headers must never be CLI flags), so there are no new TOML keys:

  • OTEL_EXPORTER_OTLP_ENDPOINT (base URL, gains /v1/logs) or OTEL_EXPORTER_OTLP_LOGS_ENDPOINT (full URL, wins verbatim). Unset-or-empty disables export, as does an invalid endpoint or a non-http/protobuf protocol (validated only when an endpoint exists).
  • OTEL_EXPORTER_OTLP_HEADERS / OTEL_EXPORTER_OTLP_LOGS_HEADERS (key=value,..., values percent-decoded; logs-specific wins).
  • OTEL_EXPORTER_OTLP_PROTOCOL / OTEL_EXPORTER_OTLP_LOGS_PROTOCOL: only http/protobuf or unset.
  • OTEL_SERVICE_NAME (default mtui): resource service.name, the multi-deployment join key.

Sink matrix: file-only (audit_log set, no endpoint), OTLP-only (endpoint set, audit_log unset — the JSONL line is still built in memory and used verbatim), both (file first in seq order, then OTLP), neither (auditing off, dispatch byte-identical).

Each record carries closed mtui.* attributes (tool, event, seq, transport, session.id, plus outcome when there is one, response_bytes when sized, and allowlisted kwarg keys) and the W3C trace ids when the client supplied a strict lowercase 55-byte traceparent via _meta (also echoed as the record’s trace field; session.id stays server-minted). A valid tracestate rides the verbatim JSONL body as the record’s tracestate field but is never an indexed attribute. A startup probe posts one real diagnostics record (~5x500 ms) before serving and latches export health; failed batches merge into a pending audit_gap sent on recovery. Batching: 2048/stream cap, 512/batch, 500 ms interval, 10 s request timeout, 5 s shutdown flush, redirects off, [mtui] ssl_verify TLS posture.

Export never gates a tool call. The health latch decides whether a record is enqueued, nothing more: an unhealthy or full exporter logs a warning, merges the record’s seq into the audit_gap it will report on recovery, and the call still runs and still answers. The file sink stays the durable truth, so OTLP-only mode never refuses anything. Tracing diagnostics ride a separate best-effort queue (drop + counter; exporter/HTTP-stack targets excluded). The endpoint value never appears in logs, records, or errors.

Shipping the audit log

The file sink above is the durable truth, but it is local and — as noted — not tamper-evident. To get records off-host, into a SIEM, a log store, or any OpenTelemetry backend, tail the JSONL file with a collector’s filelog receiver. A minimal OpenTelemetry Collector Contrib setup lives in dist/otel-collector.yaml.example (tested with otelcol-contrib 0.164.0):

  • Receiver: filelog over [mcp] audit_log. include the audit path (plus <path>.1…<path>.5 if the rotated generations should ship too), start_at: end so a first start tails only new lines instead of re-shipping history, storage: file_storage so a restart resumes from its checkpoint (no re-ship, no gap), and a json_parser operator so each JSON line lands as attributes — queryable tool, event, outcome, seq, transport, session, args, … (the record’s own field names; the full line stays in the body too) — not one opaque message blob. Which fields exist depends on the event: intent has no outcome; terminal has no args and carries job_id/job_state instead.
  • Rotation stays mtui’s job. The sink rotates by size-cap shift (<path> → <path>.1, .1….4 down one, what was .5 discarded) under an advisory lock the collector never takes part in; the receiver tracks each file by fingerprint across the rename. Never point a copytruncate-style rotation at the sink — mtui only ever appends and renames, and an operator-side truncate would lose or duplicate lines. Archiving beyond .5 is yours to arrange (ship-then-delete, or move aside before the next shift discards it).
  • Permissions: same-user sidecar. The sink is 0600 owned by the serving user — created that way and re-tightened on every open, so a looser mode never survives the next write and no supplementary-group arrangement sticks. Run the collector as that same user, typically a same-user sidecar. Never o+r, never 0644: the record names consequential actions, and group/other write must stay off regardless, since the sink vetting refuses anything not owned by the serving user and a writable-by-others directory already voids the symlink/FIFO guarantee above.
  • Sensitivity: the file names consequential things. Every call and dispatch record carries the tool name, the outcome, the RRIDs and best-effort host names the call resolved to, and the redacted arguments (secrets masked, file bodies fingerprinted as {bytes, sha256} — see above). An intent record carries the same header and arguments but no outcome; a terminal record carries no arguments, only the tool, session, transport, duration, RRIDs and host names, the job id, its terminal state, and the outcome. Anyone who can read the shipped stream learns which hosts were acted on and how the calls ended. The example’s debug exporter prints each shipped record — redacted arguments and host names included — to the collector’s stdout, so keep that output (journals, container logs) to the same audience. Treat the collector endpoint, its storage, and its headers/tokens with the same care as the hosts themselves.
  • Correlation: the trace field joins caller spans — when populated. A line without trace still ships, so never filter on its presence; records name a session, never a person. See Audit log for the field rules.

Cancelling a foreground call

A client that sends an explicit notifications/cancelled for an in-flight foreground tool call drops the dispatch and releases the CommandLock it was holding — a follow-up call on the same RRID is not left queued behind it. What happens next depends on whether the call could be holding a host operation lock.

A report_* tool, a transfer tool (get/put) or a parked job_status/job_result wait never dispatches through the engine, so it cannot hold /var/lock/mtui.lock: the cancel drops the dispatch immediately and the tool call resolves to an error rather than a fabricated success.

A synthesised command tool (run, update, install, …) can be mid host-operation when the cancel arrives, and dropping it outright would strand that lock exactly as an unhandled job_cancel would. It instead runs the same two-stage sequence job_cancel uses: the dispatch’s own cancellation token is signalled first, giving it a short grace period to unwind at a checkpoint (a body that does — for example one already watching the session’s cancel token — returns its own verdict, success or failure, not a synthetic cancellation error). Only if the grace elapses is the dispatch force-aborted; the abort then best-effort releases /var/lock/mtui.lock on every host the call’s own group actually took (never a comment-marked reservation) and the error text names what it unlocked, what is still locked and by whom, and what could not be reached inside the release budget.

This only helps a client that sends the notification. mtui-mcp’s default transport is stdio, where there is no per-request connection to drop — a client that simply stops waiting (e.g. because it hit its own timeout) sends nothing, and the server has no way to learn the caller gave up. In that case the lock is still released, just on the ordinary schedule: the connect_timeout budget and the shared backup-retry budget bound how long that takes rather than leaving it unbounded. Backgrounding a slow command (background=true, see above) plus job_cancel remains the reliable way to recover a stuck call regardless of transport.

Long-running calls: progress heartbeats

Many commands legitimately take minutes (a run against a slow refhost, an update, a checkout). To keep MCP clients from timing out, mtui-mcp emits notifications/progress while a slow tool runs — for both synthesised command tools and the hand-written tools — provided the client supplied a progressToken on the request. Spec-compliant clients (Claude Desktop, opencode, the MCP Inspector, Cursor, …) reset their read deadline on each frame, so a ten-minute command still returns cleanly. Clients that ignore progress notifications should raise their own per-server read timeout instead. The job-control tools emit them only while parked on wait_seconds.

Connecting a client

mtui-mcp speaks standard MCP framing. A stdio client spawns the binary as a subprocess; an HTTP client connects to http://HOST:PORT/mcp.

Claude Desktop (stdio) — in claude_desktop_config.json:

{
  "mcpServers": {
    "mtui": { "command": "mtui-mcp", "args": ["--transport", "stdio"] }
  }
}

opencode (remote HTTP) — start mtui-mcp --transport http --port 8765, then in opencode.json:

{
  "mcp": {
    "mtui": { "type": "remote", "url": "http://127.0.0.1:8765/mcp", "enabled": true }
  }
}

opencode also accepts "type": "local" with "command": ["mtui-mcp", "--transport", "stdio"] to spawn it per-session instead.