fastmcp.apps.app
FastMCPApp — a Provider that represents a composable MCP application.
FastMCPApp binds entry-point tools (model calls these) together with backend
tools (the UI calls these via CallTool). Backend tools are tagged with
meta["fastmcp"]["app"] so they can be found through the provider chain
even when transforms (namespace, visibility, etc.) have renamed or hidden
them — the server sets a context var that tells Provider.get_tool to
fall back to a direct lookup for app-visible tools.
Usage::
from fastmcp import FastMCP, FastMCPApp
app = FastMCPApp(“Dashboard”)
@app.ui()
def show_dashboard() -> Component:
return Column(…)
@app.tool()
def save_contact(name: str, email: str) -> str:
return name
server = FastMCP(“Platform”)
server.add_provider(app)
Classes
FastMCPApp
A Provider that represents an MCP application.
Binds together entry-point tools (@app.ui), backend tools
(@app.tool), and the Prefab renderer resource. Backend tools
are tagged with meta["fastmcp"]["app"] so Provider.get_tool
can find them by original name even when transforms have been applied.
Methods:
tool
tool
tool
visibility=["app"]. Pass model=True
to also expose the tool to the model (visibility=["app", "model"]).
Supports multiple calling patterns::
@app.tool
def save(name: str): …
@app.tool()
def save(name: str): …
@app.tool(“custom_name”)
def save(name: str): …
ui
ui
ui
visibility=["model"] and auto-wire
the Prefab renderer resource and CSP. They are tagged with the app
name so structured content includes _meta.fastmcp.app.
Supports multiple calling patterns::
@app.ui
def dashboard() -> Component: …
@app.ui()
def dashboard() -> Component: …
@app.ui(“my_dashboard”)
def dashboard() -> Component: …

