mcp icon indicating copy to clipboard operation
mcp copied to clipboard

Support Response::image() and Response::audio()

Open yncki opened this issue 2 months ago • 0 comments

Support Response::image() and Response::audio() (currently throws NotImplementedException)

Binary response helpers for images and audio—Response::image() and Response::audio()—are not currently supported and throw NotImplementedException. The generic Response::blob() is also not supported by tools, so there’s no viable workaround for returning binary payloads.

Current behavior

Response::image() → throws NotImplementedException

Response::audio() → throws NotImplementedException

Response::blob() → not supported by the tools layer (binaries can’t be surfaced/streamed correctly)

Expected behavior

Provide first-class support for binary responses:

Response::image($binaryOrStream, string $mime = 'image/png', ?string $filename = null, array $headers = [])

Response::audio($binaryOrStream, string $mime = 'audio/mpeg', ?string $filename = null, array $headers = [])

(Optional) generic helper:

Response::blob($binaryOrStream, string $mime, ?string $filename = null, array $headers = [])

Tools integration should correctly pass through/preview or stream these responses.

yncki avatar Oct 17 '25 17:10 yncki