Skip to content

Commit 4eafb28

Browse files
committed
Fix deprecation
1 parent a3c75ca commit 4eafb28

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/server.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
load_dotenv()
1818

19-
mcp = FastMCP("SerpApi MCP Server", stateless_http=True, json_response=True)
19+
mcp = FastMCP("SerpApi MCP Server")
2020
logger = logging.getLogger(__name__)
2121

2222

@@ -210,14 +210,16 @@ def main():
210210
allow_headers=["*"],
211211
),
212212
]
213-
starlette_app = mcp.http_app(middleware=middleware)
213+
starlette_app = mcp.http_app(
214+
middleware=middleware, stateless_http=True, json_response=True
215+
)
214216

215217
starlette_app.add_route("/healthcheck", healthcheck_handler, methods=["GET"])
216218

217219
host = os.getenv("MCP_HOST", "0.0.0.0")
218220
port = int(os.getenv("MCP_PORT", "8000"))
219221

220-
uvicorn.run(starlette_app, host=host, port=port)
222+
uvicorn.run(starlette_app, host=host, port=port, ws="none")
221223

222224

223225
if __name__ == "__main__":

0 commit comments

Comments
 (0)