Feature hasn't been suggested before.
Describe the enhancement you want to request
Summary
When a user cancels an opencode turn while an MCP tool is running, opencode should notify the MCP server so the server can stop the in-flight tool work.
Problem
Today the local opencode session/tool state can be cancelled, but the MCP tool request itself may keep running on the MCP server. This can leave external work, subprocesses, browser sessions, or other long-running handlers active after the user has cancelled.
Expected behavior
User-initiated cancellation should be forwarded to the pending MCP request. The MCP server should receive the standard MCP cancellation notification for that request.
Suggested implementation
Forward the tool execution abort signal to the MCP SDK request options when calling client.callTool:
- pass opts.abortSignal as RequestOptions.signal
- keep existing local cancellation behavior unchanged
Acceptance criteria
- Cancelling an opencode turn while an MCP tool is running cancels the pending MCP request.
- The MCP server receives a cancellation notification for that request.
- Existing local cancellation behavior still works.
Feature hasn't been suggested before.
Describe the enhancement you want to request
Summary
When a user cancels an opencode turn while an MCP tool is running, opencode should notify the MCP server so the server can stop the in-flight tool work.
Problem
Today the local opencode session/tool state can be cancelled, but the MCP tool request itself may keep running on the MCP server. This can leave external work, subprocesses, browser sessions, or other long-running handlers active after the user has cancelled.
Expected behavior
User-initiated cancellation should be forwarded to the pending MCP request. The MCP server should receive the standard MCP cancellation notification for that request.
Suggested implementation
Forward the tool execution abort signal to the MCP SDK request options when calling client.callTool:
Acceptance criteria