karellen-rr-mcp

v0.3.1
karellen-rr-mcp Checked 4 days ago Published 1 month ago

MCP Server for rr Reverse Debugging

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

rr_record

Record a command with rr. Returns trace directory path. Args: command: Command and arguments to record (e.g. ["./my_test"]). working_directory: Working directory for the recorded process. env: Optional extra environment variables for the recorded process. trace_dir: Output trace directory. If omitted, rr uses its default (~/.local/share/rr/).

ParameterTypeDescription
command *array
envobject
trace_dirstring
working_directorystring

rr_replay_start

Start a replay session. Launches rr gdbserver and connects GDB/MI. Args: trace_dir: Path to rr trace directory. If omitted, uses the latest trace. pid: PID of a specific subprocess to replay. Use rr_ps to list available processes.

ParameterTypeDescription
pidinteger
trace_dirstring

rr_replay_stop

Stop the current replay session and clean up.

rr_list_recordings

List available rr trace recordings. Args: trace_base_dir: Base directory for traces. Defaults to ~/.local/share/rr.

ParameterTypeDescription
trace_base_dirstring

rr_ps

List processes in an rr trace recording. Args: trace_dir: Path to rr trace directory.

ParameterTypeDescription
trace_dir *string

rr_traceinfo

Get trace metadata (header info in JSON format). Args: trace_dir: Path to rr trace directory.

ParameterTypeDescription
trace_dir *string

rr_rm

Remove an rr trace recording. Args: trace_dir: Path to rr trace directory to remove.

ParameterTypeDescription
trace_dir *string

rr_when

Get the current rr event number. Useful for knowing your position in the trace.

rr_breakpoint_set

Set a breakpoint at a function, file:line, or address. Args: location: Breakpoint location (e.g. "main", "foo.c:42", "*0x400500"). condition: Optional condition expression (e.g. "i > 10"). temporary: If true, breakpoint is deleted after first hit.

ParameterTypeDescription
location *string
conditionstring
temporaryboolean

rr_breakpoint_remove

Remove a breakpoint by its number. Args: breakpoint_number: The breakpoint number to remove.

ParameterTypeDescription
breakpoint_number *integer

rr_breakpoint_list

List all breakpoints.

rr_watchpoint_set

Set a hardware watchpoint on a variable or expression. Args: expression: Expression to watch (e.g. "my_var", "*0x601050"). access_type: One of "write", "read", or "access".

ParameterTypeDescription
expression *string
access_typestring

rr_continue

Continue execution forward or backward until breakpoint/signal/end. Args: reverse: If true, continue backward (reverse execution).

ParameterTypeDescription
reverseboolean

rr_step

Step into (source-level) forward or reverse. Args: count: Number of steps (forward only). reverse: If true, step backward.

ParameterTypeDescription
countinteger
reverseboolean

rr_next

Step over (source-level) forward or reverse. Args: count: Number of steps (forward only). reverse: If true, step backward.

ParameterTypeDescription
countinteger
reverseboolean

rr_finish

Run to function return (or to call site if reverse). Args: reverse: If true, run backward to the call site.

ParameterTypeDescription
reverseboolean

rr_run_to_event

Jump to a specific rr event number. Args: event_number: The rr event number to seek to.

ParameterTypeDescription
event_number *integer

rr_thread_list

List all threads in the replayed process with their current state and location.

rr_thread_select

Switch to a different thread. Args: thread_id: Thread ID to switch to (from rr_thread_list).

ParameterTypeDescription
thread_id *string

rr_select_frame

Select a stack frame for inspection. After selecting, rr_locals and rr_evaluate operate in the selected frame's context. Args: frame_level: Frame number from rr_backtrace (0 = innermost/current).

ParameterTypeDescription
frame_level *integer

rr_backtrace

Get the call stack (backtrace). Args: max_depth: Maximum number of frames to return.

ParameterTypeDescription
max_depthinteger

rr_evaluate

Evaluate a C/C++ expression in the current context. Args: expression: Expression to evaluate (e.g. "x + 1", "sizeof(struct foo)").

ParameterTypeDescription
expression *string

rr_locals

List local variables with their current values.

rr_read_memory

Read raw memory bytes at an address. Args: address: Memory address to read (e.g. "0x7ffd1234"). count: Number of bytes to read (default 64).

ParameterTypeDescription
address *string
countinteger

rr_registers

Read CPU registers. Args: register_names: Specific register names to read. If omitted, reads all.

ParameterTypeDescription
register_namesarray

rr_source_lines

List source code around current position or a specific location. Args: file: Source file path. If omitted, uses current position. line: Line number. If omitted, uses current position. count: Number of lines to show (default 10).

ParameterTypeDescription
countinteger
filestring
lineinteger

rr_checkpoint_save

Save a checkpoint at the current position. Returns checkpoint info.

rr_checkpoint_restore

Restore to a previously saved checkpoint. Args: checkpoint_id: The checkpoint ID to restore.

ParameterTypeDescription
checkpoint_id *integer