Skip to main content

Module mcp_probe

Module mcp_probe 

Source
Expand description

MCP server health/prerequisite probe (docs/specs/SPEC_MCP_INTEGRATION_PARITY_ABLETON_PILOT_2026_07_08.md §4.4).

Opens a short-lived MCP client connection to a configured server — spawns the stdio process (or POSTs to the http url), performs the initialize handshake, then tools/list — and reports whether it’s reachable at all.

This is a protocol-level probe only. For a server like ableton-mcp, a successful probe means the MCP process itself started and speaks the protocol — NOT that the underlying app (Ableton Live) is running, since that dependency is only exercised when a tool is actually called. That gap is why the catalog’s prereqNote (static remediation text, §4.6) exists alongside this dynamic check, not instead of it.

Deliberately hand-rolled rather than pulling in an MCP client SDK crate (e.g. rmcp): crates/mcp/src/main.rs already hand-rolls the server side of this exact newline-delimited JSON-RPC 2.0 wire format, so a probe-only client follows the same house style instead of adding a new dependency for a handshake this small.

Structs§

ProbeResult

Enums§

ProbeStatus

Constants§

PROBE_TIMEOUT 🔒
PROTOCOL_VERSION 🔒

Functions§

initialize_request 🔒
post_jsonrpc 🔒
POSTs one JSON-RPC request and returns the first JSON object in the response body — handling both a plain application/json body and a Streamable HTTP text/event-stream framing (event: message\ndata: {...}\n\n), since a probe only needs the first frame either way.
probe
Probe a server given its transport ("stdio" | "http" | "sse" | any other free-text value from the pre-v11 field, treated as stdio for back-compat) and its raw config JSON blob — the exact object agent_config::build_mcp_config_from_refs merges into .mcp.json.
probe_http 🔒
probe_stdio 🔒
read_json_line 🔒
Reads lines until one parses as JSON (skipping blank lines or stray non-JSON output, e.g. a server printing a startup banner to stdout), or the stream closes.
run_stdio_handshake 🔒
tools_list_request 🔒
write_line 🔒