MCP Apps: Build Interactive Apps Directly Inside Your AI Agent’s Chat
From the publisher’s feed, collected in the ZeroLabs newsroom.
A walkthrough of the MCP Apps protocol extension, with a working weather card in Python and a real-world application in LangGraph debugging.A side-by-side comparison showcasing how MCP Apps transforms raw text tool outputs into rich, interactive user interfaces. Source: Image by the authorI remember the first time I saw a tool call result come back from an MCP server. I had just wired up a simple weather tool to Claude, and watching the model reach out, grab live data, and weave it into a response felt genuinely magical. But then I looked at the raw output sitting in the terminal, a wall of JSON, and thought: this is powerful, but it is also a little bleak. The model could tell me the current temperature and conditions, but it could not show me a forecast card, a map, or a live chart. Everything was still just text.That limitation is more significant than it might seem at first. We live in a world where interfaces matter. A plain number is not the same as a graph that lets you spot a trend. MCP gave AI agents a standardized way to reach out and connect with the world, but that world was still trapped in a text-only interface.MCP Apps change that.The polished version of this already exists. Ask Claude for music through the Spotify MCP App and you get a widget you can actually use, not a numbered list in markdown.Spotify MCP App rendering a playlist search result as an interactive widget inside Claude. Source: Image by the authorA quick recap on MCP serversIf you have been keeping up with the AI space over the last year, you have probably heard the term MCP thrown around quite a bit. But for those who are new to it, here is the short version.MCP, or the Model Context Protocol, is an open standard introduced by Anthropic. The core idea is simple: instead of having to build individual one-off integrations for tools and data sources, MCP provides a common interface. An MCP server exposes a set of tools, and any MCP-compatible host, whether that is Claude, Cursor, or your own custom agent, can discover and call those tools in a uniform way. It is often described as the USB of AI tooling.A typical MCP server might expose tools to read and write files, query a database, search the web, or call an external API. That was a genuine step forward. But text-only output is still a real constraint. The tool runs, the data comes back, and what the human sees is usually whatever the host decides to print.What MCP Apps addMCP Apps is a formal extension to MCP, standardized in early 2026. The core idea is that an MCP server can now declare UI resources along with its tools. When a supporting host like Claude calls a tool, it can render a full interactive HTML widget inline in the conversation, not just print the result as text.Three roles show up in every implementation:Server. Your code. It declares tools, serves data, and registers UI layouts at a ui:// URI.Host. The client you chat with (Claude Desktop, Cursor, Copilot, and others).View. HTML and JavaScript running inside that iframe. It renders the tool result and can ask the host to call tools again when the user interacts.Hosts that do not support the extension ignore the UI metadata and keep returning plain tool output. The full specification lives at apps.extensions.modelcontextprotocol.io.What happens when a tool runsThe static breakdown above becomes clearer once you follow a single request through the system. Say the model calls a weather tool:User asks for a forecast → Host calls show_weather on your Server → Server returns data + a ui:// link in tool metadata → Host fetches the HTML resource and mounts it (the View) → Host pushes the tool result into the iframeUser toggles °C / °F or hits Refresh → View asks the Host to call fetch_weather (not the model) → Server returns fresh data; the card updates in placeTwo details matter once you see that loop. First, linking a tool to its UI is one metadata field:"_meta": { "ui": { "resourceUri": "ui://weather-mcp-app/forecast-card.html", "visibility": ["model", "app"] }}Second, not every tool belongs in the model’s tool list. A refresh button or a unit toggle should use visibility: ["app"]. The model never sees those tools. That was the insight that made MCP Apps click for me: they are not prettier JSON in the chat. They are a second client, with their own tools, living inside the conversation.Below, I walk through two applications of that pattern: a weather card I built to learn the loop, and LangMCP, where I am implementing the same approach for LangGraph debugging.Example: Weather CardThe weather demo is deliberately small, but it closes the loop from the opening paragraph. I built it locally as a single Python file with embedded HTML and live data from Open-Meteo, starting with the same weather use case that hooked me in the first place.The model calls show_weather with a city name. The host renders a forecast card: current conditions, a 24-hour strip, and a 7-day outlook. Ask in plain language:What’s the weather in London?Without MCP Apps, the server returns a readable text summaryWeather in London, United Kingdom: 14°C (light drizzle). Feels like 12°C, humidity 90%, wind 21km/h.With the MCP Apps, you see the followingWeather forecast card rendered inside an MCP host. Source: Image by the authorClick Toggle °C / °F or Refresh and the iframe calls fetch_weather, an app-only tool the model never sees.Server sideThe server does three things: link the tool to the view, fetch weather data, and hide the interactive tools from the model.from mcp.server.fastmcp import FastMCPfrom mcp import typesVIEW_URI = "ui://weather-mcp-app/forecast-card.html"mcp = FastMCP("Weather Card", stateless_http=True)@mcp.tool(meta={"ui": {"resourceUri": VIEW_URI}, "ui/resourceUri": VIEW_URI})def show_weather(city: str = "London", units: str = "celsius") -> types.CallToolResult: payload = _lookup(city, units) # Open-Meteo geocode + forecast return types.CallToolResult( content=[types.TextContent(type="text", text=_text_summary(payload))], structuredContent=payload, )@mcp.tool(meta={"ui": {"visibility": ["app"]}})def fetch_weather(city: str, latitude: float, longitude: float, units: str = "celsius") -> types.CallToolResult: """Refresh or toggle units. UI only, hidden from the model.""" payload = _fetch_weather(city=city, latitude=latitude, longitude=longitude, units=units) return types.CallToolResult( content=[types.TextContent(type="text", text=_text_summary(payload))], structuredContent=payload, )@mcp.resource(VIEW_URI, mime_type="text/html;profile=mcp-app", meta={"ui": {"csp": {"resourceDomains": ["https://unpkg.com"]}}})def forecast_card_view() -> str: return EMBEDDED_VIEW_HTMLExternal API calls stay in Python on the server. The view only talks to the host.Enhancing LangMCP using MCP AppsThe weather card was how I learned the protocol. LangMCP is where I am implementing it currently.LangMCP is a read-only MCP server for inspecting LangGraph checkpoints, thread state, and long-term memory. The text tools already work for agents. The MCP App is the view layer I am adding on top, not a rewrite. Same pattern as weather: show_inspector for the model, __ui_* helpers for clicks inside the iframe, the same Python paths behind both.Early progress looks like this thread explorer inside an MCP host:LangMCP thread explorer inside an MCP host. Source: Image by the authorGraph debugging is a better stress test for MCP Apps than a forecast card. Checkpoint history is sequential and branching; nested JSON hides that. Follow development on the LangMCP repository on GitHub.What I took awayThe most powerful AI tools will not be the ones that produce the longest answers. They will be the ones that make the answers easy to understand and act on. A forecast you can toggle between Celsius and Fahrenheit, a schedule you can scan at a glance, a debugging view that lets you step through a graph run without reading raw JSON: these are not cosmetic improvements. They change how quickly a person can understand something and decide what to do next.MCP Apps is a meaningful step in that direction. The data layer already exists. The protocol already works. Adding a UI layer does not require rebuilding anything from scratch, and hosts that do not support it yet simply fall back to plain text. The upgrade is additive.Given how fast the MCP ecosystem is already moving, this is a capability worth getting familiar with now.ResourcesMCP Apps overviewBuild an MCP App (official guide)FastMCP AppsMCP Apps: Build Interactive Apps Directly Inside Your AI Agent’s Chat was originally published in Towards AI on Medium, where people are continuing the conversation by highlighting and responding to this story.