Skip to content

Turn manual MCP checks into CI scripts

Every TUI action has a CLI equivalent, so the checks you run by hand can run again unattended.

From a manual run to a CI script. Every TUI action has a CLI equivalent: copy one call with c, export the whole session as a replay script with Ctrl+E, and gate CI on exit codes and JSON output.

On the main screen or the debug screen, Ctrl+E writes two files to the current directory: mcp-tui-session-<timestamp>.json, the recorded events, and mcp-tui-session-<timestamp>.sh, one CLI command per tool call, resource read and prompt you ran:

#!/usr/bin/env bash
# Generated by mcp-tui session recording.
# Each line replays one recorded MCP request against the same server.
set -euo pipefail
mcp-tui --transport http --url http://127.0.0.1:8931/mcp tool call search_tickets limit=3 status=open

The script is executable and stops at the first failing call.

--format json (-f json) prints the call, its arguments and the result:

Terminal window
mcp-tui --url "$DESK" tool call search_tickets status=open -f json \
| jq -r '.result.structuredContent.tickets[].id'

Progress messages go to stderr, so stdout stays clean for jq; --porcelain drops them altogether.

A tool that reports a failure returns a result with isError: true, and by default the command still exits 0 so a script can read the payload. --strict-errors exits 1 instead, and --strict-output exits 1 when a result breaks the tool’s outputSchema:

Terminal window
mcp-tui --url "$DESK" tool call lookup_customer customer_id=C-4040 --strict-errors
echo "exit=$?"

mcp-tui conform --report-junit conform.xml "$MCP_URL" runs every protocol scenario and probe and writes a JUnit report; see Check a server for spec compliance. The Automation & CI guide covers stub flags for servers that ask the client for input.