We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4b906d4 commit cf325e4Copy full SHA for cf325e4
1 file changed
src/mcp/server.py
@@ -3,7 +3,7 @@
3
from __future__ import annotations
4
5
from fastapi import FastAPI
6
-from fastmcp import FastMCP, settings
+from fastmcp import FastMCP
7
8
9
def build_mcp(app: FastAPI) -> FastMCP:
@@ -17,10 +17,9 @@ def build_mcp(app: FastAPI) -> FastMCP:
17
FastMCP: The FastMCP instance corresponding to the provided FastAPI app.
18
"""
19
20
- if hasattr(app.state, 'mcp'):
+ if hasattr(app.state, "mcp"):
21
return app.state.mcp # type: ignore[attr-defined]
22
23
- settings.experimental.enable_new_openapi_parser = True
24
mcp = FastMCP.from_fastapi(app, name=app.title)
25
app.state.mcp = mcp # type: ignore[attr-defined]
26
return mcp
0 commit comments