MCP inspector: JSON captures and assertions
Scope: This page covers the MCP inspector plugin for testing your own MCP server inside a flow. To connect a coding agent to Reflow’s own MCP server, see the MCP reference.
The MCP inspector can capture a public scalar from one tool call for use in later steps and assert exact JSON structure on responses. Captures are retained in evidence; keep credentials in private bindings or owner-only token files.
Declare api in flow frontmatter and connect its private binding:
providers: api: MCPCapture a scalar
Section titled “Capture a scalar”Use your binding alias as the receiver. call_value takes the same tool and arguments as call, plus a required RFC 6901 JSON Pointer in select:
api.call_value tool="create_record" arguments="{\"title\":\"test record\"}" select="/id" -> record_idapi.call tool="get_record" arguments="{\"id\":\"${record_id}\"}" expect="{\"isError\":false,\"json\":[{\"pointer\":\"/id\",\"equals\":\"${record_id}\"}]}"Each command calls its tool once. A failed selection never replays the tool call; a lost reply is recorded as unknown completion.
Selection reads structuredContent when present, or joins text blocks with newlines and parses the result as JSON. The empty pointer "" selects the root; /a~1b selects member a/b, and /a~0b selects member a~b.
Every capture is an RFL string: numbers preserve their exact JSON spelling and booleans return true or false. ${record_id} interpolates safely into a later JSON string value (quotes and backslashes are escaped automatically), but cannot be inserted as a JSON member name or an unquoted numeric token. See references in JSON arguments.
call_value accepts positive-result checks (textIncludes, textExcludes, redacted, json) and always requires a non-error tool result. Use call to assert isError: true or a JSON-RPC refusal.
Assert JSON
Section titled “Assert JSON”The json expectation takes 1–32 assertions. Each specifies a pointer and one operator:
| Operator | Operand and meaning |
|---|---|
exists | Boolean: whether the pointer resolves (a present null exists). |
equals | String, number, boolean, or null, using exact decimal comparison for numbers. |
type | string, number, boolean, null, array, or object. |
count | Exact integer 0–10,000: array element count or object member count. |
includes | Literal substring of a string target. |
api.call tool="get_record" arguments="{\"id\":\"${record_id}\"}" expect="{\"isError\":false,\"json\":[{\"pointer\":\"/enabled\",\"equals\":true},{\"pointer\":\"/members\",\"count\":2},{\"pointer\":\"/deleted_at\",\"equals\":null}]}"Expanded expect payload for readability:
{ "isError": false, "json": [ { "pointer": "/enabled", "equals": true }, { "pointer": "/members", "count": 2 }, { "pointer": "/deleted_at", "equals": null } ]}Tool calls and gateway helpers assert against structuredContent, or a single text block parsed as JSON (unlike call_value, JSON assertions do not join multiple text blocks). read_resource inspects its single text entry; get_prompt inspects the {description, messages} envelope. Missing JSON, repeated object members, or an uncheckable source fails every assertion with source-unavailable evidence. json cannot be combined with rpcError.
All assertions are evaluated and evidence records pointers, operators, pass flags, and fixed failure reasons—without storing raw target or operand values.
Check absence and binding-secret exposure
Section titled “Check absence and binding-secret exposure”api.call tool="whoami" expect="{\"isError\":false,\"textExcludes\":[\"other-user-marker\"],\"redacted\":false}"textExcludes performs an exact, case-sensitive search across decoded string values and member names in the full result or error—including metadata, annotations, embedded resources, error data, and nested JSON string literals up to four layers deep—before truncation and after binding secrets and terminal controls are stripped.
Pair textExcludes with an explicit positive assertion so an error or empty reply cannot satisfy it trivially. Add "redacted": false to fail whenever a private binding value or stripped terminal control appeared anywhere in the raw reply. Neither check decodes arbitrary encodings such as base64 or percent encoding.
Limits and redaction rules
Section titled “Limits and redaction rules”| Rule | Limit / behavior |
|---|---|
Captured scalar (call_value) | String, number, or boolean only, max 4 KiB, no control characters or private binding values. null, objects, arrays, missing paths, non-JSON text, tool errors, and repeated object members fail with no capture. |
| JSON assertions per call | 1–32 assertions; count accepts integers 0–10,000. |
| Numeric comparator precision | Max 1,000 mantissa digits, 1,024 bytes total, and 6 significant exponent digits. Host admission requires a finite value with abs(n) <= 9,007,199,254,740,991, while exact comparison preserves original decimal spelling (e.g., 1e-400 is admitted and compares unequal to 0). |
| Private binding protection | Malformed or private pointers/operands are refused before contacting the server (including numeric equivalents and boolean/null spellings). Target strings containing private values or terminal controls cannot satisfy equals or includes. |