Skip to content

πŸš€ The fast, Pythonic way to build MCP servers and clients.

Polish apps docs for 3.2 release (#3693)

Jeremiah Lowin60d281724572
diff --git a/docs/apps/architecture.mdx b/docs/apps/architecture.mdx
index ee666568f..26588c2f8 100644
--- a/docs/apps/architecture.mdx
+++ b/docs/apps/architecture.mdx
@@ -10,7 +10,7 @@ import { VersionBadge } from '/snippets/version-badge.mdx'
<VersionBadge version="3.2.0" />
-This page explains the internal architecture of Prefab apps β€” how your Python code becomes an interactive UI inside a host client's conversation. If you're building [custom HTML apps](/apps/low-level), the pipeline is simpler and covered on that page. You don't need to understand any of this to build Prefab apps, but the mental model is useful when you're debugging, extending, or contributing.
+This page explains how Prefab apps work under the hood β€” how your Python code becomes an interactive UI inside a host client's conversation. You don't need any of this to build apps, but the mental model is useful when something isn't rendering the way you expect, when tool calls from the UI aren't reaching your server, or when you're building [custom HTML apps](/apps/low-level) and need to understand the protocol directly.
## The Pipeline
diff --git a/docs/apps/low-level.mdx b/docs/apps/low-level.mdx
index 9ce86e3dd..adda74799 100644
--- a/docs/apps/low-level.mdx
+++ b/docs/apps/low-level.mdx
@@ -145,6 +145,8 @@ The `App` object provides:
- **`app.onhostcontextchanged`** β€” callback for host context changes (e.g., safe area insets)
- **`app.getHostContext()`** β€” get current host context
+See the full [ext-apps SDK documentation](https://github.com/modelcontextprotocol/ext-apps) for the complete API reference.
+
<Note>
If your HTML loads external scripts, styles, or makes API calls, you need to declare those domains in the CSP configuration. See [Security](#security) below.
</Note>
diff --git a/docs/apps/providers/file-upload.mdx b/docs/apps/providers/file-upload.mdx
index 7a0cea1c9..13cf2402e 100644
--- a/docs/apps/providers/file-upload.mdx
+++ b/docs/apps/providers/file-upload.mdx
@@ -33,7 +33,7 @@ This registers four tools:
| `list_files` | Model | Returns metadata for all uploaded files |
| `read_file` | Model | Returns a file's contents by name |
-The LLM sees `file_manager`, `list_files`, and `read_file`. It calls `file_manager` to show the upload interface, then uses `list_files` and `read_file` to work with whatever the user uploaded. `store_files` is app-only β€” the UI calls it directly through the `___` routing mechanism and the LLM never needs to know about it.
+The LLM sees `file_manager`, `list_files`, and `read_file`. It calls `file_manager` to show the upload interface, then uses `list_files` and `read_file` to work with whatever the user uploaded. `store_files` is app-only β€” the UI calls it directly and the LLM never needs to know about it.
## Configuration
diff --git a/docs/apps/providers/form.mdx b/docs/apps/providers/form.mdx
index 136e642b8..ca598f33f 100644
--- a/docs/apps/providers/form.mdx
+++ b/docs/apps/providers/form.mdx
@@ -17,6 +17,8 @@ import { VersionBadge } from '/snippets/version-badge.mdx'
</Frame>
```python
+from typing import Literal
+
from pydantic import BaseModel, Field
from fastmcp import FastMCP
from fastmcp.apps.form import FormInput
diff --git a/docs/apps/providers/generative.mdx b/docs/apps/providers/generative.mdx
index 9f5002221..a0795c939 100644
--- a/docs/apps/providers/generative.mdx
+++ b/docs/apps/providers/generative.mdx
@@ -40,10 +40,35 @@ GenerativeUI(
)
```
+## What the LLM Sees
+
+The tool description includes code examples that teach the LLM the Prefab patterns. The LLM calls `generate_prefab_ui` with a `code` argument containing Prefab Python, and optionally a `data` argument to pass in real data from the conversation:
+
+```python
+# The LLM generates something like:
+generate_prefab_ui(
+ code="""
+from prefab_ui.components import Column, Heading
+from prefab_ui.components.charts import BarChart, ChartSeries
+from prefab_ui.app import PrefabApp
+
+with PrefabApp() as app:
+ with Column(gap=4):
+ Heading("Revenue")
+ BarChart(data=data, series=[ChartSeries(data_key="revenue")], x_axis="quarter")
+""",
+ data={"data": [{"quarter": "Q1", "revenue": 42000}, ...]}
+)
+```
+
+The component search tool lets the LLM discover what's available before writing code β€” `search_prefab_components("Chart")` returns matching components with import paths.
+
## Requirements
-Requires `fastmcp[apps]` (installs `prefab-ui`). The Pyodide sandbox for server-side validation requires Deno, which installs automatically on first use. The streaming renderer loads Pyodide from CDN in the browser β€” CSP is configured automatically by the provider.
+Requires `fastmcp[apps]` (installs `prefab-ui`). The Pyodide sandbox for server-side validation requires Deno, which installs automatically on first use. The streaming renderer loads Pyodide from CDN in the browser β€” CSP is configured automatically.
+
+The sandbox includes the Python standard library and Prefab. External packages (NumPy, pandas, etc.) are not available.
## Learn More
-See the full **[Generative UI guide](/apps/generative)** for details on how streaming works, what the LLM writes, how to pass data, and the component search tool.
+The full **[Generative UI guide](/apps/generative)** covers the streaming mechanics in detail, how to pass data, the component search tool, and sandbox limitations.
diff --git a/docs/apps/quickstart.mdx b/docs/apps/quickstart.mdx
new file mode 100644
index 000000000..b172e746b
--- /dev/null
+++ b/docs/apps/quickstart.mdx
@@ -0,0 +1,148 @@
+---
+title: Quickstart
+sidebarTitle: Quickstart
+description: Build your first MCP app in 5 minutes.
+icon: rocket
+tag: NEW
+---
+
+import { VersionBadge } from '/snippets/version-badge.mdx'
+
+<VersionBadge version="3.2.0" />
+
+This tutorial walks you through building a tool that returns an interactive UI instead of text. By the end, you'll have a working app you can preview in your browser.
+
+## Install
+
+MCP Apps use [Prefab UI](https://prefab.prefect.io) for components. Install it with the `apps` extra:
+
+```bash
+pip install "fastmcp[apps]"
+```
+
+## Your First App
+
+A regular MCP tool returns text. An app tool returns a UI. The only difference is `app=True` and a Prefab component as the return value.
+
+Create a file called `server.py` with a tool that renders a sortable, searchable data table:
+
+```python
+from prefab_ui.app import PrefabApp
+from prefab_ui.components import Column, Heading, DataTable, DataTableColumn
+from fastmcp import FastMCP
+
+mcp = FastMCP("My First App")
+
+
+def team_directory() -> PrefabApp:
+ """Browse the team directory."""
+ members = [
+ {"name": "Alice Chen", "role": "Staff Engineer", "office": "San Francisco"},
+ {"name": "Bob Martinez", "role": "Lead Designer", "office": "New York"},
+ {"name": "Carol Johnson", "role": "Senior Engineer", "office": "London"},
+ {"name": "David Kim", "role": "Product Manager", "office": "San Francisco"},
+ {"name": "Eva Mueller", "role": "Engineer", "office": "Berlin"},
+ ]
+
+ with Column(gap=4, css_class="p-6") as view:
+ Heading("Team Directory")
+ DataTable(
+ columns=[
+ DataTableColumn(key="name", header="Name", sortable=True),
+ DataTableColumn(key="role", header="Role", sortable=True),
+ DataTableColumn(key="office", header="Office", sortable=True),
+ ],
+ rows=members,
+ search=True,
+ )
+
+ return PrefabApp(view=view)
+```
+
+That's a full MCP server with one app tool. The `DataTable` component gives you column sorting and full-text search out of the box β€” no JavaScript, no frontend build step.
+
+## Preview It
+
+FastMCP includes a dev server that renders your app tools in a browser:
+
+```bash
+fastmcp dev apps server.py
+```
+
+This opens `http://localhost:8080` with a list of your app tools. Click **team_directory**, and you'll see the rendered table. Try sorting columns and searching β€” it all works client-side.
+
+<Frame>
+ <img src="/apps/images/dev-app.png" alt="The dev UI showing a rendered Prefab app" />
+</Frame>
+
+## Add Interactivity
+
+Static displays are useful, but Prefab apps can also react to user input without any server round-trips. The key is **state** β€” a client-side key-value store that components read from and write to.
+
+Replace your `server.py` with a version that lets the user filter the table by office:
+
+```python
+from prefab_ui.app import PrefabApp
+from prefab_ui.components import (
+ Column, Heading, DataTable, DataTableColumn,
+ Select, SelectOption, If, Else, Text,
+)
+from prefab_ui.rx import Rx
+from fastmcp import FastMCP
+
+mcp = FastMCP("My First App")
+
+MEMBERS = [
+ {"name": "Alice Chen", "role": "Staff Engineer", "office": "San Francisco"},
+ {"name": "Bob Martinez", "role": "Lead Designer", "office": "New York"},
+ {"name": "Carol Johnson", "role": "Senior Engineer", "office": "London"},
+ {"name": "David Kim", "role": "Product Manager", "office": "San Francisco"},
+ {"name": "Eva Mueller", "role": "Engineer", "office": "Berlin"},
+]
+
+
+def team_directory() -> PrefabApp:
+ """Browse the team directory with office filtering."""
+ selected = Rx("selected_office")
+
+ with Column(gap=4, css_class="p-6") as view:
+ Heading("Team Directory")
+
+ with Select(name="selected_office", label="Filter by Office"):
+ SelectOption("All Offices", value="all")
+ SelectOption("San Francisco", value="San Francisco")
+ SelectOption("New York", value="New York")
+ SelectOption("London", value="London")
+ SelectOption("Berlin", value="Berlin")
+
+ with If(selected == "all"):
+ DataTable(
+ columns=[
+ DataTableColumn(key="name", header="Name", sortable=True),
+ DataTableColumn(key="role", header="Role", sortable=True),
+ DataTableColumn(key="office", header="Office", sortable=True),
+ ],
+ rows=MEMBERS,
+ search=True,
+ )
+ with Else():
+ Text(selected.then(f"Showing results for: {selected}", ""))
+
+ return PrefabApp(view=view, state={"selected_office": "all"})
+```
+
+Three things changed:
+
+`Rx("selected_office")` creates a reactive reference β€” it doesn't hold a value in Python, it compiles to an expression the browser evaluates live. `Select(name="selected_office")` automatically syncs its value to the `selected_office` state key on every change. `If(selected == "all")` conditionally shows the full table, while the `Else` branch shows a filtered message. All of this runs instantly in the browser.
+
+The `state` dict on `PrefabApp` sets the initial values. Run `fastmcp dev apps server.py` again and try switching the dropdown.
+
+## Next Steps
+
+You've built a tool that renders an interactive UI. From here:
+
+- **[Prefab UI](/apps/prefab)** covers the full component library β€” charts, forms, badges, progress bars, conditional rendering, and the reactive state system in depth.
+- **[FastMCPApp](/apps/interactive-apps)** is the next step when your UI needs to call backend tools β€” forms that save data, search that queries a database, multi-step workflows.
+- **[App Providers](/apps/providers/approval)** are ready-made apps you can add to any server with a single `add_provider()` call β€” approval flows, file uploads, form builders, and more.
diff --git a/docs/docs.json b/docs/docs.json
index 017078aab..d3b2839f9 100644
--- a/docs/docs.json
+++ b/docs/docs.json
@@ -196,6 +196,7 @@
"group": "Apps",
"pages": [
"apps/overview",
+ "apps/quickstart",
{
"collapsed": true,
"group": "Building Apps",