Skip to content

Forward rich image display outputs as MCP ImageContent blocks#16

Draft
ncoop57 wants to merge 1 commit into
mainfrom
images
Draft

Forward rich image display outputs as MCP ImageContent blocks#16
ncoop57 wants to merge 1 commit into
mainfrom
images

Conversation

@ncoop57

@ncoop57 ncoop57 commented Jul 11, 2026

Copy link
Copy Markdown

What

Adds support for forwarding image display outputs (PNG, JPEG, GIF, WebP) from the worker as MCP ImageContent blocks, so MCP clients can receive and render images natively.

How

  • CLI worker: New --media flag appends <media mime="...">base64</media> elements after rendered text for image display outputs.
  • MCP server: New media=True parameter on run_mcp (default). _split_media extracts <media> elements from worker responses and converts image types to ImageContent blocks. Text-only responses are unchanged (returned as a plain string).
  • Backward compatible: Without --media, the worker produces no <media> elements — existing stream-protocol consumers see no change.

Docs

Updated skill.py documentation to describe the new image-forwarding behavior.

@ncoop57 ncoop57 added the enhancement New feature or request label Jul 11, 2026
@ncoop57 ncoop57 marked this pull request as draft July 11, 2026 19:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant