core-agent-ide/codex-rs/rmcp-client/src
Gabriel Peal b0bdc04c30
[MCP] Render MCP tool call result images to the model (#5600)
It's pretty amazing we have gotten here without the ability for the
model to see image content from MCP tool calls.

This PR builds off of 4391 and fixes #4819. I would like @KKcorps to get
adequete credit here but I also want to get this fix in ASAP so I gave
him a week to update it and haven't gotten a response so I'm going to
take it across the finish line.


This test highlights how absured the current situation is. I asked the
model to read this image using the Chrome MCP
<img width="2378" height="674" alt="image"
src="https://github.com/user-attachments/assets/9ef52608-72a2-4423-9f5e-7ae36b2b56e0"
/>

After this change, it correctly outputs:
> Captured the page: image dhows a dark terminal-style UI labeled
`OpenAI Codex (v0.0.0)` with prompt `model: gpt-5-codex medium` and
working directory `/codex/codex-rs`
(and more)  

Before this change, it said:
> Took the full-page screenshot you asked for. It shows a long,
horizontally repeating pattern of stylized people in orange, light-blue,
and mustard clothing, holding hands in alternating poses against a white
background. No text or other graphics-just rows of flat illustration
stretching off to the right.

Without this change, the Figma, Playwright, Chrome, and other visual MCP
servers are pretty much entirely useless.

I tested this change with the openai respones api as well as a third
party completions api
2025-10-27 17:55:57 -04:00
..
bin [MCP] Render MCP tool call result images to the model (#5600) 2025-10-27 17:55:57 -04:00
auth_status.rs [MCP] Allow specifying custom headers with streamable http servers (#5241) 2025-10-16 23:15:47 -04:00
find_codex_home.rs [MCP] Add support for MCP Oauth credentials (#4517) 2025-10-03 13:43:12 -04:00
lib.rs [MCP] Prompt mcp login when adding a streamable HTTP server that supports oauth (#5193) 2025-10-15 12:27:40 -04:00
logging_client_handler.rs [MCP] Introduce an experimental official rust sdk based mcp client (#4252) 2025-09-26 13:13:37 -04:00
oauth.rs [Auth] Add keyring support for Codex CLI (#5591) 2025-10-27 12:10:11 -07:00
perform_oauth_login.rs [MCP] Add support for specifying scopes for MCP oauth (#5487) 2025-10-22 09:37:33 -07:00
rmcp_client.rs [MCP] Add support for resources (#5239) 2025-10-17 01:05:15 -04:00
utils.rs [MCP] Allow specifying cwd and additional env vars (#5246) 2025-10-17 00:24:43 -04:00