mirror of
https://github.com/PrefectHQ/fastmcp.git
synced 2026-08-23 05:54:19 +02:00
Update asgi.mdx
This commit is contained in:
parent
0933670ebd
commit
5464efc794
1 changed files with 7 additions and 1 deletions
|
|
@ -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:
|
||||
|
||||
<Tip>
|
||||
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.
|
||||
</Tip>
|
||||
|
||||
```python
|
||||
from fastmcp import FastMCP
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue