Description
Handle inbound server→client JSON-RPC requests (sampling, roots, elicitation) via a pluggable handler registry on McpClient. Today the SDK answers these itself (unset callbacks → JSON-RPC error response); the seam is pinned by test_inbound_request_rejected_with_method_not_found.
Why
MCP servers use sampling/createMessage to ask the client to run inference, roots/list to scope file access, and elicitation to request user input. Octave's agent flows (prompt assembly, permission scoping) need to answer these instead of erroring.
Scope
References
Description
Handle inbound server→client JSON-RPC requests (sampling, roots, elicitation) via a pluggable handler registry on
McpClient. Today the SDK answers these itself (unset callbacks → JSON-RPC error response); the seam is pinned bytest_inbound_request_rejected_with_method_not_found.Why
MCP servers use
sampling/createMessageto ask the client to run inference,roots/listto scope file access, and elicitation to request user input. Octave's agent flows (prompt assembly, permission scoping) need to answer these instead of erroring.Scope
McpClient(e.g.on_sampling(...)/on_roots(...)callbacks wired intoClientSessionkwargs at connect time)sampling/createMessagewith -32600 via the unset-callback path, not -32601 (see PR feat(mcp): implement MCP client core (JSON-RPC 2.0) #81)tests/mcp/conftest.pyPeer.send_request)References
.agents/specs/2026-09-10-mcp-client-core-design.mdoctave.mcp.client_on_inbound_messagedocstring, PR feat(mcp): implement MCP client core (JSON-RPC 2.0) #81