freddyaboulton HF Staff commited on
Commit
6e5e21d
·
verified ·
1 Parent(s): ecde3f5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -4
app.py CHANGED
@@ -24,7 +24,7 @@ mcp = FastMCP(
24
  # Auth settings for RFC 9728 Protected Resource Metadata
25
  auth=AuthSettings(
26
  issuer_url=AnyHttpUrl("https://huggingface.co/.well-known/oauth-authorization-server"), # Authorization Server URL
27
- resource_server_url=AnyHttpUrl("https://freddyaboulton-fastmcp-oauth.hf.space"), # This server's URL
28
  required_scopes=["inference-api"],
29
  ),
30
  )
@@ -48,11 +48,15 @@ async def lifespan(app: FastAPI):
48
 
49
 
50
  app = FastAPI(lifespan=lifespan)
 
 
 
 
51
  app.mount("/", mcp.streamable_http_app())
52
 
53
- @app.get("/")
54
- async def _():
55
- return JSONResponse({"message": "Welcome to the Weather Service!"})
56
 
57
  # @app.get("/.well-known/oauth-protected-resource")
58
  # async def _():
 
24
  # Auth settings for RFC 9728 Protected Resource Metadata
25
  auth=AuthSettings(
26
  issuer_url=AnyHttpUrl("https://huggingface.co/.well-known/oauth-authorization-server"), # Authorization Server URL
27
+ resource_server_url=AnyHttpUrl("https://freddyaboulton-fastmcp-oauth.hf.space/mcp"), # This server's URL
28
  required_scopes=["inference-api"],
29
  ),
30
  )
 
48
 
49
 
50
  app = FastAPI(lifespan=lifespan)
51
+ @app.get("/mcp/.well-known/oauth-protected-resource")
52
+ async def _():
53
+ return RedirectResponse(".well-known/oauth-protected-resource")
54
+
55
  app.mount("/", mcp.streamable_http_app())
56
 
57
+ # @app.get("/")
58
+ # async def _():
59
+ # return JSONResponse({"message": "Welcome to the Weather Service!"})
60
 
61
  # @app.get("/.well-known/oauth-protected-resource")
62
  # async def _():