Skip to main content
Intercept mode pauses MCP messages in transit between client and server, letting you inspect and modify JSON-RPC payloads before they reach their destination.

Enabling intercept mode

Start the proxy with the --intercept flag:
qai proxy start \
  --transport stdio \
  --target-command "python my_server.py" \
  --intercept
You can also toggle intercept mode at runtime using the i key.

TUI layout

The proxy TUI has three panels:
  • Message list (left) — Scrollable list of all proxied messages. Client-to-server messages show >, server-to-client show <. Held messages are prefixed with a pause icon, dropped messages with a cross mark.
  • Message detail (right) — Full JSON-RPC payload of the selected message. In edit mode, this becomes an editable text area.
  • Status bar (bottom) — Shows current mode ([PASSTHROUGH] or [INTERCEPT]), total message count, held message count, and connection status.

Intercepted message actions

When a message is held, you can take one of three actions:
ActionEffect
FORWARDSend the message to its destination unchanged
MODIFYEdit the JSON-RPC payload, then send the modified version
DROPDiscard the message without forwarding

Keyboard shortcuts

KeyAlternateAction
qQuit the proxy
iToggle intercept mode on/off
fF5Forward the held message
dF8Drop the held message
mF6Enter edit mode (modify)
Ctrl+SConfirm edit and forward modified message
EscapeCancel edit (forwards message as-is)
sSave session to file
rF9Replay selected message against the server
/Focus the message filter input

Edit mode

Press m or F6 on a held message to enter edit mode. The detail panel becomes a JSON text editor. Edit the JSON-RPC payload, then press Ctrl+S to validate and forward the modified message. Press Escape to cancel and forward the original. Invalid JSON or schema errors are reported in a notification — the editor stays open so you can fix the issue.

Filtering messages

Press / to focus the filter input. Filter syntax:
PrefixEffectExample
>Show client-to-server only>initialize
<Show server-to-client only<result
(none)Substring match on method or payloadtools/call
Press Escape in the filter input to return to the message list.

Mode switching

When you switch from INTERCEPT to PASSTHROUGH (press i), all currently held messages are automatically forwarded.
Intercept mode slows traffic because every message waits for user action. Use it for targeted inspection of specific interactions, not bulk capture. For passive recording, run without --intercept.