From 5464efc794efc929dba335349ba818f5b8dde22f Mon Sep 17 00:00:00 2001 From: Jeremiah Lowin <153965+jlowin@users.noreply.github.com> Date: Sat, 10 May 2025 11:42:07 -0400 Subject: [PATCH] Update asgi.mdx --- docs/deployment/asgi.mdx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/docs/deployment/asgi.mdx b/docs/deployment/asgi.mdx index 51815eab5..f676ff68a 100644 --- a/docs/deployment/asgi.mdx +++ b/docs/deployment/asgi.mdx @@ -5,6 +5,9 @@ description: Integrate FastMCP servers into existing Starlette, FastAPI, or othe icon: plug --- +import { VersionBadge } from '/snippets/version-badge.mdx' + + While FastMCP provides standalone server capabilities, you can also integrate your FastMCP server into existing web applications. This approach is useful for: - Adding MCP functionality to an existing website or API @@ -16,11 +19,14 @@ Please note that all FastMCP servers have a `run()` method that can be used to s ## ASGI Server - FastMCP servers can be created as [Starlette](https://www.starlette.io/) ASGI apps for straightforward hosting or integration into existing applications. The first step is to obtain a Starlette application instance from your FastMCP server using the `http_app()` method: + +The `http_app()` method is new in FastMCP 2.3.2. In older versions, use `sse_app()` for SSE transport or `streamable_http_app()` for Streamable HTTP transport. + + ```python from fastmcp import FastMCP