fastmcp/docs/python-sdk/fastmcp-server-openapi-server.mdx
Jeremiah Lowin 9b248a15b3
Update repository references for transfer to prefecthq (#3207)
* Update repository references from jlowin/fastmcp to prefecthq/fastmcp

* Retrigger CI after repo transfer

* chore: Update SDK documentation

* Only run deep triage on bug issues for jlowin

---------

Co-authored-by: marvin-context-protocol[bot] <225465937+marvin-context-protocol[bot]@users.noreply.github.com>
2026-02-18 10:33:56 -05:00

43 lines
1.1 KiB
Text

---
title: server
sidebarTitle: server
---
# `fastmcp.server.openapi.server`
FastMCPOpenAPI - backwards compatibility wrapper.
This class is deprecated. Use FastMCP with OpenAPIProvider instead:
from fastmcp import FastMCP
from fastmcp.server.providers.openapi import OpenAPIProvider
import httpx
client = httpx.AsyncClient(base_url="https://api.example.com")
provider = OpenAPIProvider(openapi_spec=spec, client=client)
mcp = FastMCP("My API Server", providers=[provider])
## Classes
### `FastMCPOpenAPI` <sup><a href="https://github.com/PrefectHQ/fastmcp/blob/main/src/fastmcp/server/openapi/server.py#L30" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>
FastMCP server implementation that creates components from an OpenAPI schema.
.. deprecated::
Use FastMCP with OpenAPIProvider instead. This class will be
removed in a future version.
Example (deprecated):
```python
from fastmcp.server.openapi import FastMCPOpenAPI
import httpx
server = FastMCPOpenAPI(
openapi_spec=spec,
client=httpx.AsyncClient(),
)
```