mirror of
https://github.com/PrefectHQ/fastmcp.git
synced 2026-08-21 04:54:17 +02:00
chore: Update SDK documentation (#2604)
Co-authored-by: marvin-context-protocol[bot] <225465937+marvin-context-protocol[bot]@users.noreply.github.com>
This commit is contained in:
parent
ae3c2abbf6
commit
9d5ffa86b3
55 changed files with 3213 additions and 1480 deletions
|
|
@ -6,15 +6,38 @@ sidebarTitle: server
|
|||
# `fastmcp.server.openapi.server`
|
||||
|
||||
|
||||
FastMCP server implementation for OpenAPI integration.
|
||||
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/jlowin/fastmcp/blob/main/src/fastmcp/server/openapi/server.py#L62" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>
|
||||
### `FastMCPOpenAPI` <sup><a href="https://github.com/jlowin/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.
|
||||
|
||||
This class parses an OpenAPI specification and creates appropriate FastMCP components
|
||||
(Tools, Resources, ResourceTemplates) based on route mappings.
|
||||
.. 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(),
|
||||
)
|
||||
```
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue