How to Install FastMCP on Windows, macOS and Linux
Check your Python version, install the package with uv or pip, confirm it works and fix the problems people meet most often.
Read articleLet tools return forms, tables and charts that render in the conversation, and preview them locally.

pip install "fastmcp[apps]".app=True on a tool and return a Prefab component.fastmcp dev apps my_server.py.prefab-ui before deploying.Text is not always the clearest answer. A list of figures is easier to read as a chart, and a request for several details is easier to complete as a form. FastMCP Apps let a tool return an interactive interface that the host application renders inside the conversation.
An app tool is an ordinary tool with one difference: instead of returning a string or a value, it returns a user-interface component. The host displays that component in place, and the person can interact with it without leaving the chat. Typical examples include searchable tables, charts, forms and small dashboards.
Apps form the third pillar of FastMCP, alongside servers and clients. They build on everything you already know about tools: type hints still define the schema, and the docstring still tells the model when to call the tool.
App support depends on additional packages, published as an optional extra:
pip install "fastmcp[apps]"
# or
uv add "fastmcp[apps]"The extra installs the Prefab component library that app tools use to describe interfaces.
Set app=True on the tool decorator and return a Prefab component instead of plain text. The official documentation illustrates the pattern with a searchable staff directory:
# Excerpt: see the Apps quickstart for the imports and data setup
@mcp.tool(app=True)
def team_directory() -> DataTable:
"""Show the team directory as a searchable table."""
return DataTable(columns=[...], rows=employees, search=True)Here DataTable is a Prefab component, employees is your data and search=True adds a search box. Other components cover charts, forms and layouts; the Apps section of the documentation lists them all with their options.
FastMCP offers several levels of control, so you can start simple and go further only when you need to:
| Approach | What it gives you |
|---|---|
Prefab components with app=True | Ready-made tables, charts and forms returned from a tool |
| Generative UI provider | Registered with mcp.add_provider(GenerativeUI()); the model writes Prefab code for the current data and request |
| Interaction providers | One-line additions for approvals, choice pickers, file upload and forms |
FastMCPApp | Interfaces that call back to your server |
| Custom HTML, CSS and JavaScript | Full control over every detail |
You do not need a full AI application to see how an app looks. The CLI includes a browser preview, added in FastMCP 3.2:
fastmcp dev apps my_server.pyBy default the MCP server listens on port 8000 and the preview on port 8080; change them with --mcp-port and --dev-port. Auto-reload and a log panel are switched on, so you can adjust layout and data and see the result immediately.
prefab-ui version but no upper limit, so pin prefab-ui to a specific version in your own dependencies before you deploy.uv add "prefab-ui==<version you tested>"For short answers, plain text remains the better option; an interface adds weight that a one-line reply does not need.
App tools are still tools, so the in-memory client and pytest work as usual for checking that they are registered and accept the expected arguments. Use the browser preview for the visual side: layout, labels and behaviour with real data.
Apps extend tools from returning answers to returning experiences. Install the extra, add app=True, return a component, pin the component library and preview the result locally before connecting it to a host.
Support depends on the host application. Check your host's documentation, and keep each app tool's docstring clear so the model knows what the tool returns.
No. Prefab components such as tables, charts and forms cover most needs. Custom HTML, CSS and JavaScript remain available when you need complete control.
The documentation describes Prefab as under active development with frequent breaking changes. FastMCP sets only a minimum version, so pinning protects deployed servers from unexpected updates.
Yes. App tools are still tools, so the in-memory client can confirm they are registered and accept the expected arguments. Use the browser preview to check the visual result.
Check your Python version, install the package with uv or pip, confirm it works and fix the problems people meet most often.
Read articleWrite a single-file server with a tool, a resource and a prompt, run it locally or over HTTP and call it from Python.
Read articleThe three MCP building blocks compared: what each one does, how to declare it and which to choose for a given job.
Read article