Believe it or not, that dashboard is a FastMCP tool. The chart has tooltips. The table is sortable. The badges are styled by deal stage. The whole thing is about 40 lines of Python, and the user sees it right inside their conversation instead of a wall of JSON. The pattern behind every example on this page is the same: addDocumentation Index
Fetch the complete documentation index at: https://gofastmcp.com/llms.txt
Use this file to discover all available pages before exploring further.
app=True to your tool, build a UI with Prefab components, and return it as a PrefabApp. Prefab has 100+ components, from data tables and charts to forms and progress bars. You compose them in Python; the host renders them as a live, interactive application.
Start with a table
Most tools return data the user wants to explore. ADataTable is often the smallest useful upgrade — your data goes from a JSON blob to a searchable, sortable table:
app=True, return a Prefab component instead of raw dicts. FastMCP handles the rendering, sandboxing, and security. No wrapper class needed for simple cases like this.
Add charts
When numbers tell a better story as a visual, swap in a chart. The API is the same: pass your data as a list of dicts, tell the chart which keys to plot.ChartSeries plots a different key from the data. BarChart, LineChart, AreaChart, PieChart, RadarChart, and RadialChart all follow the same pattern. Hover over the bars to see tooltips.
Compose a dashboard
Tables and charts are useful on their own, but the real power comes from composing them.Column stacks children vertically, Row lays them out side by side, and with blocks establish nesting — the indentation is the layout.
Badge components can be placed inside table cells — any Prefab component works as a cell value, so you can put progress bars, icons, or buttons in your tables too.
Make it reactive
Everything above renders once from the data your Python provides. But interactive tools can also respond to user input in real time, without any server round-trips. Prefab’s state system lets components read and write client-side values, so the UI updates instantly as the user interacts with it. Try switching regions in the dropdown, and toggling the switch on and off.state dict on PrefabApp declares initial values. The Select writes to the region key on every change. A let binding picks the matching dataset, and the chart re-renders. The Switch toggles a Metric on and off through If(Rx("show_target")). All of this happens in the browser — no calls back to your server.
Rx is a reactive reference: Rx("region") compiles to an expression the renderer evaluates live. It supports arithmetic, comparisons, formatting pipes (.currency(), .percent()), and ternary conditionals (.then()). For the full state system, see the Prefab state docs and expression docs.
Content Security Policy
Interactive tools render in a sandboxed iframe with a strict CSP. If your tool loads external resources — embedding iframes, fetching from APIs, loading scripts — add the required domains:PrefabAppConfig() with no arguments is equivalent to app=True.
Giving the LLM context
By default, the LLM sees"[Rendered Prefab UI]" as the tool result. If the model needs to reason about the data, return a ToolResult with a text summary alongside the UI:
Next steps
- FastMCPApp — when your UI needs to call backend tools (forms, search, CRUD)
- Generative UI — let the LLM design the UI at runtime
- Custom HTML — when Prefab isn’t enough (maps, 3D, your own framework)
- Examples — complete working servers you can run today
- Development — preview your tools locally with
fastmcp dev apps - Prefab UI — full component reference with 100+ components, theming, and advanced patterns

