Skip to content

Commit 721b481

Browse files
enables experimental open api parser
1 parent f18358b commit 721b481

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/mcp/server.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from __future__ import annotations
44

55
from fastapi import FastAPI
6-
from fastmcp import FastMCP
6+
from fastmcp import FastMCP, settings
77

88

99
def build_mcp(app: FastAPI) -> FastMCP:
@@ -15,6 +15,7 @@ def build_mcp(app: FastAPI) -> FastMCP:
1515
if hasattr(app.state, 'mcp'):
1616
return app.state.mcp # type: ignore[attr-defined]
1717

18+
settings.experimental.enable_new_openapi_parser = True
1819
mcp = FastMCP.from_fastapi(app, name=app.title)
1920
app.state.mcp = mcp # type: ignore[attr-defined]
2021
return mcp

0 commit comments

Comments
 (0)