Model Context Protocol logo FastMCP logo

Multimodal MCP servers with images and apps

About me

Pamela Fox

Principal Cloud Advocate at Microsoft / GitHub

Formerly: UC Berkeley, Coursera,
Khan Academy, Google

Pamela Fox smiling with an Olaf statue

MCP Server architecture

You MCP Host e.g. GitHub Copilot, VS Code Chat UI find summer dresses ▸ image_search ▸ display_image_files App View sandboxed iframe Use Ask Collage HTML from a ui:// resource, talks only to the host Here are two summer dresses from your closet. Ask anything… LLM MCP client one per server App bridge handles ui/*, proxies tools/call tool calls proxied calls prompts postMessage JSON-RPC MCP JSON-RPC over HTTP MCP Server FastMCP TOOLS image_search returns image content display_image_files renders an MCP App (gallery) generate_image MCP App, or image content fallback UI RESOURCES ui://image-search/generated-image.html ui://image-search/image-viewer.html Entra ID Azure Foundry IQ hybrid search on: • LLM-written photo descriptions • Image embedding vectors Blob Storage original closet photos JPEG, ~1–1.5 MB each MAI-Image-2.7 image generation API

MCP client–server discovery

As of MCP 2026-07-28 spec, there is no initialization handshake. Each request declares its version and capabilities.

Discover

The host's MCP client sends requests to the server's /mcp endpoint (Streamable HTTP).

server/discover is optional for clients. They can call tools directly without initializing a session.

Older clients still use initialize → response → notifications/initialized. FastMCP 4 supports both flows.

display_image_files: MCP tool that returns MCP app

display_image_files: who sees which part?

tools/call result from display_image_files content [{"type": "text", "text": "Retrieved 2 images: IMG_2616.jpg (A floral-print dress …); IMG_2606.jpg (A sleeveless, V-neck dress …)."}] structuredContent {"images": [ {"filename": "IMG_2616.jpg", "description": "A floral-print dress …", "mimeType": "image/jpeg", "width": 1603, "height": 3430, "format": "JPEG", "sizeBytes": 1346952}, …]} _meta {"imageData": [ "/9j/4AAQSkZJRgABAQAAAQAB…", "/9j/4AAQSkZJRgABAQAAAQAB…"]} base64 full-size originals, ~1.7 MB of text each LLM added to the model context MCP Host chat UI may show content as tool output App View gallery iframe structuredContent → captions, sizes _meta.imageData → full-size pixels Gallery reads both in app.ontoolresult

Three ways the App View talks back

App View gallery iframe 2 images selected Make a collage Use in next message Ask in chat… tools/call MCP Server runs generate_image; result returns to the App View ui/update-model-context LLM selection added to context for the next turn ui/message MCP Host posts a new user message in the chat

The App calls a tool: “Make a collage”

generate_image is an MCP tool that the LLM or the App View can call. Here, the App View calls it.

In the gallery

You select 2 photos and click Make a collage (enabled for 2–5).

The App updates the model context: “Use in next message”

ui/update-model-context stores your selection, and the host adds it to your next message.

In the gallery

You select 2 photos and click Use in next message. Nothing shows up in the chat yet.

The App sends a message: “Ask in chat…”

ui/message posts your question and selection as a new user message.

In the gallery

You select 2 photos, click Ask in chat…, type a question, and click Send to chat.

generate_image: one tool, two result shapes

The server checks client capabilities in the request's _meta (or initialize for legacy clients).

tools/call generate_image from the model, or from an App View MAI-Image-2.7 returns a PNG ctx.client_supports_extension( "io.modelcontextprotocol/ui") Does this request's client declare MCP Apps support? yes Apps client content: [{"type": "text", "text": "Image generated…"}, {"type": "image", "data": "iVBOR…"}] # 256px structuredContent: {"prompt": …, "reference_images": …, "output_size": …, "inline_size": …, "usage": …} _meta: {"imageData": ["iVBORw0KGgo…"]} Model context sees text + a 256px thumbnail full PNG in _meta isn't model context App View renders the PNG generated-image.html, or the gallery's collage (callServerTool) no Client without Apps content: [{"type": "image", "mimeType": "image/png", "data": "iVBORw0KGgo…"}] structuredContent: {"prompt": …, "reference_images": …, "output_size": …, "inline_size": …, "usage": …} Model sees the image image content is model input so it can describe or iterate on it Chat shows it inline host renders image content no App View, so nothing renders twice

Open questions: what would you do?

When a tool has an App View, should it also return the image as content?

Our approach

Yes, but as a 256px thumbnail for the model. The full PNG goes in _meta for the App View.

Where should large bytes go?

(Considering that some hosts send structuredContent to the model)

Our approach

_meta. Resource links or blob URLs could work too.

Should tools that only make sense in an App View be hidden from clients without Apps?

Our approach

display_image_files is listed for every client. Without Apps, it returns only text.

If a host doesn't declare a feature it supports, is host sniffing OK?

Our approach

No. We trust declared capabilities, so “Ask in chat…” stayed hidden in VS Code until it declared message.

Model Context Protocol logo

Thank you!

Slides: đź”— pamelafox.github.io/my-py-talks/mcp-images-apps
Code: đź”— github.com/Azure-Samples/image-search-aisearch

Twitterđź”— @pamelafox
LinkedInđź”— linkedin.com/in/pamela-s-fox
GitHubđź”— github.com/pamelafox
Websiteđź”— pamelafox.org