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§
Enums§
Constants§
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/jsonbody and a Streamable HTTPtext/event-streamframing (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 rawconfigJSON blob — the exact objectagent_config::build_mcp_config_from_refsmerges 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 🔒