Files: src/services/mcp/client.py, src/services/mcp/transport.py
Background: PR #135 explicitly defers MCP cancellation:
MCP tools: out-of-process JSON-RPC; transport-level cancellation is a cross-cutting change across the entire MCP client.
Verification: grep -rln abort_controller src/services/mcp/ returns nothing on current main.
Impact: A slow MCP tool (database query, remote API exposed by a plugin) cannot be cancelled mid-call. If the server hangs, the REPL hangs with it until the (often generous) MCP request timeout.
Fix sketch: JSON-RPC 2.0 supports $/cancelRequest. Plumb the abort signal through McpClient.call_tool, send $/cancelRequest with the in-flight request id on abort, then return an AbortError. Servers that ignore the notification still leak a request but the client unblocks.
Files:
src/services/mcp/client.py,src/services/mcp/transport.pyBackground: PR #135 explicitly defers MCP cancellation:
Verification:
grep -rln abort_controller src/services/mcp/returns nothing on currentmain.Impact: A slow MCP tool (database query, remote API exposed by a plugin) cannot be cancelled mid-call. If the server hangs, the REPL hangs with it until the (often generous) MCP request timeout.
Fix sketch: JSON-RPC 2.0 supports
$/cancelRequest. Plumb the abort signal throughMcpClient.call_tool, send$/cancelRequestwith the in-flight request id on abort, then return anAbortError. Servers that ignore the notification still leak a request but the client unblocks.