+
+ # Create the ASGI app
+ mcp_app = mcp.http_app(
+ path="/mcp",
+ # middleware=middleware
+ )
+
+ # Create a Starlette app and mount the MCP server
+ app = Starlette(
+ routes=[
+ Mount("/mcp-server", app=mcp_app),
+ # Add other routes as needed
+ ],
+ lifespan=mcp_app.lifespan,
+ )
+
+ # http_app = mcp.http_app(transport="streamable-http",path="/",middleware=custom_middleware)
+ http_app = mcp.http_app(transport="streamable-http",path="/",middleware=middleware)
+ # http_app = mcp.http_app(transport="streamable-http",path="/")
+ uvicorn.run(http_app, host=MY_IP, port=9000)
+