Update server.py
Browse files
server.py
CHANGED
@@ -224,8 +224,9 @@ async def list_tools(request: Request) -> JSONResponse:
|
|
224 |
"""Return all registered tool metadata as JSON."""
|
225 |
return JSONResponse(tool_registry)
|
226 |
|
227 |
-
# Add the Hugging Face token auth middleware
|
228 |
-
mcp.streamable_http_app
|
|
|
229 |
|
230 |
if __name__ == "__main__":
|
231 |
-
uvicorn.run(
|
|
|
224 |
"""Return all registered tool metadata as JSON."""
|
225 |
return JSONResponse(tool_registry)
|
226 |
|
227 |
+
# Add the Hugging Face token auth middleware at app construction time
|
228 |
+
app = mcp.streamable_http_app()
|
229 |
+
app.add_middleware(HuggingFaceTokenAuthMiddleware)
|
230 |
|
231 |
if __name__ == "__main__":
|
232 |
+
uvicorn.run(app, host="0.0.0.0", port=8000)
|